diff options
author | <philippe colliot> | 2014-06-10 10:47:29 +0200 |
---|---|---|
committer | <philippe colliot> | 2014-06-10 10:47:29 +0200 |
commit | 9ea94fbf01b05716e79f183dfefc794305ff8225 (patch) | |
tree | 221ab31dc9f52fa2e20b7f55901327081e3ca9e2 /test | |
parent | e6be1910b6a8a818aeee37bbf065ce7800b55448 (diff) | |
download | navigation-9ea94fbf01b05716e79f183dfefc794305ff8225.tar.gz |
Test panel and script updates
Diffstat (limited to 'test')
-rw-r--r-- | test/resource/high-tank-level.log | 4 | ||||
-rw-r--r-- | test/resource/initialization.log | 2 | ||||
-rw-r--r-- | test/resource/low-tank-level.log | 3 | ||||
-rw-r--r-- | test/resource/start.log | 1 | ||||
-rw-r--r-- | test/script/dashboard.png | bin | 5416 -> 7524 bytes | |||
-rw-r--r-- | test/script/dashboard.xcf | bin | 21638 -> 30528 bytes | |||
-rw-r--r-- | test/script/simulation-dashboard.py | 31 |
7 files changed, 33 insertions, 8 deletions
diff --git a/test/resource/high-tank-level.log b/test/resource/high-tank-level.log index 3bf08e1..48edf6a 100644 --- a/test/resource/high-tank-level.log +++ b/test/resource/high-tank-level.log @@ -14,9 +14,9 @@ 0,0$GVSNSVER,2,0,0 0,0$GVVEHVER,0,0,0 200,0$GVGNSP,200,46.201839,6.146647,0,0X03 -200,0$GVSNSVEHSP,90,0.00,0X01 +200,0$GVSNSVEHSP,200,90.00,0X01 200,0$GVGNSC,200,11.111111,0,27.000000,0X05 200,0$GVVEHENGSPEED,2000,0X01 200,0$GVVEHFUELLEVEL,30,0X01 200,0$GVVEHFUELCONS,300,0X01 -200,0$GVVEHTOTALODO,10000,0x01 +200,0$GVVEHTOTALODO,500,0x01 diff --git a/test/resource/initialization.log b/test/resource/initialization.log index 45534ec..bad1b25 100644 --- a/test/resource/initialization.log +++ b/test/resource/initialization.log @@ -19,4 +19,4 @@ 200,0$GVVEHENGSPEED,800,0X01 200,0$GVVEHFUELLEVEL,30,0X01 200,0$GVVEHFUELCONS,20,0X01 -200,0$GVVEHTOTALODO,10000,0x01 +200,0$GVVEHTOTALODO,0,0x01 diff --git a/test/resource/low-tank-level.log b/test/resource/low-tank-level.log index 5498d8d..655138c 100644 --- a/test/resource/low-tank-level.log +++ b/test/resource/low-tank-level.log @@ -14,8 +14,9 @@ 0,0$GVSNSVER,2,0,0 0,0$GVVEHVER,0,0,0 200,0$GVGNSP,200,46.201839,6.146647,0,0X03 -200,0$GVSNSVEHSP,200,90,0X01 +200,0$GVSNSVEHSP,200,90.00,0X01 200,0$GVGNSC,200,11.111111,0,27.000000,0X05 200,0$GVVEHENGSPEED,2000,0X01 200,0$GVVEHFUELLEVEL,15,0X01 200,0$GVVEHFUELCONS,300,0X01 +200,0$GVVEHTOTALODO,500,0x01 diff --git a/test/resource/start.log b/test/resource/start.log index 675b8b9..5c52fb9 100644 --- a/test/resource/start.log +++ b/test/resource/start.log @@ -19,3 +19,4 @@ 200,0$GVVEHENGSPEED,0,0X01 200,0$GVVEHFUELLEVEL,30,0X01 200,0$GVVEHFUELCONS,0,0X01 +200,0$GVVEHTOTALODO,0,0x01 diff --git a/test/script/dashboard.png b/test/script/dashboard.png Binary files differindex 20f9907..d52b84f 100644 --- a/test/script/dashboard.png +++ b/test/script/dashboard.png diff --git a/test/script/dashboard.xcf b/test/script/dashboard.xcf Binary files differindex 59b5477..8e650a1 100644 --- a/test/script/dashboard.xcf +++ b/test/script/dashboard.xcf diff --git a/test/script/simulation-dashboard.py b/test/script/simulation-dashboard.py index ee03430..1c16456 100644 --- a/test/script/simulation-dashboard.py +++ b/test/script/simulation-dashboard.py @@ -56,7 +56,8 @@ YELLOW = ( 255, 222, 0) # Define some constants PI = 3.141592653 PERIODICITY = 200 #in ms -CONVERSION = (3.6/PERIODICITY) +FUEL_CONVERSION = (3.6/PERIODICITY) +SPEED_CONVERSION = (36.0/PERIODICITY) # Item location on the screen STATUS_LOCATION = (100,10) @@ -64,8 +65,9 @@ STEP_LOCATION = (150,68) ENGINE_SPEED_LOCATION = (150,118) FUEL_LEVEL_LOCATION = (150,175) FUEL_INSTANT_CONSUMPTION_LOCATION = (150,238) -LATITUDE_LOCATION = (64,287) -LONGITUDE_LOCATION = (185,287) +VEHICLE_SPEED_LOCATION = (150,287) +LATITUDE_LOCATION = (64,340) +LONGITUDE_LOCATION = (185,340) def display(string,location,fontColor,fontBackground): text = font.render(string, True, fontColor, fontBackground) @@ -88,6 +90,9 @@ def displayFuelLevel(string): def displayFuelInstant(string): display(string,FUEL_INSTANT_CONSUMPTION_LOCATION,YELLOW,BLACK) +def displayVehicleSpeed(string): + display(string,VEHICLE_SPEED_LOCATION,YELLOW,BLACK) + def displayLatitude(string): display(string,LATITUDE_LOCATION,YELLOW,BLACK) @@ -97,6 +102,15 @@ def displayLongitude(string): def refresh(): pygame.display.update() +def initDisplay(): + displayStatus('') + displayStep('') + displayEngineSpeed('0') + displayFuelLevel('0') + displayFuelInstant('0') + displayLatitude('0') + displayLongitude('0') + displayVehicleSpeed('0') def steps(): global step @@ -144,7 +158,9 @@ def steps(): fuelLevel = ambFuelInterface.GetLevel() displayFuelLevel(str(int(fuelLevel[0]))) fuelInstCons = ambFuelInterface.GetInstantConsumption() - displayFuelInstant(str(int(fuelInstCons[0])*CONVERSION)) + displayFuelInstant(str(int(fuelInstCons[0])*FUEL_CONVERSION)) + odometer = ambOdometerInterface.GetOdometer() + displayVehicleSpeed(str(int(odometer[0])*SPEED_CONVERSION)) # get the geolocation geoLocation = enhancedPositionInterface.GetData(dbus.Array([Genivi.ENHANCEDPOSITIONSERVICE_LATITUDE,Genivi.ENHANCEDPOSITIONSERVICE_LONGITUDE,Genivi.ENHANCEDPOSITIONSERVICE_ALTITUDE])) @@ -169,6 +185,7 @@ screen = pygame.display.set_mode( size ) pygame.display.set_caption('Simulation dashboard') screen.blit(background,backgroundRect) font = pygame.font.SysFont('Calibri', 25, True, False) +initDisplay() # Connect on the bus dbusConnectionBus = dbus.SessionBus() @@ -187,6 +204,12 @@ fuelPath = ambInterface.FindObject("Fuel"); ambFuel = dbusConnectionBus.get_object("org.automotive.message.broker", fuelPath[0]) ambFuelInterface = dbus.Interface(ambFuel, "org.automotive.Fuel") +# Get the object path to retrieve Odometer +odometerPath = ambInterface.FindObject("Odometer"); +ambOdometer = dbusConnectionBus.get_object("org.automotive.message.broker", odometerPath[0]) +ambOdometerInterface = dbus.Interface(ambOdometer, "org.automotive.Odometer") + + # Enhanced position enhancedPositionObject = dbusConnectionBus.get_object("org.genivi.positioning.EnhancedPosition", "/position") enhancedPositionInterface = dbus.Interface(enhancedPositionObject, "org.genivi.positioning.EnhancedPosition") |