diff options
author | <philippe colliot> | 2014-11-28 16:54:12 +0100 |
---|---|---|
committer | <philippe colliot> | 2014-11-28 16:54:12 +0100 |
commit | b35fa970f0b6c2bbfe9630f75b11365470735930 (patch) | |
tree | 4b956c10fc27576cd0692cf8bdfccaf5d29a069b /test | |
parent | 7ab5b8a3fea3f413c16bb3208033a0c37e98fd08 (diff) | |
download | navigation-b35fa970f0b6c2bbfe9630f75b11365470735930.tar.gz |
some bug fixed
Diffstat (limited to 'test')
-rwxr-xr-x | test/script/simulation-dashboard.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/test/script/simulation-dashboard.py b/test/script/simulation-dashboard.py index aec0b85..dbe090b 100755 --- a/test/script/simulation-dashboard.py +++ b/test/script/simulation-dashboard.py @@ -54,6 +54,8 @@ class Genivi(IntEnum): NAVIGATIONCORE_SIMULATION_STATUS_RUNNING = 0x0221 NAVIGATIONCORE_SIMULATION_STATUS_PAUSED = 0x0222 NAVIGATIONCORE_SIMULATION_STATUS_FIXED_POSITION = 0x0223 + NAVIGATIONCORE_LATITUDE = 0x00a0 + NAVIGATIONCORE_LONGITUDE = 0x00a1 # Define some colors BLACK = ( 0, 0, 0) @@ -209,13 +211,6 @@ def getDbus(): odometer = ambOdometerInterface.GetOdometer() displayVehicleSpeed(str(int(odometer[0])*SPEED_CONVERSION)) - # get the geolocation - geoLocation = enhancedPositionInterface.GetData(dbus.Array([Genivi.ENHANCEDPOSITIONSERVICE_LATITUDE,Genivi.ENHANCEDPOSITIONSERVICE_LONGITUDE])) - latitude=float(geoLocation[dbus.UInt16(Genivi.ENHANCEDPOSITIONSERVICE_LATITUDE)]) - displayLatitude("{:.3f}".format(latitude)) - longitude=float(geoLocation[dbus.UInt16(Genivi.ENHANCEDPOSITIONSERVICE_LONGITUDE)]) - displayLongitude("{:.3f}".format(longitude)) - # get the tank distance instantData = fuelStopAdvisorInterface.GetInstantData() if dbus.UInt16(Genivi.FUELSTOPADVISOR_TANK_DISTANCE) in instantData: @@ -250,6 +245,17 @@ def guidanceStatusHandler(status,handle): else: displayGuidanceStatus('---') +def mapMatchedPositionPositionUpdateHandler(arg): + # get the mapmatched position first and check after (to be improved) + mapmatchedPosition = mapMatchedPositionInterface.GetPosition(dbus.Array([Genivi.NAVIGATIONCORE_LATITUDE,Genivi.NAVIGATIONCORE_LONGITUDE])) + for item in arg: + if item==Genivi.NAVIGATIONCORE_LATITUDE: + latitude=float(mapmatchedPosition[dbus.UInt16(Genivi.NAVIGATIONCORE_LATITUDE)]) + displayLatitude("{:.3f}".format(latitude)) + elif item==Genivi.NAVIGATIONCORE_LONGITUDE: + longitude=float(mapmatchedPosition[dbus.UInt16(Genivi.NAVIGATIONCORE_LONGITUDE)]) + displayLongitude("{:.3f}".format(longitude)) + def mapMatchedPositionSimulationStatusHandler(arg): if arg==Genivi.NAVIGATIONCORE_SIMULATION_STATUS_NO_SIMULATION: displaySimulationStatus('OFF ') @@ -358,6 +364,7 @@ except dbus.DBusException: sys.exit(1) mapMatchedPositionInterface = dbus.Interface(mapMatchedPositionObject, "org.genivi.navigationcore.MapMatchedPosition") dbusConnectionBus.add_signal_receiver(mapMatchedPositionSimulationStatusHandler, dbus_interface = "org.genivi.navigationcore.MapMatchedPosition", signal_name = "SimulationStatusChanged") +dbusConnectionBus.add_signal_receiver(mapMatchedPositionPositionUpdateHandler, dbus_interface = "org.genivi.navigationcore.MapMatchedPosition", signal_name = "PositionUpdate") displayStatus( 'Start simulation' ) |