summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorasanoaozora <fifitaneki@hotmail.com>2017-01-20 17:20:12 +0100
committerasanoaozora <fifitaneki@hotmail.com>2017-01-20 17:20:12 +0100
commit6507e95b6eef5de59a111f2ee2b5aa382c42e7de (patch)
tree2b549e37325c433c01608e0ffaff42baccfa4f11 /src
parenta1641e81dde2fc3c3d54618363c821f08a0528ad (diff)
downloadnavigation-6507e95b6eef5de59a111f2ee2b5aa382c42e7de.tar.gz
start of global debug to prepare a GDP version
Diffstat (limited to 'src')
-rw-r--r--src/hmi/qml/Core/NavigationAppHMIMenu.qml9
-rw-r--r--src/hmi/qml/Core/genivi-capi.js26
-rw-r--r--src/hmi/qml/Core/genivi-origin.js26
-rw-r--r--src/hmi/qml/NavigationAppBrowseMap.qml238
-rw-r--r--src/hmi/qml/NavigationAppMain.qml2
-rw-r--r--src/hmi/qml/NavigationAppPOI.qml9
-rw-r--r--src/hmi/qml/NavigationAppSearch.qml60
-rw-r--r--src/hmi/qml/NavigationAppSettings.qml25
8 files changed, 256 insertions, 139 deletions
diff --git a/src/hmi/qml/Core/NavigationAppHMIMenu.qml b/src/hmi/qml/Core/NavigationAppHMIMenu.qml
index d6e142a..2ba3388 100644
--- a/src/hmi/qml/Core/NavigationAppHMIMenu.qml
+++ b/src/hmi/qml/Core/NavigationAppHMIMenu.qml
@@ -157,15 +157,6 @@ Rectangle {
container.load(outmenu);
}
- function mapMenu()
- { //go to map view menu and reinit the heap
- menu.state="hidden";
- Genivi.entrybackheapsize = 1;
- Genivi.entryback[Genivi.entrybackheapsize] = "NavigationAppMain";
- container.load("NavigationAppBrowseMap");
- }
-
-
function pageOpen(command) {
menu.state="hidden";
container.load(command);
diff --git a/src/hmi/qml/Core/genivi-capi.js b/src/hmi/qml/Core/genivi-capi.js
index a142469..7cb621e 100644
--- a/src/hmi/qml/Core/genivi-capi.js
+++ b/src/hmi/qml/Core/genivi-capi.js
@@ -42,7 +42,7 @@ var g_lang;
var data=new Array;
data['destination']=new Array;
-data['show_position']=new Array;
+data['position']=new Array;
var poi_data=new Array;
var poi_id;
@@ -55,7 +55,7 @@ var translations=new Array;
var simulationPanelOnMapview=true;// simulation panel on map view by default
var guidance_activated=false; //used by the HMI to directly go to map when guidance is on (reroute use case)
-var route_calculated=false; //no route (managed by NavigationRoute and NavigationCalculatedRoute)
+var route_calculated=false;
var entryback = new Array;
var entrybackheapsize=0;
@@ -123,14 +123,16 @@ var radius=5000; //radius in m around the vehicle to search for the refill stati
var offset=0; //offset of the start record to get on the list of pois
var maxWindowSize=20; //max size of elements to return as a result
var fuelCategoryId; //unique id of fuel category
+var zoom_guidance=4; //zoom level when a guidance starts
//the default data below will be managed by the persistency component in the future
address[NAVIGATIONCORE_COUNTRY]="Switzerland";
-address[NAVIGATIONCORE_CITY]="Zürich";
-address[NAVIGATIONCORE_STREET]="In Lampitzäckern";
-address[NAVIGATIONCORE_HOUSENUMBER]="";
-data['show_position']['lat']=47.415740;
-data['show_position']['lon']=8.614862;
+address[NAVIGATIONCORE_CITY]="Genève";
+address[NAVIGATIONCORE_STREET]="Rue Franck-Martin";
+address[NAVIGATIONCORE_HOUSENUMBER]="8";
+data['position']['lat']=46.202410;
+data['position']['lon']=6.146265;
+data['position']['alt']=20;
data['display_on_map']='show_current_position'; //display current position of the vehicle on the map
historyOfLastEnteredLocationDepth=10; //max number of items into the history is set to historyOfLastEnteredLocationDepth-1
@@ -358,6 +360,11 @@ function connect_fuelStopAdvisorWarningSignal(interface,menu)
return interface.connect("","/FuelStopAdvisor","org.genivi.demonstrator.FuelStopAdvisor.v1_0","fuelStopAdvisorWarning",menu,"fuelStopAdvisorWarning");
}
+function connect_mapViewScaleChangedSignal(interface,menu)
+{
+ return interface.connect("","/MapViewerControl","org.genivi.navigation.mapviewer.MapViewerControl.v4_0","mapViewScaleChanged",menu,"mapViewScaleChanged");
+}
+
//----------------- NavigationCore dbus messages -----------------
//----------------- Navigation core Session messages -----------------
@@ -757,6 +764,11 @@ function mapviewer_GetDisplayedRoutes(dbusIf)
return mapviewercontrol_get(dbusIf,"getDisplayedRoutes", []);
}
+function mapviewer_SetMapViewScale(dbusIf,scaleID)
+{
+ mapviewercontrol_message(dbusIf,"setMapViewScale", ["uint16",scaleID]);
+}
+
function mapviewer_SetMapViewScaleByDelta(dbusIf,scaleDelta)
{
mapviewercontrol_message(dbusIf,"setMapViewScaleByDelta", ["int16",scaleDelta]);
diff --git a/src/hmi/qml/Core/genivi-origin.js b/src/hmi/qml/Core/genivi-origin.js
index 1d683af..3385038 100644
--- a/src/hmi/qml/Core/genivi-origin.js
+++ b/src/hmi/qml/Core/genivi-origin.js
@@ -42,7 +42,7 @@ var g_lang;
var data=new Array;
data['destination']=new Array;
-data['show_position']=new Array;
+data['position']=new Array;
var poi_data=new Array;
var poi_id;
@@ -55,7 +55,7 @@ var translations=new Array;
var simulationPanelOnMapview=true;// simulation panel on map view by default
var guidance_activated=false; //used by the HMI to directly go to map when guidance is on (reroute use case)
-var route_calculated=false; //no route (managed by NavigationRoute and NavigationCalculatedRoute)
+var route_calculated=false;
var entryback = new Array;
var entrybackheapsize=0;
@@ -123,14 +123,16 @@ var radius=5000; //radius in m around the vehicle to search for the refill stati
var offset=0; //offset of the start record to get on the list of pois
var maxWindowSize=20; //max size of elements to return as a result
var fuelCategoryId; //unique id of fuel category
+var zoom_guidance=4; //zoom level when a guidance starts
//the default data below will be managed by the persistency component in the future
address[NAVIGATIONCORE_COUNTRY]="Switzerland";
-address[NAVIGATIONCORE_CITY]="Zürich";
-address[NAVIGATIONCORE_STREET]="In Lampitzäckern";
-address[NAVIGATIONCORE_HOUSENUMBER]="";
-data['show_position']['lat']=47.415740;
-data['show_position']['lon']=8.614862;
+address[NAVIGATIONCORE_CITY]="Genève";
+address[NAVIGATIONCORE_STREET]="Rue Franck-Martin";
+address[NAVIGATIONCORE_HOUSENUMBER]="8";
+data['position']['lat']=46.202410;
+data['position']['lon']=6.146265;
+data['position']['alt']=20;
data['display_on_map']='show_current_position'; //display current position of the vehicle on the map
historyOfLastEnteredLocationDepth=10; //max number of items into the history is set to historyOfLastEnteredLocationDepth-1
@@ -358,6 +360,11 @@ function connect_fuelStopAdvisorWarningSignal(interface,menu)
return interface.connect("","/org/genivi/demonstrator/FuelStopAdvisor","org.genivi.demonstrator.FuelStopAdvisor","FuelStopAdvisorWarning",menu,"fuelStopAdvisorWarning");
}
+function connect_mapViewScaleChangedSignal(interface,menu)
+{
+ return interface.connect("","/org/genivi/mapviewer","org.genivi.mapviewer.MapViewerControl","MapViewScaleChanged",menu,"mapViewScaleChanged");
+}
+
//----------------- NavigationCore dbus messages -----------------
//----------------- Navigation core Session messages -----------------
@@ -755,6 +762,11 @@ function mapviewer_GetDisplayedRoutes(dbusIf)
return mapviewercontrol_get(dbusIf,"GetDisplayedRoutes", []);
}
+function mapviewer_SetMapViewScale(dbusIf,scaleID)
+{
+ mapviewercontrol_message(dbusIf,"SetMapViewScale", ["uint16",scaleID]);
+}
+
function mapviewer_SetMapViewScaleByDelta(dbusIf,scaleDelta)
{
mapviewercontrol_message(dbusIf,"SetMapViewScaleByDelta", ["int16",scaleDelta]);
diff --git a/src/hmi/qml/NavigationAppBrowseMap.qml b/src/hmi/qml/NavigationAppBrowseMap.qml
index 8eaed23..060ee6d 100644
--- a/src/hmi/qml/NavigationAppBrowseMap.qml
+++ b/src/hmi/qml/NavigationAppBrowseMap.qml
@@ -62,13 +62,26 @@ HMIMenu {
Genivi.hookSignal("guidanceStatusChanged");
if(args[1]===Genivi.NAVIGATIONCORE_ACTIVE)
{
- guidanceStatus.setState("ON");
+ guidanceMode.setState("ON");
+ showGuidance();
+ showRoute();
+ showSimulation();
Genivi.guidance_activated = true;
//Guidance active, so inform the trip computer (refresh)
Genivi.fuelstopadvisor_SetFuelAdvisorSettings(dbusIf,1,50);
updateGuidance();
} else {
- guidanceStatus.setState("OFF");
+ guidanceMode.setState("OFF");
+ hideGuidance();
+ hideRoute();
+ hideSimulation();
+ if (Genivi.route_calculated == true)
+ {
+ visible=true; //it's possible to restart the current route
+ }
+ else {
+ visible=false; //no route calculated
+ }
Genivi.guidance_activated = false;
//Guidance inactive, so inform the trip computer
Genivi.fuelstopadvisor_SetFuelAdvisorSettings(dbusIf,0,0);
@@ -211,6 +224,20 @@ HMIMenu {
}
}
+ property Item mapViewScaleChangedSignal;
+ function mapViewScaleChanged(args)
+ {
+ Genivi.hookSignal("mapViewScaleChanged");
+ var text=args[3].toString();
+ if (args[5] === Genivi.MAPVIEWER_MAX) {
+ text+="*";
+ } else {
+ if (args[5] === Genivi.MAPVIEWER_MIN)
+ text="*"+text;
+ }
+ zoomlevel.text=text;
+ }
+
function connectSignals()
{
guidanceStatusChangedSignal=Genivi.connect_guidanceStatusChangedSignal(dbusIf,menu);
@@ -222,6 +249,7 @@ HMIMenu {
mapmatchedpositionPositionUpdateSignal=Genivi.connect_mapmatchedpositionPositionUpdateSignal(dbusIf,menu);
mapmatchedpositionAddressUpdateSignal=Genivi.connect_mapmatchedpositionAddressUpdateSignal(dbusIf,menu);
fuelStopAdvisorWarningSignal=Genivi.connect_fuelStopAdvisorWarningSignal(dbusIf,menu);
+ mapViewScaleChangedSignal=Genivi.connect_mapViewScaleChangedSignal(dbusIf,menu)
}
function disconnectSignals()
@@ -235,6 +263,7 @@ HMIMenu {
mapmatchedpositionPositionUpdateSignal.destroy();
mapmatchedpositionAddressUpdateSignal.destroy();
fuelStopAdvisorWarningSignal.destroy();
+ mapViewScaleChangedSignal.destroy();
}
//------------------------------------------//
@@ -673,48 +702,55 @@ HMIMenu {
}
}
+ function toggleGuidanceMode()
+ {
+ if (Genivi.guidance_activated){
+ stopGuidance();
+ stopSimulation();
+ }else{
+ startGuidance();
+ }
+ }
+
function updateGuidance()
{
- if(Genivi.guidance_activated == true)
+ var res=Genivi.guidance_GetManeuversList(dbusIf,1,0);
+ //only one maneuver is considered
+ //var error=res[1]
+ var numberOfManeuvers=res[3];
+ if(numberOfManeuvers > 0)
{
- var res=Genivi.guidance_GetManeuversList(dbusIf,1,0);
- //only one maneuver is considered
- //var error=res[1]
- var numberOfManeuvers=res[3];
- if(numberOfManeuvers > 0)
+ var maneuversList=res[5][1];
+ //var roadShieldsAfterManeuver=maneuversList[1]
+ //var countryCodeAfterManeuver=maneuversList[3]
+ //var stateCodeAfterManeuver=maneuversList[5]
+ var roadNumberAfterManeuver=maneuversList[7];
+ var roadNameAfterManeuver=maneuversList[9];
+ var roadPropertyAfterManeuver=maneuversList[11];
+ var drivingSide=maneuversList[13];
+ var offsetOfNextManeuver=maneuversList[15];
+ var items=maneuversList[17][1];
+ var offsetOfManeuver=items[1];
+ var travelTime=items[3];
+ var direction=items[5];
+ var maneuverType=items[7];
+ var maneuverData=items[9];
+ if (maneuverData[1] == Genivi.NAVIGATIONCORE_DIRECTION)
{
- var maneuversList=res[5][1];
- //var roadShieldsAfterManeuver=maneuversList[1]
- //var countryCodeAfterManeuver=maneuversList[3]
- //var stateCodeAfterManeuver=maneuversList[5]
- var roadNumberAfterManeuver=maneuversList[7];
- var roadNameAfterManeuver=maneuversList[9];
- var roadPropertyAfterManeuver=maneuversList[11];
- var drivingSide=maneuversList[13];
- var offsetOfNextManeuver=maneuversList[15];
- var items=maneuversList[17][1];
- var offsetOfManeuver=items[1];
- var travelTime=items[3];
- var direction=items[5];
- var maneuverType=items[7];
- var maneuverData=items[9];
- if (maneuverData[1] == Genivi.NAVIGATIONCORE_DIRECTION)
- {
- maneuverIcon.source=Genivi.ManeuverDirectionIcon[maneuverData[3][3][1]];
- //Genivi.ManeuverType[subarray[j+1][7]] contains CROSSROAD and is removed for the moment
- distancetomaneuverValue.text=Genivi.distance(offsetOfManeuver);
- roadaftermaneuverValue.text=roadNameAfterManeuver;
- }
- } else {
-
+ maneuverIcon.source=Genivi.ManeuverDirectionIcon[maneuverData[3][3][1]];
+ //Genivi.ManeuverType[subarray[j+1][7]] contains CROSSROAD and is removed for the moment
+ distancetomaneuverValue.text=Genivi.distance(offsetOfManeuver);
+ roadaftermaneuverValue.text=roadNameAfterManeuver;
}
+ } else {
- var res1=Genivi.guidance_GetDestinationInformation(dbusIf);
- distancetodestinationValue.text = Genivi.distance(res1[1]);
- timetodestinationValue.text = Genivi.time(res1[3]);
-
- updateAddress();
}
+
+ var res1=Genivi.guidance_GetDestinationInformation(dbusIf);
+ distancetodestinationValue.text = Genivi.distance(res1[1]);
+ timetodestinationValue.text = Genivi.time(res1[3]);
+
+ updateAddress();
}
function stopGuidance()
@@ -731,12 +767,12 @@ HMIMenu {
function stopSimulation()
{
- Genivi.mapmatchedposition_SetSimulationMode(dbusIf,0);
+ Genivi.mapmatchedposition_SetSimulationMode(dbusIf,false);
}
function startSimulation()
{
- Genivi.mapmatchedposition_SetSimulationMode(dbusIf,1);
+ Genivi.mapmatchedposition_SetSimulationMode(dbusIf,true);
Genivi.mapmatchedposition_StartSimulation(dbusIf);
}
@@ -774,6 +810,8 @@ HMIMenu {
on_off.disabled=false;
simu_mode.visible=true;
simu_mode.disabled=true;
+ speedUnit.visible=true;
+ vehicleSpeedValue.visible=true;
}
function hideSimulation()
@@ -788,6 +826,32 @@ HMIMenu {
on_off.disabled=true;
simu_mode.visible=false;
simu_mode.disabled=true;
+ speedUnit.visible=false;
+ vehicleSpeedValue.visible=false;
+ }
+
+ function showGuidance()
+ {
+ guidance.visible=true;
+ }
+
+ function hideGuidance()
+ {
+ guidance.visible=false;
+ }
+
+ function showRoute()
+ {
+ route.visible=true;
+ maneuverList.disabled=false;
+ roadaftermaneuverValue.visible=true;
+ }
+
+ function hideRoute()
+ {
+ route.visible=false;
+ maneuverList.disabled=true;
+ roadaftermaneuverValue.visible=false;
}
//------------------------------------------//
@@ -882,11 +946,11 @@ HMIMenu {
StdButton {
source:StyleSheetBottom.menub[Constants.SOURCE]; x:StyleSheetBottom.menub[Constants.X]; y:StyleSheetBottom.menub[Constants.Y]; width:StyleSheetBottom.menub[Constants.WIDTH]; height:StyleSheetBottom.menub[Constants.HEIGHT];textColor:StyleSheetBottom.menubText[Constants.TEXTCOLOR]; pixelSize:StyleSheetBottom.menubText[Constants.PIXELSIZE];
- id:menub; text:Genivi.gettext("Menu"); next:orientation; prev:settings;
+ id:menub; text:Genivi.gettext("Back"); next:orientation; prev:settings;
onClicked: {
disconnectSignals();
Genivi.preloadMode=true;
- leaveMenu();;
+ leaveMenu();
}
}
@@ -962,45 +1026,22 @@ HMIMenu {
StdButton {
x:StyleSheetBottom.guidanceon[Constants.X]; y:StyleSheetBottom.guidanceon[Constants.Y]; width:StyleSheetBottom.guidanceon[Constants.WIDTH]; height:StyleSheetBottom.guidanceon[Constants.HEIGHT];
- id:guidanceStatus; next:zoomin; prev:menub; disabled:false;
+ id:guidanceMode; next:zoomin; prev:menub; disabled:false;
source:StyleSheetBottom.guidanceoff[Constants.SOURCE]; //todo call get status
- property int status: 1;
function setState(name)
{
if (name=="ON")
{
- status=1;
source=StyleSheetBottom.guidanceoff[Constants.SOURCE];
- guidance.visible=true;
- route.visible=true;
- simulation.visible=true;
}
else
{
- status=0;
source=StyleSheetBottom.guidanceon[Constants.SOURCE];
- guidance.visible=false;
- route.visible=false;
- simulation.visible=false;
- if (Genivi.route_calculated == true)
- {
- visible=true; //it's possible to restart the current route
- }
- else {
- visible=false; //no route calculated
- }
}
}
onClicked:
{
- if(status)
- {
- stopGuidance();
- stopSimulation();
- }
- else {
- startGuidance();
- }
+ toggleGuidanceMode();
}
}
}
@@ -1430,42 +1471,59 @@ HMIMenu {
}
Component.onCompleted: {
+ connectSignals();
Genivi.mapviewer_handle(dbusIf,menu.width,menu.height,Genivi.MAPVIEWER_MAIN_MAP);
+ hideMapSettings();
+ if(!Genivi.route_calculated) {
+ guidanceMode.visible=false;
+ guidanceMode.disabled=true;
+ }
+
if (Genivi.data['display_on_map']==='show_route') {
- Genivi.mapviewer_DisplayRoute(dbusIf,Genivi.data['show_route_handle'],false);
var res=Genivi.routing_GetRouteBoundingBox(dbusIf,Genivi.data['zoom_route_handle']);
- if (res[0] == "structure") {
- Genivi.mapviewer_SetMapViewBoundingBox(dbusIf,res);
- } else {
- console.log("Unexpected result from GetRouteBoundingBox:");
- Genivi.dump("",res);
- }
+ Genivi.mapviewer_SetMapViewBoundingBox(dbusIf,res);
+ Genivi.mapviewer_DisplayRoute(dbusIf,Genivi.data['show_route_handle'],false);
+ hideGuidance();
+ hideRoute();
+ hideSimulation();
+ updateAddress();
+ guidanceMode.setState('OFF');//guidance can be launched from this menu
}
else {
if (Genivi.data['display_on_map']==='show_current_position') {
Genivi.mapviewer_SetFollowCarMode(dbusIf,true);
- Genivi.mapviewer_DisplayRoute(dbusIf,Genivi.data['show_route_handle'],false);
- } else {
+ Genivi.mapviewer_SetMapViewScale(dbusIf,Genivi.zoom_guidance);
+ Genivi.mapviewer_SetTargetPoint(dbusIf,Genivi.data['position']['lat'],Genivi.data['position']['lon'],Genivi.data['position']['alt']);
+ if(Genivi.guidance_activated) {
+ Genivi.mapviewer_DisplayRoute(dbusIf,Genivi.data['show_route_handle'],false);
+ showGuidance();
+ showRoute();
+ updateGuidance();
+ if (Genivi.simulationPanelOnMapview===true)
+ {
+ showSimulation();
+ updateSimulation();
+ } else {
+ hideSimulation();
+ }
+ } else {
+ hideGuidance();
+ hideRoute();
+ hideSimulation();
+ updateAddress();
+ }
+ }
+ else {
if (Genivi.data['display_on_map']==='show_position') {
Genivi.mapviewer_SetFollowCarMode(dbusIf,false);
- Genivi.mapviewer_SetTargetPoint(dbusIf,Genivi.data['show_position']['lat'],Genivi.data['show_position']['lon'],Genivi.data['show_position']['alt']);
- } else {
- console.log("Error: no position valid");
+ Genivi.mapviewer_SetTargetPoint(dbusIf,Genivi.data['position']['lat'],Genivi.data['position']['lon'],Genivi.data['position']['alt']);
+ hideGuidance();
+ hideRoute();
+ hideSimulation();
+ updateAddress();
}
}
}
-
-
- connectSignals();
- updateGuidance();
- updateSimulation();
showZoom();
- hideMapSettings();
- if (Genivi.simulationPanelOnMapview===true)
- {
- showSimulation();
- } else {
- hideSimulation();
- }
}
}
diff --git a/src/hmi/qml/NavigationAppMain.qml b/src/hmi/qml/NavigationAppMain.qml
index a8ceee2..d99e1f9 100644
--- a/src/hmi/qml/NavigationAppMain.qml
+++ b/src/hmi/qml/NavigationAppMain.qml
@@ -73,7 +73,7 @@ HMIMenu {
StdButton {
source:StyleSheet.select_mapview[Constants.SOURCE]; x:StyleSheet.select_mapview[Constants.X]; y:StyleSheet.select_mapview[Constants.Y]; width:StyleSheet.select_mapview[Constants.WIDTH]; height:StyleSheet.select_mapview[Constants.HEIGHT];
id:mapview; next:poi; prev:navigation; onClicked: {
- Genivi.data["show_current_position"]=true;
+ Genivi.data['display_on_map']='show_current_position';
entryMenu("NavigationAppBrowseMap",menu);
}
}
diff --git a/src/hmi/qml/NavigationAppPOI.qml b/src/hmi/qml/NavigationAppPOI.qml
index 16a7315..a87f547 100644
--- a/src/hmi/qml/NavigationAppPOI.qml
+++ b/src/hmi/qml/NavigationAppPOI.qml
@@ -310,11 +310,10 @@ NavigationAppHMIMenu {
next:back; prev:select_reroute
onClicked: {
var poi_data=Genivi.poi_data[Genivi.poi_id];
- Genivi.data['show_position']['lat']=poi_data.lat;
- Genivi.data['show_position']['lon']=poi_data.lon;
- Genivi.data['mapback']="POI";
- mapMenu();
- }
+ Genivi.data['position']['lat']=poi_data.lat;
+ Genivi.data['position']['lon']=poi_data.lon;
+ entryMenu("NavigationAppBrowseMap",menu);
+ }
}
StdButton {
source:StyleSheet.back[Constants.SOURCE]; x:StyleSheet.back[Constants.X]; y:StyleSheet.back[Constants.Y]; width:StyleSheet.back[Constants.WIDTH]; height:StyleSheet.back[Constants.HEIGHT];textColor:StyleSheet.backText[Constants.TEXTCOLOR]; pixelSize:StyleSheet.backText[Constants.PIXELSIZE];
diff --git a/src/hmi/qml/NavigationAppSearch.qml b/src/hmi/qml/NavigationAppSearch.qml
index 419a6c7..87ac8c3 100644
--- a/src/hmi/qml/NavigationAppSearch.qml
+++ b/src/hmi/qml/NavigationAppSearch.qml
@@ -61,12 +61,25 @@ NavigationAppHMIMenu {
if(args[1]===Genivi.NAVIGATIONCORE_ACTIVE)
{
Genivi.guidance_activated = true;
+ if(Genivi.simulationPanelOnMapview){
+ Genivi.mapmatchedposition_SetSimulationMode(dbusIf,true);
+ }
//Guidance active, so inform the trip computer (refresh)
Genivi.fuelstopadvisor_SetFuelAdvisorSettings(dbusIf,1,50);
+ //Enter the map browser menu
+ disconnectSignals();
+ Genivi.data['display_on_map']='show_current_position';
+ Genivi.data["show_route_handle"]=Genivi.routing_handle(dbusIf);
+ entryMenu("NavigationAppBrowseMap",menu);
} else {
Genivi.guidance_activated = false;
+ Genivi.mapmatchedposition_SetSimulationMode(dbusIf,false);
//Guidance inactive, so inform the trip computer
Genivi.fuelstopadvisor_SetFuelAdvisorSettings(dbusIf,0,0);
+ guidance_start.disabled=false;
+ guidance_stop.disabled=true;
+ guidance_start.visible=true;
+ guidance_stop.visible=false;
}
}
@@ -394,9 +407,16 @@ NavigationAppHMIMenu {
for (var i=0;i<res[3].length;i+=4){
if ((res[3][i+1]== Genivi.NAVIGATIONCORE_LATITUDE) && (res[3][i+3][3][1] != 0)){
oklat=1;
+ Genivi.data['position']['lat']=res[3][i+3][3][1];
} else {
if ((res[3][i+1]== Genivi.NAVIGATIONCORE_LONGITUDE) && (res[3][i+3][3][1] != 0)){
oklong=1;
+ Genivi.data['position']['lon']=res[3][i+3][3][1];
+ } else {
+ if ((res[3][i+1]== Genivi.NAVIGATIONCORE_ALTITUDE) && (res[3][i+3][3][1] != 0)){
+ oklong=1;
+ Genivi.data['position']['alt']=res[3][i+3][3][1];
+ }
}
}
}
@@ -427,8 +447,8 @@ NavigationAppHMIMenu {
//launch route calculation
destination=Genivi.latlon_to_map(Genivi.data['destination']);
- position="";
- Genivi.routing_SetWaypoints(dbusIf,true,position,destination);
+ position=Genivi.latlon_to_map(Genivi.data['position']);
+ Genivi.routing_SetWaypoints(dbusIf,true,position,destination); //start from current position
Genivi.routing_CalculateRoute(dbusIf);
}
@@ -581,10 +601,17 @@ NavigationAppHMIMenu {
statusTitle.visible=true;
statusValue.visible=true;
show_route_on_map.visible=true;
- guidance_start.visible=true;
+ guidance_start.visible=false;
guidance_stop.visible=false;
- guidance_start.disabled=false;
- guidance_stop.disabled=true;
+ if(Genivi.guidance_activated){
+ guidance_start.disabled=true;
+ guidance_stop.disabled=false;
+ guidance_stop.visible=true;
+ }else{
+ guidance_start.disabled=false;
+ guidance_stop.disabled=true;
+ guidance_start.visible=true;
+ }
routeArea.model.clear();
routeArea.visible=true;
routeArea.forceActiveFocus();
@@ -811,11 +838,15 @@ NavigationAppHMIMenu {
visible: false;
onClicked: {
disconnectSignals();
- Genivi.data["mapback"]="NavigationAppSearch";
- Genivi.data['display_on_map']='show_route';
- Genivi.data['show_route_handle']=Genivi.routing_handle(dbusIf);
- Genivi.data['zoom_route_handle']=Genivi.routing_handle(dbusIf);
- mapMenu();
+ if(Genivi.guidance_activated){
+ Genivi.data['display_on_map']='show_current_position';
+ Genivi.data["show_route_handle"]=Genivi.routing_handle(dbusIf);
+ }else{
+ Genivi.data['display_on_map']='show_route';
+ Genivi.data['show_route_handle']=Genivi.routing_handle(dbusIf);
+ Genivi.data['zoom_route_handle']=Genivi.routing_handle(dbusIf);
+ }
+ entryMenu("NavigationAppBrowseMap",menu);
}
}
StdButton {
@@ -823,12 +854,7 @@ NavigationAppHMIMenu {
id:guidance_start; text: Genivi.gettext("On"); disabled:true; next:guidance_stop; prev:show_route_on_map
visible: false;
onClicked: {
- disconnectSignals();
Genivi.guidance_StartGuidance(dbusIf,Genivi.routing_handle(dbusIf));
- Genivi.data["mapback"]="NavigationAppSearch";
- Genivi.data['display_on_map']='show_current_position';
- Genivi.data["show_route_handle"]=Genivi.routing_handle(dbusIf);
- mapMenu();
}
}
StdButton {
@@ -837,8 +863,6 @@ NavigationAppHMIMenu {
visible: false;
onClicked: {
Genivi.guidance_StopGuidance(dbusIf);
- guidance_start.disabled=false;
- guidance_stop.disabled=true;
}
}
BorderImage {
@@ -943,6 +967,7 @@ NavigationAppHMIMenu {
id:settings; next:back; prev:calculate_curr;
disabled: keyboardActivated;
onClicked: {
+ disconnectSignals();
Genivi.preloadMode=true; //for the next call of this menu
entryMenu("NavigationAppSettings",menu);
}
@@ -952,6 +977,7 @@ NavigationAppHMIMenu {
id:poi; next:back; prev:calculate_curr;
disabled: keyboardActivated;
onClicked: {
+ disconnectSignals();
entryMenu("NavigationAppPOI",menu);
}
}
diff --git a/src/hmi/qml/NavigationAppSettings.qml b/src/hmi/qml/NavigationAppSettings.qml
index c4597b1..f9b3f6c 100644
--- a/src/hmi/qml/NavigationAppSettings.qml
+++ b/src/hmi/qml/NavigationAppSettings.qml
@@ -226,6 +226,22 @@ HMIMenu {
disconnectSignals();
}
+ function showSimulation()
+ {
+ speed_down.disabled=false;
+ speed_up.disabled=false;
+ on_off.disabled=false;
+ simu_mode.disabled=false;
+ }
+
+ function hideSimulation()
+ {
+ speed_down.disabled=true;
+ speed_up.disabled=true;
+ on_off.disabled=true;
+ simu_mode.disabled=true;
+ }
+
HMIBgImage {
id: content
image:StyleSheet.navigation_app_settings_background[Constants.SOURCE];
@@ -318,11 +334,11 @@ HMIMenu {
{
switch (status)
{
- case 0: //start the simulation
+ case 0: //enable the simulation mode and set it to pause
Genivi.mapmatchedposition_SetSimulationMode(dbusIf,true);
- Genivi.mapmatchedposition_StartSimulation(dbusIf);
+ Genivi.mapmatchedposition_PauseSimulation(dbusIf);
break;
- case 1: //stop the simulation
+ case 1: //disable the simulation mode
Genivi.mapmatchedposition_SetSimulationMode(dbusIf,false);
break;
default:
@@ -436,11 +452,14 @@ HMIMenu {
{ //hide the panel
Genivi.simulationPanelOnMapview=false;
onmapview_enable.setState("DISABLE");
+ hideSimulation();
}
else
{ //show the panel
Genivi.simulationPanelOnMapview=true;
onmapview_enable.setState("ENABLE");
+ showSimulation();
+ updateSimulation();
}
}
}