summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author <philippe colliot>2014-08-08 16:20:56 +0200
committer <philippe colliot>2014-08-08 16:20:56 +0200
commit331d42785ed0a71e30bf2452312b4693d2e1c277 (patch)
tree260b05d0bbf45b98b793c87acb9eb050e4f45755
parent719ee25e2ca4f3684a0b725b33bbc93684d1ae10 (diff)
downloadnavigation-331d42785ed0a71e30bf2452312b4693d2e1c277.tar.gz
improvement of simulation dashboard
-rw-r--r--src/hmi/qml/NavigationBrowseMap.qml21
-rw-r--r--src/hmi/qml/NavigationManeuversList.qml2
-rw-r--r--src/hmi/qml/NavigationSettings.qml1
-rw-r--r--src/hmi/qml/POI.qml1
-rw-r--r--test/script/simulation-dashboard.py60
5 files changed, 67 insertions, 18 deletions
diff --git a/src/hmi/qml/NavigationBrowseMap.qml b/src/hmi/qml/NavigationBrowseMap.qml
index 2070bcb..738a740 100644
--- a/src/hmi/qml/NavigationBrowseMap.qml
+++ b/src/hmi/qml/NavigationBrowseMap.qml
@@ -143,7 +143,13 @@ HMIMenu {
mapmatchedpositionAddressUpdateSignal.destroy();
fuelStopAdvisorSignal.destroy();
Genivi.fuel_stop_advisor_message(dbusIf,"SetFuelAdvisorSettings",["boolean",0,"uint8",0]);
- Genivi.fuel_stop_advisor_message(dbusIf,"ReleaseRouteHandle",Genivi.g_routing_handle);
+ if (Genivi.g_routing_handle) {
+ Genivi.fuel_stop_advisor_message(dbusIf,"ReleaseRouteHandle",Genivi.g_routing_handle);
+ }
+ else
+ {
+ Genivi.fuel_stop_advisor_message(dbusIf,"ReleaseRouteHandle",0);
+ }
}
function showSurfaces()
@@ -636,7 +642,7 @@ HMIMenu {
if (res[0] == "structure") {
Genivi.mapviewercontrol_message(dbusIf, "SetMapViewBoundingBox", res);
} else {
- Console.log("Unexpected result from GetRouteBoundingBox:");
+ console.log("Unexpected result from GetRouteBoundingBox:");
Genivi.dump("",res);
}
delete(Genivi.data['zoom_route_handle']);
@@ -658,14 +664,15 @@ HMIMenu {
connectSignals();
updateGuidance();
updateMapViewer();
- showZoom();
+ showZoom();
updateAddress();
updateDayNight();
if (Genivi.g_routing_handle) {
Genivi.fuel_stop_advisor_message(dbusIf,"SetRouteHandle",Genivi.g_routing_handle);
- } else {
- Genivi.fuel_stop_advisor_message(dbusIf,"ReleaseRouteHandle",Genivi.g_routing_handle);
- }
- Genivi.fuel_stop_advisor_message(dbusIf,"SetFuelAdvisorSettings",["boolean",1,"uint8",50]);
+ Genivi.fuel_stop_advisor_message(dbusIf,"SetFuelAdvisorSettings",["boolean",1,"uint8",50]);
+ } else {
+ Genivi.fuel_stop_advisor_message(dbusIf,"ReleaseRouteHandle",0);
+ Genivi.fuel_stop_advisor_message(dbusIf,"SetFuelAdvisorSettings",["boolean",0,"uint8",0]);
+ }
}
}
diff --git a/src/hmi/qml/NavigationManeuversList.qml b/src/hmi/qml/NavigationManeuversList.qml
index 5ef4d5f..98d4720 100644
--- a/src/hmi/qml/NavigationManeuversList.qml
+++ b/src/hmi/qml/NavigationManeuversList.qml
@@ -105,7 +105,7 @@ HMIMenu {
}
}
} else {
- Console.log("Unexpected result from GetManeuversList");
+ console.log("Unexpected result from GetManeuversList");
Genivi.dump("",res);
}
}
diff --git a/src/hmi/qml/NavigationSettings.qml b/src/hmi/qml/NavigationSettings.qml
index d9aa6d7..0a71a56 100644
--- a/src/hmi/qml/NavigationSettings.qml
+++ b/src/hmi/qml/NavigationSettings.qml
@@ -95,7 +95,6 @@ HMIMenu {
function simulationStatusChanged(args)
{
- Genivi.dump("",args);
if (args[0] == 'uint16')
{
if (args[1] != Genivi.NAVIGATIONCORE_SIMULATION_STATUS_NO_SIMULATION)
diff --git a/src/hmi/qml/POI.qml b/src/hmi/qml/POI.qml
index d286d2f..4c45692 100644
--- a/src/hmi/qml/POI.qml
+++ b/src/hmi/qml/POI.qml
@@ -112,7 +112,6 @@ HMIMenu {
var ids=[];
var position=Genivi.nav_message(dbusIf,"MapMatchedPosition","GetPosition",["array",["uint16",Genivi.NAVIGATIONCORE_LATITUDE,"uint16",Genivi.NAVIGATIONCORE_LONGITUDE]]);
var category;
- Genivi.dump("",position);
if (!position[1][3][1] && !position[1][7][1]) {
model.clear();
model.append({"name":"No position available"});
diff --git a/test/script/simulation-dashboard.py b/test/script/simulation-dashboard.py
index 828a1f9..80651a7 100644
--- a/test/script/simulation-dashboard.py
+++ b/test/script/simulation-dashboard.py
@@ -47,6 +47,12 @@ class Genivi(Enum):
ENHANCEDPOSITIONSERVICE_ALTITUDE = 0x0022
FUELSTOPADVISOR_TANK_DISTANCE = 0x0022
FUELSTOPADVISOR_ENHANCED_TANK_DISTANCE = 0x0024
+ NAVIGATIONCORE_ACTIVE = 0x0060
+ NAVIGATIONCORE_INACTIVE = 0x0061
+ NAVIGATIONCORE_SIMULATION_STATUS_NO_SIMULATION = 0x0220
+ NAVIGATIONCORE_SIMULATION_STATUS_RUNNING = 0x0221
+ NAVIGATIONCORE_SIMULATION_STATUS_PAUSED = 0x0222
+ NAVIGATIONCORE_SIMULATION_STATUS_FIXED_POSITION = 0x0223
# Define some colors
BLACK = ( 0, 0, 0)
@@ -143,9 +149,9 @@ def initDisplay():
displayVehicleSpeed('0')
displayGuidanceStatus('OFF')
displaySimulationStatus('OFF')
- displayFuelStopAdvisorWarning('')
- displayFuelStopAdvisorTankDistance('----')
- displayFuelStopAdvisorEnhancedTankDistance('----')
+ displayFuelStopAdvisorWarning(' ')
+ displayFuelStopAdvisorTankDistance('-----')
+ displayFuelStopAdvisorEnhancedTankDistance('-----')
def getKeyboard():
global step
@@ -209,14 +215,14 @@ def getDbus():
instantData = fuelStopAdvisorInterface.GetInstantData()
if dbus.UInt16(Genivi.FUELSTOPADVISOR_TANK_DISTANCE) in instantData:
tankDistance = int(instantData[dbus.UInt16(Genivi.FUELSTOPADVISOR_TANK_DISTANCE)])
- displayFuelStopAdvisorTankDistance(str(tankDistance))
+ displayFuelStopAdvisorTankDistance(str(tankDistance) + ' ')
else:
- displayFuelStopAdvisorTankDistance("----")
+ displayFuelStopAdvisorTankDistance("-----")
if dbus.UInt16(Genivi.FUELSTOPADVISOR_ENHANCED_TANK_DISTANCE) in instantData:
enhancedTankDistance = int(instantData[dbus.UInt16(Genivi.FUELSTOPADVISOR_ENHANCED_TANK_DISTANCE)])
- displayFuelStopAdvisorEnhancedTankDistance(str(enhancedTankDistance))
+ displayFuelStopAdvisorEnhancedTankDistance(str(enhancedTankDistance) + ' ')
else:
- displayFuelStopAdvisorEnhancedTankDistance('----')
+ displayFuelStopAdvisorEnhancedTankDistance('-----')
displayStep( str(step) )
@@ -225,9 +231,28 @@ def getDbus():
return True
-def fuelStopAdvisorWarningHandler(arg):
+def fuelStopAdvisorWarningHandler():
displayFuelStopAdvisorWarning("F")
+def guidanceStatusHandler(status,handle):
+ if status==Genivi.NAVIGATIONCORE_ACTIVE:
+ displayGuidanceStatus(' ON ')
+ elif status==Genivi.NAVIGATIONCORE_INACTIVE:
+ displayGuidanceStatus('OFF')
+ else:
+ displayGuidanceStatus('---')
+
+def mapMatchedPositionSimulationStatusHandler(arg):
+ if arg==Genivi.NAVIGATIONCORE_SIMULATION_STATUS_NO_SIMULATION:
+ displaySimulationStatus('OFF ')
+ elif arg==Genivi.NAVIGATIONCORE_SIMULATION_STATUS_RUNNING:
+ displaySimulationStatus('RUN ')
+ elif arg==Genivi.NAVIGATIONCORE_SIMULATION_STATUS_PAUSED:
+ displaySimulationStatus('PAU ')
+ elif arg==Genivi.NAVIGATIONCORE_SIMULATION_STATUS_FIXED_POSITION:
+ displaySimulationStatus('FIX ')
+ else:
+ displaySimulationStatus('OFF ')
# Main program begins here
parser = argparse.ArgumentParser(description='Simulation dashboard for navigation PoC and FSA.')
@@ -297,6 +322,25 @@ except dbus.DBusException:
sys.exit(1)
enhancedPositionInterface = dbus.Interface(enhancedPositionObject, "org.genivi.positioning.EnhancedPosition")
+# Guidance
+try:
+ guidanceObject = dbusConnectionBus.get_object("org.genivi.navigationcore.Guidance","/org/genivi/navigationcore")
+except dbus.DBusException:
+ print "connection to Guidance failed"
+ print_exc()
+ sys.exit(1)
+guidanceInterface = dbus.Interface(guidanceObject, "org.genivi.navigationcore.Guidance")
+dbusConnectionBus.add_signal_receiver(guidanceStatusHandler, dbus_interface = "org.genivi.navigationcore.Guidance", signal_name = "GuidanceStatusChanged")
+
+# Map matched position
+try:
+ mapMatchedPositionObject = dbusConnectionBus.get_object("org.genivi.navigationcore.MapMatchedPosition","/org/genivi/navigationcore")
+except dbus.DBusException:
+ print "connection to Map matched position failed"
+ print_exc()
+ 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")
displayStatus( 'Start simulation' )