aboutsummaryrefslogtreecommitdiff
path: root/inputs
diff options
context:
space:
mode:
authorGravatar rcoh <rcoh@mit.edu>2011-01-03 22:28:28 -0500
committerGravatar rcoh <rcoh@mit.edu>2011-01-03 22:28:28 -0500
commitf5c29b39f3eef83227e3fb7c550d9b2922a19894 (patch)
treed8b1575b49762756ae1cbd152b9c5f51f3f93801 /inputs
parentba796403d111ffc3b29620647f38bc5541840ccb (diff)
fixed a bug caused by util stuff. some new functionality, not all fully implemented.
Diffstat (limited to 'inputs')
-rw-r--r--inputs/RandomLocs.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/inputs/RandomLocs.py b/inputs/RandomLocs.py
new file mode 100644
index 0000000..d1ce1c7
--- /dev/null
+++ b/inputs/RandomLocs.py
@@ -0,0 +1,13 @@
+import util.TimeOps as clock
+import random
+import util.Geo as Geo
+import util.Strings as Strings
+from operationscore.Input import *
+class RandomLocs(Input):
+ def inputInit(self):
+ self['LastEvent'] = clock.time()
+ def sensingLoop(self): #TODO: move to params
+ currentTime = clock.time()
+ if currentTime - self['LastEvent'] > 2000:
+ self.respond({Strings.LOCATION: Geo.randomLoc((50,50))})
+ self['LastEvent'] = currentTime