aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-08-11 11:34:51 +0500
committerAbyss777 <abyss@fox5.ru>2016-08-11 11:34:51 +0500
commit46be66c0639032c8ebf222f79e3a52b2b120ad24 (patch)
tree7fe77ba8692592ea5676665035f1c8a3daea6352 /tools
parentd89466435165e978429b609f43d3e5904212da3b (diff)
downloadtraccar-server-46be66c0639032c8ebf222f79e3a52b2b120ad24.tar.gz
traccar-server-46be66c0639032c8ebf222f79e3a52b2b120ad24.tar.bz2
traccar-server-46be66c0639032c8ebf222f79e3a52b2b120ad24.zip
- Enabled IgnitionEventHandler in pipeline
- Added motorHours to SummaryReport - Added ignition to test-generator.py
Diffstat (limited to 'tools')
-rwxr-xr-xtools/test-generator.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/test-generator.py b/tools/test-generator.py
index 41a32a565..0b8e4113c 100755
--- a/tools/test-generator.py
+++ b/tools/test-generator.py
@@ -32,10 +32,12 @@ for i in range(0, len(waypoints)):
lon = lon1 + (lon2 - lon1) * j / count
points.append((lat, lon))
-def send(conn, lat, lon, course, alarm):
+def send(conn, lat, lon, course, alarm, ignition):
params = (('id', id), ('timestamp', int(time.time())), ('lat', lat), ('lon', lon), ('bearing', course))
if alarm:
params = params + (('alarm', 'sos'),)
+ if ignition:
+ params = params + (('ignition', 'true'),)
conn.request('GET', '?' + urllib.urlencode(params))
conn.getresponse().read()
@@ -56,6 +58,7 @@ while True:
(lat1, lon1) = points[index % len(points)]
(lat2, lon2) = points[(index + 1) % len(points)]
alarm = ((index % 10) == 0)
- send(conn, lat1, lon1, course(lat1, lon1, lat2, lon2), alarm)
+ ignition = ((index % len(points)) != 0)
+ send(conn, lat1, lon1, course(lat1, lon1, lat2, lon2), alarm, ignition)
time.sleep(period)
index += 1