aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-08-12 10:13:45 +0300
committerGitHub <noreply@github.com>2016-08-12 10:13:45 +0300
commit5d3b7cbe5924d4a4552035626a83e26b1e756255 (patch)
tree18c1caaba30f7bb9e6c21cce492d93a85ebc1c73 /tools
parent1f11fa7db020f8a46e4b298dc61277460d76b678 (diff)
parent9a55f2b000956717d5caf6fb53793264c0376ce7 (diff)
downloadtrackermap-server-5d3b7cbe5924d4a4552035626a83e26b1e756255.tar.gz
trackermap-server-5d3b7cbe5924d4a4552035626a83e26b1e756255.tar.bz2
trackermap-server-5d3b7cbe5924d4a4552035626a83e26b1e756255.zip
Merge pull request #2206 from Abyss777/ignition
Ignition and Motor Hours
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