diff options
author | <philippe colliot> | 2014-07-17 18:10:30 +0200 |
---|---|---|
committer | <philippe colliot> | 2014-07-17 18:10:30 +0200 |
commit | 59a07f1904acc2604ee605ab6681c76fc7ba915e (patch) | |
tree | b10ffbe9d1d559fd4da4ef2f4d2b853330a75c33 /test | |
parent | 18c65a4f5e3c20ce204cf1bf0b44fda8523d35cd (diff) | |
download | navigation-59a07f1904acc2604ee605ab6681c76fc7ba915e.tar.gz |
[FSA] migration to Qt5 completed, hmi launcher
Diffstat (limited to 'test')
-rw-r--r-- | test/script/simulation-dashboard.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/test/script/simulation-dashboard.py b/test/script/simulation-dashboard.py index 00d14e9..b010b68 100644 --- a/test/script/simulation-dashboard.py +++ b/test/script/simulation-dashboard.py @@ -53,9 +53,10 @@ YELLOW = ( 255, 222, 0) # Define some constants PI = 3.141592653 -PERIODICITY = 1000 #in ms -FUEL_CONVERSION = (3.6/PERIODICITY) -SPEED_CONVERSION = (36.0/PERIODICITY) +KEYBOARD_PERIODICITY = 200 #in ms +GET_DBUS_PERIODICITY = 1000 #in ms +FUEL_CONVERSION = (3.6/GET_DBUS_PERIODICITY) +SPEED_CONVERSION = (36.0/GET_DBUS_PERIODICITY) # Item location on the screen STATUS_LOCATION = (100,10) @@ -109,8 +110,8 @@ def initDisplay(): displayLatitude('0') displayLongitude('0') displayVehicleSpeed('0') - -def steps(): + +def getKeyboard(): global step for event in pygame.event.get(): @@ -129,18 +130,19 @@ def steps(): elif keys[K_x]: step=Step.END + return True + +def getDbus(): + global step + # manage the logreplayer depending on the step if step==Step.START: - displayStep( str(step) ) launch("start.log") elif step==Step.INITIALIZATION: - displayStep( str(step) ) launch("initialization.log") elif step==Step.HIGH_TANK_LEVEL: - displayStep( str(step) ) launch("high-tank-level.log") elif step==Step.LOW_TANK_LEVEL: - displayStep( str(step) ) launch("low-tank-level.log") elif step==Step.END: displayStatus( 'End simulation ' ) @@ -167,6 +169,8 @@ def steps(): longitude=float(geoLocation[dbus.UInt16(Genivi.ENHANCEDPOSITIONSERVICE_LONGITUDE)]) displayLongitude("{:.3f}".format(longitude)) + displayStep( str(step) ) + # refresh screen refresh() @@ -218,7 +222,8 @@ refresh() # start step = Step.START -gobject.timeout_add(PERIODICITY,steps) +gobject.timeout_add(KEYBOARD_PERIODICITY,getKeyboard) +gobject.timeout_add(GET_DBUS_PERIODICITY,getDbus) loop = gobject.MainLoop() loop.run() |