aboutsummaryrefslogtreecommitdiff
path: root/inputs
diff options
context:
space:
mode:
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