From 192640b1438a2c28e23b9ebd934aa31c9b8dc3ac Mon Sep 17 00:00:00 2001 From: asanoaozora Date: Thu, 31 Aug 2017 18:47:29 +0200 Subject: fix crash in guidance relaunch --- src/CMakeLists.txt | 2 +- .../gdp-theme/800x480/NavigationAppBrowseMap.xcf | Bin 1012778 -> 1012818 bytes .../800x480/NavigationAppBrowseMapGuidance.xcf | Bin 7138 -> 14767 bytes .../800x480/NavigationAppBrowseMapTop.xcf | Bin 34203 -> 18123 bytes src/hmi/qml/Core/genivi-capi.js | 25 ++- src/hmi/qml/Core/genivi-origin.js | 25 ++- src/hmi/qml/NavigationAppBrowseMap.qml | 106 ++++++------ src/hmi/qml/NavigationAppPOI.qml | 32 +++- src/hmi/qml/NavigationAppSearch.qml | 178 +++++++++++++++------ src/update_navit.sh | 1 + src/update_third_party.sh | 5 +- 11 files changed, 249 insertions(+), 125 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2f6810f..3f1941c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -53,7 +53,7 @@ set(AUTOMOTIVE_MESSAGE_BROKER_SRC_DIR "${AUTOMOTIVE_MESSAGE_BROKER_DIR}/src/${AU set(AUTOMOTIVE_MESSAGE_BROKER_BIN_DIR "${AUTOMOTIVE_MESSAGE_BROKER_DIR}/src/${AUTOMOTIVE_MESSAGE_BROKER}-build") set(AUTOMOTIVE_MESSAGE_BROKER_LIB_DIR "${AUTOMOTIVE_MESSAGE_BROKER_BIN_DIR}/lib") set(PATCH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/patches") -set(NAVIT_PNG_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/navigation/navit/navit/xpm") +set(NAVIT_PNG_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/navigation/navit/navit/icons") set(TRIPCOMPUTER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tripcomputer") set(COMMONAPI_GEN_DIR_POSITIONING "${CMAKE_CURRENT_BINARY_DIR}/enhanced-position-service/franca/api") diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf index a082fc5..4e9be9b 100644 Binary files a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf and b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf differ diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapGuidance.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapGuidance.xcf index 0003411..01ef6af 100755 Binary files a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapGuidance.xcf and b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapGuidance.xcf differ diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapTop.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapTop.xcf index 95f7da4..fd1dc64 100644 Binary files a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapTop.xcf and b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapTop.xcf differ diff --git a/src/hmi/qml/Core/genivi-capi.js b/src/hmi/qml/Core/genivi-capi.js index fcc1355..546f5e3 100644 --- a/src/hmi/qml/Core/genivi-capi.js +++ b/src/hmi/qml/Core/genivi-capi.js @@ -257,16 +257,27 @@ function duration(seconds) } // Give the formated time (with reset of hours if >= 24, only 24h format is supported) -// it supposes the time is less than 48 h -function time(seconds) +// it supposes the time is less than 48 h (to be improved) +function time(seconds,displaySeconds) { if (seconds >= 3600) { - if (Math.floor(seconds/3600) < 24) - return Math.floor(seconds/3600)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); - else - return (Math.floor(seconds/3600)-24)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); + if (Math.floor(seconds/3600) < 24){ + if(displaySeconds) + return Math.floor(seconds/3600)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); + else + return Math.floor(seconds/3600)+":"+(Math.floor(seconds/60)%60); + } + else{ + if(displaySeconds) + return (Math.floor(seconds/3600)-24)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); + else + return (Math.floor(seconds/3600)-24)+":"+(Math.floor(seconds/60)%60); + } } else { - return Math.floor(seconds/60)+":"+(seconds%60); + if(displaySeconds) + return Math.floor(seconds/60)+":"+(seconds%60); + else + return Math.floor(seconds/60); } } diff --git a/src/hmi/qml/Core/genivi-origin.js b/src/hmi/qml/Core/genivi-origin.js index 11b89ee..34ac1a2 100644 --- a/src/hmi/qml/Core/genivi-origin.js +++ b/src/hmi/qml/Core/genivi-origin.js @@ -257,16 +257,27 @@ function duration(seconds) } // Give the formated time (with reset of hours if >= 24, only 24h format is supported) -// it supposes the time is less than 48 h -function time(seconds) +// it supposes the time is less than 48 h (to be improved) +function time(seconds,displaySeconds) { if (seconds >= 3600) { - if (Math.floor(seconds/3600) < 24) - return Math.floor(seconds/3600)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); - else - return (Math.floor(seconds/3600)-24)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); + if (Math.floor(seconds/3600) < 24){ + if(displaySeconds) + return Math.floor(seconds/3600)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); + else + return Math.floor(seconds/3600)+":"+(Math.floor(seconds/60)%60); + } + else{ + if(displaySeconds) + return (Math.floor(seconds/3600)-24)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); + else + return (Math.floor(seconds/3600)-24)+":"+(Math.floor(seconds/60)%60); + } } else { - return Math.floor(seconds/60)+":"+(seconds%60); + if(displaySeconds) + return Math.floor(seconds/60)+":"+(seconds%60); + else + return Math.floor(seconds/60); } } diff --git a/src/hmi/qml/NavigationAppBrowseMap.qml b/src/hmi/qml/NavigationAppBrowseMap.qml index ac6d28f..86080e6 100644 --- a/src/hmi/qml/NavigationAppBrowseMap.qml +++ b/src/hmi/qml/NavigationAppBrowseMap.qml @@ -130,20 +130,21 @@ NavigationAppHMIMenu { { Genivi.hookSignal(dltIf,"guidanceManeuverChanged"); var advice = Genivi.Maneuver[args[1]]; + console.log(advice) maneuverBarCru.visible=false; maneuverBarApp.visible=false; maneuverBarPre.visible=false; maneuverBarAdv.visible=false; - if (advice=="CRU") + if (advice==="CRU" || advice==="PAS") maneuverBarCru.visible=true; else { - if (advice=="APP") + if (advice==="APP") maneuverBarApp.visible=true; else { - if (advice=="PRE") + if (advice==="PRE") maneuverBarPre.visible=true; else { - if (advice=="ADV") + if (advice==="ADV") maneuverBarAdv.visible=true; } } @@ -156,7 +157,7 @@ NavigationAppHMIMenu { Genivi.hookSignal(dltIf,"guidanceWaypointReached"); if (args[1]) { // "Destination reached" - stopGuidance(); + exitRoute(); } else { // "Waypoint reached" TBD } @@ -637,10 +638,10 @@ NavigationAppHMIMenu { var direction=items[j+1][5]; var maneuver=items[j+1][7]; var maneuverData=items[j+1][9]; - if (maneuverData[1] == Genivi.NAVIGATIONCORE_DIRECTION) + if (maneuverData[1] === Genivi.NAVIGATIONCORE_DIRECTION) { - var text=Genivi.distance(offsetOfManeuver)+" "+Genivi.distance(offsetOfNextManeuver)+" "+Genivi.ManeuverType[maneuver]+":"+Genivi.ManeuverDirection[direction]+" "+roadNameAfterManeuver; - model.append({"name":text}); + var text=Genivi.distance(offsetOfManeuver)+" "+Genivi.ManeuverDirection[maneuverData[3][3][1]]+" "+roadNameAfterManeuver; + model.append({"name":text}); } } } @@ -724,17 +725,11 @@ NavigationAppHMIMenu { var timetodestination = res1[3]; //in sec //following stuff can be improved, it's a first attempt :-) var dateTime = new Date(); - timeofarrivalValue.text=Genivi.time(parseInt(Qt.formatTime(dateTime,"hh"),10)*3600+parseInt(Qt.formatTime(dateTime,"mm"),10)*60+parseInt(Qt.formatTime(dateTime,"ss"),10)+timetodestination); + timeofarrivalValue.text=Genivi.time(parseInt(Qt.formatTime(dateTime,"hh"),10)*3600+parseInt(Qt.formatTime(dateTime,"mm"),10)*60+parseInt(Qt.formatTime(dateTime,"ss"),10)+timetodestination,false); updateAddress(); } - function stopGuidance() - { - Genivi.guidance_StopGuidance(dbusIf,dltIf); - Genivi.mapviewer_HideRoute(dbusIf,dltIf,Genivi.g_routing_handle); - } - function startGuidance() { Genivi.guidance_StartGuidance(dbusIf,dltIf,Genivi.routing_handle()); @@ -790,6 +785,23 @@ NavigationAppHMIMenu { Genivi.routing_CalculateRoute(dbusIf,dltIf); } + function exitRoute() + { + //if needed, reset the guidance and the routing to enter a new destination + if(Genivi.guidance_activated) + { + Genivi.setGuidanceActivated(dltIf,false); + Genivi.guidance_StopGuidance(dbusIf,dltIf); + //Guidance inactive, so inform the trip computer + Genivi.fuelstopadvisor_SetFuelAdvisorSettings(dbusIf,dltIf,0,0); + } + if(Genivi.route_calculated) + { + Genivi.routing_DeleteRoute(dbusIf,dltIf,Genivi.g_routing_handle); + Genivi.setRouteCalculated(dltIf,false); + } + } + function showManeuversListPanel() { displayManeuvers=true; @@ -841,16 +853,16 @@ NavigationAppHMIMenu { function showGuidancePanel() { guidance.visible=true; - roadaftermaneuverBlock.visible=true; distancetomaneuverValue.visible=true; + roadaftermaneuverValue.visible=true; maneuverIcon.visible=true; } function hideGuidancePanel() { guidance.visible=false; - roadaftermaneuverBlock.visible=false; distancetomaneuverValue.visible=false; + roadaftermaneuverValue.visible=false; maneuverIcon.visible=false; select_search_for_refill_in_top.visible=false; select_search_for_refill_in_top.disabled=true; @@ -860,7 +872,6 @@ NavigationAppHMIMenu { { route.visible=true; maneuverList.disabled=false; - roadaftermaneuverValue.visible=true; distancetodestinationValue.visible=true; timeofarrivalValue.visible=true; } @@ -869,7 +880,6 @@ NavigationAppHMIMenu { { route.visible=false; maneuverList.disabled=true; - roadaftermaneuverValue.visible=false; distancetodestinationValue.visible=false; timeofarrivalValue.visible=false; } @@ -983,21 +993,6 @@ NavigationAppHMIMenu { } } - BorderImage { - id: roadaftermaneuverBlock - source:StyleSheetBrowseMapTop.roadaftermaneuverBlock[Constants.SOURCE]; x:StyleSheetBrowseMapTop.roadaftermaneuverBlock[Constants.X]; y:StyleSheetBrowseMapTop.roadaftermaneuverBlock[Constants.Y]; width:StyleSheetBrowseMapTop.roadaftermaneuverBlock[Constants.WIDTH]; height:StyleSheetBrowseMapTop.roadaftermaneuverBlock[Constants.HEIGHT]; - border.left: 0; border.top: 0 - border.right: 0; border.bottom: 0 - visible: false; - } - - SmartText { - x:StyleSheetBrowseMapTop.roadaftermaneuverValue[Constants.X]; y:StyleSheetBrowseMapTop.roadaftermaneuverValue[Constants.Y]; width:StyleSheetBrowseMapTop.roadaftermaneuverValue[Constants.WIDTH]; height:StyleSheetBrowseMapTop.roadaftermaneuverValue[Constants.HEIGHT];color:StyleSheetBrowseMapTop.roadaftermaneuverValue[Constants.TEXTCOLOR];styleColor:StyleSheetBrowseMapTop.roadaftermaneuverValue[Constants.STYLECOLOR]; font.pixelSize:StyleSheetBrowseMapTop.roadaftermaneuverValue[Constants.PIXELSIZE]; - visible: true - id:roadaftermaneuverValue - text: " " - } - SmartText { x:StyleSheetBrowseMapTop.statusValue[Constants.X]; y:StyleSheetBrowseMapTop.statusValue[Constants.Y]; width:StyleSheetBrowseMapTop.statusValue[Constants.WIDTH]; height:StyleSheetBrowseMapTop.statusValue[Constants.HEIGHT];color:StyleSheetBrowseMapTop.statusValue[Constants.TEXTCOLOR];styleColor:StyleSheetBrowseMapTop.statusValue[Constants.STYLECOLOR]; font.pixelSize:StyleSheetBrowseMapTop.statusValue[Constants.PIXELSIZE]; id:statusValue @@ -1024,8 +1019,10 @@ NavigationAppHMIMenu { id:menub; text:Genivi.gettext("Back"); onClicked: { disconnectSignals(); - if (Genivi.entrybackheapsize) + if (Genivi.entrybackheapsize){ + Genivi.preloadMode=true; leaveMenu(dltIf); + } else entryMenu(dltIf,"NavigationAppMain",menu); } @@ -1176,6 +1173,13 @@ NavigationAppHMIMenu { text: " " } + SmartText { + x:StyleSheetBrowseMapGuidance.roadaftermaneuverValue[Constants.X]; y:StyleSheetBrowseMapGuidance.roadaftermaneuverValue[Constants.Y]; width:StyleSheetBrowseMapGuidance.roadaftermaneuverValue[Constants.WIDTH]; height:StyleSheetBrowseMapGuidance.roadaftermaneuverValue[Constants.HEIGHT];color:StyleSheetBrowseMapGuidance.roadaftermaneuverValue[Constants.TEXTCOLOR];styleColor:StyleSheetBrowseMapGuidance.roadaftermaneuverValue[Constants.STYLECOLOR]; font.pixelSize:StyleSheetBrowseMapGuidance.roadaftermaneuverValue[Constants.PIXELSIZE]; + visible: true + id:roadaftermaneuverValue + text: " " + } + BorderImage { id: maneuverBarAdv source:StyleSheetBrowseMapGuidance.maneuverBarAdv[Constants.SOURCE]; x:StyleSheetBrowseMapGuidance.maneuverBarAdv[Constants.X]; y:StyleSheetBrowseMapGuidance.maneuverBarAdv[Constants.Y]; width:StyleSheetBrowseMapGuidance.maneuverBarAdv[Constants.WIDTH]; height:StyleSheetBrowseMapGuidance.maneuverBarAdv[Constants.HEIGHT]; @@ -1638,6 +1642,8 @@ NavigationAppHMIMenu { onPressed: { //stop guidance Genivi.guidance_StopGuidance(dbusIf,dltIf); + //Guidance inactive, so inform the trip computer + Genivi.fuelstopadvisor_SetFuelAdvisorSettings(dbusIf,dltIf,0,0); Genivi.mapviewer_HideRoute(dbusIf,dltIf,Genivi.g_routing_handle); } } @@ -1646,16 +1652,8 @@ NavigationAppHMIMenu { id:location_input; onPressed: { disconnectSignals(); - //if needed, reset the guidance and the routing to enter a new destination - if(Genivi.guidance_activated) - { - Genivi.setGuidanceActivated(dltIf,false); - } - if(Genivi.route_calculated) - { - Genivi.routing_DeleteRoute(dbusIf,dltIf,Genivi.g_routing_handle); - Genivi.setRouteCalculated(dltIf,false); - } + exitRoute(); + //the location is entered by address Genivi.setLocationInputActivated(dltIf,true); Genivi.preloadMode=true; entryMenu(dltIf,"NavigationAppSearch",menu); @@ -1665,19 +1663,11 @@ NavigationAppHMIMenu { source:StyleSheetBrowseMapSettings.poi[Constants.SOURCE]; x:StyleSheetBrowseMapSettings.poi[Constants.X]; y:StyleSheetBrowseMapSettings.poi[Constants.Y]; width:StyleSheetBrowseMapSettings.poi[Constants.WIDTH]; height:StyleSheetBrowseMapSettings.poi[Constants.HEIGHT]; id:poi; onPressed: { - disconnectSignals(); - //if needed, reset the guidance and the routing to enter a new destination - if(Genivi.guidance_activated) - { - Genivi.setGuidanceActivated(dltIf,false); - } - if(Genivi.route_calculated) - { - Genivi.routing_DeleteRoute(dbusIf,dltIf,Genivi.g_routing_handle); - Genivi.setRouteCalculated(dltIf,false); - } - Genivi.setLocationInputActivated(dltIf,false); - entryMenu(dltIf,"NavigationAppPOI",menu); + disconnectSignals(); + exitRoute(); + // the location is entered by poi + Genivi.setLocationInputActivated(dltIf,false); + entryMenu(dltIf,"NavigationAppPOI",menu); } } StdButton { diff --git a/src/hmi/qml/NavigationAppPOI.qml b/src/hmi/qml/NavigationAppPOI.qml index 2ded99a..a63cbca 100644 --- a/src/hmi/qml/NavigationAppPOI.qml +++ b/src/hmi/qml/NavigationAppPOI.qml @@ -135,8 +135,6 @@ NavigationAppHMIMenu { categoriesAndRadius[1]=Genivi.radius; categoriesAndRadiusList.push(categoriesAndRadius); - Genivi.poisearch_DeletePoiSearchHandle(dbusIf,dltIf) - Genivi.g_poisearch_handle[1]=0; var res_poi=Genivi.poisearch_CreatePoiSearchHandle(dbusIf,dltIf) Genivi.g_poisearch_handle[1]=res_poi[1]; Genivi.poisearch_SetCenter(dbusIf,dltIf,latitude,longitude,0); @@ -210,6 +208,27 @@ NavigationAppHMIMenu { selectedValueTitle.visible=false; select_reroute.disabled=true; select_display_on_map.disabled=true; + if(Genivi.g_poisearch_handle[1]){ + Genivi.poisearch_DeletePoiSearchHandle(dbusIf,dltIf) + Genivi.g_poisearch_handle[1]=0; + } + } + + function exitRoute() + { + //if needed, reset the guidance and the routing to enter a new destination + if(Genivi.guidance_activated) + { + Genivi.setGuidanceActivated(dltIf,false); + Genivi.guidance_StopGuidance(dbusIf,dltIf); + //Guidance inactive, so inform the trip computer + Genivi.fuelstopadvisor_SetFuelAdvisorSettings(dbusIf,dltIf,0,0); + } + if(Genivi.route_calculated) + { + Genivi.routing_DeleteRoute(dbusIf,dltIf,Genivi.g_routing_handle); + Genivi.setRouteCalculated(dltIf,false); + } } //------------------------------------------// @@ -368,6 +387,8 @@ NavigationAppHMIMenu { poiFrame.visible=true; categoryFrame.visible=false; view.model.clear(); + //launch a search on the selected category + clearSearch(); searchPois(); } else { keyboardArea.destination.text="" @@ -385,6 +406,7 @@ NavigationAppHMIMenu { firstLayout: Genivi.kbdFirstLayout; secondLayout: Genivi.kbdSecondLayout; onKeypress: { + //launch a search on the selected category clearSearch(); searchPois(); } @@ -395,6 +417,8 @@ NavigationAppHMIMenu { id:location_input; onClicked: { disconnectSignals(); + exitRoute(); + //the location is entered by address Genivi.setLocationInputActivated(dltIf,true); Genivi.preloadMode=true; pageOpen(dltIf,"NavigationAppSearch"); @@ -408,7 +432,6 @@ NavigationAppHMIMenu { disconnectSignals(); Genivi.data['destination']=Genivi.poi_data[Genivi.poi_id]; Genivi.setRerouteRequested(dltIf,true); - Genivi.guidance_StopGuidance(dbusIf,dltIf); //create a route var res4=Genivi.routing_CreateRoute(dbusIf,dltIf); Genivi.g_routing_handle[1]=res4[3]; @@ -444,7 +467,6 @@ NavigationAppHMIMenu { text: Genivi.gettext("Back"); onClicked: { disconnectSignals(); - Genivi.guidance_StopGuidance(dbusIf,dltIf); rootMenu(dltIf,"NavigationAppBrowseMap"); } } @@ -456,7 +478,6 @@ NavigationAppHMIMenu { var ret=Genivi.poisearch_GetAvailableCategories(dbusIf,dltIf); Genivi.categoriesIdNameList=ret[1]; - clearSearch(); for (var j = 0 ; j < Genivi.categoriesIdNameList.length ; j+=2) { if (Genivi.categoriesIdNameList[j+1][3] === Genivi.default_category_name) { Genivi.category_id=Genivi.categoriesIdNameList[j+1][1]; @@ -470,6 +491,7 @@ NavigationAppHMIMenu { poiFrame.visible=true; //launch a search on the default category + clearSearch(); searchPois(); if(!Genivi.showroom) { diff --git a/src/hmi/qml/NavigationAppSearch.qml b/src/hmi/qml/NavigationAppSearch.qml index ee46eed..162a9c3 100644 --- a/src/hmi/qml/NavigationAppSearch.qml +++ b/src/hmi/qml/NavigationAppSearch.qml @@ -151,11 +151,14 @@ NavigationAppHMIMenu { if (Genivi.address[Genivi.NAVIGATIONCORE_CITY] !== "") { cityValue.text=Genivi.address[Genivi.NAVIGATIONCORE_CITY]; + cityValue.visible=true; + cityKeyboard.disabled=false; accept(cityValue); streetValue.disabled=false; } - else + else{ Genivi.preloadMode=false; + } } else { @@ -164,10 +167,13 @@ NavigationAppHMIMenu { if (Genivi.address[Genivi.NAVIGATIONCORE_STREET] !== "") { streetValue.text=Genivi.address[Genivi.NAVIGATIONCORE_STREET]; + streetValue.visible=true; + streetKeyboard.disabled=false; accept(streetValue); - numberValue.disabled=false; } - + else{ + Genivi.preloadMode=false; + } } else { @@ -185,8 +191,7 @@ NavigationAppHMIMenu { select_display_on_map.disabled=true; Genivi.hookMessage(dltIf,"Error","Error when load a preloaded address"); } - Genivi.locationinput_DeleteLocationInput(dbusIf,dltIf); //clear the handle - Genivi.g_locationinput_handle[1]=0; + releaseLocationInputHandle(); } } } @@ -292,10 +297,6 @@ NavigationAppHMIMenu { streetValue.text=address[i+3][3][1]; Genivi.address[Genivi.NAVIGATIONCORE_STREET]=streetValue.text; } - if (address[i+1] == Genivi.NAVIGATIONCORE_HOUSENUMBER) { - numberValue.text=address[i+3][3][1]; - Genivi.address[Genivi.NAVIGATIONCORE_HOUSENUMBER]=numberValue.text; - } } // Manage the focus @@ -306,8 +307,6 @@ NavigationAppHMIMenu { focus=cityValue; if (!streetValue.disabled) focus=streetValue; - if (!numberValue.disabled) - focus=numberValue; focus.takeFocus(); } @@ -417,7 +416,7 @@ NavigationAppHMIMenu { var maneuverData=items[j+1][9]; if (maneuverData[1] === Genivi.NAVIGATIONCORE_DIRECTION) { - var text=Genivi.distance(offsetOfManeuver)+" "+Genivi.ManeuverType[maneuver]+" "+roadNameAfterManeuver; + var text=Genivi.distance(offsetOfManeuver)+" "+Genivi.ManeuverDirection[maneuverData[3][3][1]]+" "+roadNameAfterManeuver; model.append({"name":text,"number":maneuverIndex}); maneuverIconIDList[maneuverIndex]=maneuverData[3][3][1]; maneuverIndex+=1; @@ -508,18 +507,45 @@ NavigationAppHMIMenu { //------------------------------------------// // Management of "location input" configuration //------------------------------------------// + function holdLocationInputHandle() + { + // create a location input handler + var res=Genivi.locationinput_CreateLocationInput(dbusIf,dltIf); //get an handle for the location input + Genivi.g_locationinput_handle[1]=res[3]; + + } + + function releaseLocationInputHandle() + { + Genivi.locationinput_DeleteLocationInput(dbusIf,dltIf); //clear the handle + Genivi.g_locationinput_handle[1]=0; + } + + function alignAddress() + { + Genivi.address[Genivi.NAVIGATIONCORE_COUNTRY]=countryValue.text; + Genivi.address[Genivi.NAVIGATIONCORE_CITY]=cityValue.text; + Genivi.address[Genivi.NAVIGATIONCORE_STREET]=streetValue.text; + Genivi.address[Genivi.NAVIGATIONCORE_HOUSENUMBER]=numberValue.text; + } + function loadAddress() { //load an address and test if it's guidable if (Genivi.address[Genivi.NAVIGATIONCORE_COUNTRY] !== "") {//need to test empty string - var res=Genivi.locationinput_CreateLocationInput(dbusIf,dltIf); //get an handle for the location input - Genivi.g_locationinput_handle[1]=res[3]; + holdLocationInputHandle(); + countryKeyboard.disabled=false; countryValue.text=Genivi.address[Genivi.NAVIGATIONCORE_COUNTRY]; + countryValue.visible=true; + cityKeyboard.disabled=true; + cityValue.visible=false; + streetKeyboard.disabled=true; + streetValue.visible=false accept(countryValue); - cityValue.disabled=false; } - else + else{ Genivi.preloadMode=false; // because preload needs first a country to be launched + } } function initAddress() @@ -527,14 +553,26 @@ NavigationAppHMIMenu { if (Genivi.address[Genivi.NAVIGATIONCORE_COUNTRY] !== "") {//need to test empty string countryValue.text=Genivi.address[Genivi.NAVIGATIONCORE_COUNTRY]; - cityValue.text=Genivi.address[Genivi.NAVIGATIONCORE_CITY]; - streetValue.text=Genivi.address[Genivi.NAVIGATIONCORE_STREET]; - numberValue.text=Genivi.address[Genivi.NAVIGATIONCORE_HOUSENUMBER]; - } else { + countryKeyboard.disabled=false; + if (Genivi.address[Genivi.NAVIGATIONCORE_CITY] !== "") + { + cityValue.text=Genivi.address[Genivi.NAVIGATIONCORE_CITY]; + cityKeyboard.disabled=false; + if (Genivi.address[Genivi.NAVIGATIONCORE_STREET] !== "") + { + streetValue.text=Genivi.address[Genivi.NAVIGATIONCORE_STREET]; + streetKeyboard.disabled=false; + }else{ + streetValue.text=""; + streetKeyboard.disabled=true; + } + }else{ + cityValue.text=""; + cityKeyboard.disabled=true; + } + }else { countryValue.text=""; - cityValue.text=""; - streetValue.text=""; - numberValue.text=""; + countryKeyboard.disabled=true; } } @@ -573,14 +611,14 @@ NavigationAppHMIMenu { { //valid item and load another one if needed if(keyboardArea.destination === countryValue) { cityValue.callEntry(); + cityKeyboard.disabled=false; streetValue.text="" - numberValue.text="" initKeyboard(); showKeyboard(); } else { if(keyboardArea.destination === cityValue) { streetValue.callEntry(); - numberValue.text="" + streetKeyboard.disabled=false; initKeyboard(); showKeyboard(); } else { @@ -596,19 +634,15 @@ NavigationAppHMIMenu { locationInputBackground.visible=true; countryTitle.visible=true; countryKeyboard.visible=true; - countryKeyboard.disabled=false; countryValue.visible=true; cityTitle.visible=true; cityKeyboard.visible=true; - cityKeyboard.disabled=false; cityValue.visible=true; streetTitle.visible=true; streetKeyboard.visible=true; - streetKeyboard.disabled=false; streetValue.visible=true; numberTitle.visible=true; numberKeyboard.visible=true; - numberKeyboard.disabled=false; numberValue.visible=true; } @@ -655,6 +689,7 @@ NavigationAppHMIMenu { Genivi.setRouteCalculated(dltIf,false); hideRoutePanel(); hideGuidancePanel(); + listArea.forceActiveFocus(); if (Genivi.entrycriterion) { criterion=Genivi.entrycriterion; @@ -714,7 +749,7 @@ NavigationAppHMIMenu { timeValue.text= Genivi.duration(timetodestination); //following stuff can be improved, it's a first attempt :-) var dateTime = new Date(); - arrivalValue.text=Genivi.time(parseInt(Qt.formatTime(dateTime,"hh"),10)*3600+parseInt(Qt.formatTime(dateTime,"mm"),10)*60+parseInt(Qt.formatTime(dateTime,"ss"),10)+timetodestination); + arrivalValue.text=Genivi.time(parseInt(Qt.formatTime(dateTime,"hh"),10)*3600+parseInt(Qt.formatTime(dateTime,"mm"),10)*60+parseInt(Qt.formatTime(dateTime,"ss"),10)+timetodestination,true); } function showRoutePanel() @@ -760,6 +795,7 @@ NavigationAppHMIMenu { maneuverArea.visible=true; maneuverArea.forceActiveFocus(); crossroadZoom.visible=false; + maneuverIconBackground.visible=true; maneuverIconPreview.visible=true; prev_maneuver.visible=true; prev_maneuver.disabled=false; @@ -771,11 +807,16 @@ NavigationAppHMIMenu { { maneuverArea.visible=false; crossroadZoom.visible=true; + maneuverIconBackground.visible=false; maneuverIconPreview.visible=false; prev_maneuver.visible=false; prev_maneuver.disabled=true; next_maneuver.visible=false; next_maneuver.disabled=true; + guidance_start.disabled=true; + guidance_start.visible=false; + guidance_stop.disabled=true; + guidance_stop.visible=false; } function guidanceActive() @@ -794,6 +835,23 @@ NavigationAppHMIMenu { guidance_stop.visible=false; } + function exitRoute() + { + //if needed, reset the guidance and the routing to enter a new destination + if(Genivi.guidance_activated) + { + Genivi.setGuidanceActivated(dltIf,false); + Genivi.guidance_StopGuidance(dbusIf,dltIf); + //Guidance inactive, so inform the trip computer + Genivi.fuelstopadvisor_SetFuelAdvisorSettings(dbusIf,dltIf,0,0); + } + if(Genivi.route_calculated) + { + Genivi.routing_DeleteRoute(dbusIf,dltIf,Genivi.g_routing_handle); + Genivi.setRouteCalculated(dltIf,false); + } + } + //------------------------------------------// // Menu elements //------------------------------------------// @@ -835,12 +893,14 @@ NavigationAppHMIMenu { } StdButton { source:StyleSheet.countryKeyboard[Constants.SOURCE]; x:StyleSheet.countryKeyboard[Constants.X]; y:StyleSheet.countryKeyboard[Constants.Y]; width:StyleSheet.countryKeyboard[Constants.WIDTH]; height:StyleSheet.countryKeyboard[Constants.HEIGHT]; - id:countryKeyboard; disabled:false; + id:countryKeyboard; disabled:true; onClicked: { countryValue.callEntry(); cityValue.text="" + cityKeyboard.disabled=true; streetValue.text="" - numberValue.text="" + streetKeyboard.disabled=true; + holdLocationInputHandle(); initKeyboard(); showKeyboard(); } @@ -862,11 +922,14 @@ NavigationAppHMIMenu { } StdButton { source:StyleSheet.cityKeyboard[Constants.SOURCE]; x:StyleSheet.cityKeyboard[Constants.X]; y:StyleSheet.cityKeyboard[Constants.Y]; width:StyleSheet.cityKeyboard[Constants.WIDTH]; height:StyleSheet.cityKeyboard[Constants.HEIGHT]; - id:cityKeyboard; disabled:false; + id:cityKeyboard; disabled:true; onClicked: { cityValue.callEntry(); streetValue.text="" - numberValue.text="" + streetKeyboard.disabled=true; + alignAddress(); + Genivi.preloadMode=true; + loadAddress(); initKeyboard(); showKeyboard(); } @@ -888,10 +951,11 @@ NavigationAppHMIMenu { } StdButton { source:StyleSheet.streetKeyboard[Constants.SOURCE]; x:StyleSheet.streetKeyboard[Constants.X]; y:StyleSheet.streetKeyboard[Constants.Y]; width:StyleSheet.streetKeyboard[Constants.WIDTH]; height:StyleSheet.streetKeyboard[Constants.HEIGHT]; - id:streetKeyboard; disabled:false; + id:streetKeyboard; disabled:true; onClicked: { streetValue.callEntry(); numberValue.text="" + alignAddress(); initKeyboard(); showKeyboard(); } @@ -913,7 +977,7 @@ NavigationAppHMIMenu { } StdButton { source:StyleSheet.numberKeyboard[Constants.SOURCE]; x:StyleSheet.numberKeyboard[Constants.X]; y:StyleSheet.numberKeyboard[Constants.Y]; width:StyleSheet.numberKeyboard[Constants.WIDTH]; height:StyleSheet.numberKeyboard[Constants.HEIGHT]; - id:numberKeyboard; disabled:false; + id:numberKeyboard; disabled:true; onClicked: { numberValue.callEntry(); initKeyboard(); @@ -1035,7 +1099,25 @@ NavigationAppHMIMenu { id:guidance_stop;text: Genivi.gettext("Off"); disabled:true; visible: false; onClicked: { - Genivi.guidance_StopGuidance(dbusIf,dltIf); + if(Genivi.location_input_activated){ + exitRoute(); + hideRoutePanel(); + showLocationInput(); + hideElementName(); + // Preload address if activated + if (Genivi.preloadMode==true) + { + loadAddress(); + }else{ + Genivi.setDestinationDefined(dltIf,false); + } + }else{ + disconnectSignals(); + exitRoute(); + // the location is entered by poi + Genivi.setLocationInputActivated(dltIf,false); + pageOpen(dltIf,"NavigationAppPOI"); + } } } BorderImage { @@ -1045,6 +1127,12 @@ NavigationAppHMIMenu { border.right: 0; border.bottom: 0 visible: true; } + Rectangle { + id: maneuverIconBackground + x:StyleSheet.maneuverIconPreview[Constants.X]; y:StyleSheet.maneuverIconPreview[Constants.Y]; width:StyleSheet.maneuverIconPreview[Constants.WIDTH]; height:StyleSheet.maneuverIconPreview[Constants.HEIGHT]; + color: "white"; + visible: false; + } BorderImage { id: maneuverIconPreview source:StyleSheet.maneuverIconPreview[Constants.SOURCE]; x:StyleSheet.maneuverIconPreview[Constants.X]; y:StyleSheet.maneuverIconPreview[Constants.Y]; width:StyleSheet.maneuverIconPreview[Constants.WIDTH]; height:StyleSheet.maneuverIconPreview[Constants.HEIGHT]; @@ -1052,6 +1140,7 @@ NavigationAppHMIMenu { border.right: 0; border.bottom: 0 visible: false; } + StdButton { source:StyleSheet.prev_maneuver[Constants.SOURCE]; x:StyleSheet.prev_maneuver[Constants.X]; y:StyleSheet.prev_maneuver[Constants.Y]; width:StyleSheet.prev_maneuver[Constants.WIDTH]; height:StyleSheet.prev_maneuver[Constants.HEIGHT]; id:prev_maneuver; @@ -1177,8 +1266,7 @@ NavigationAppHMIMenu { disabled: !(keyboardActivated); onClicked: { Genivi.preloadMode=false; - Genivi.locationinput_DeleteLocationInput(dbusIf,dltIf); //clear the handle - Genivi.g_locationinput_handle[1]=0; + releaseLocationInputHandle(); hideKeyboard(); initAddress(); } @@ -1189,6 +1277,8 @@ NavigationAppHMIMenu { disabled: keyboardActivated; onClicked: { disconnectSignals(); + exitRoute(); + // the location is entered by poi Genivi.setLocationInputActivated(dltIf,false); pageOpen(dltIf,"NavigationAppPOI"); } @@ -1209,9 +1299,7 @@ NavigationAppHMIMenu { disabled: keyboardActivated; onClicked: { disconnectSignals(); - Genivi.guidance_StopGuidance(dbusIf,dltIf); - Genivi.locationinput_DeleteLocationInput(dbusIf,dltIf); //clear the handle - Genivi.g_locationinput_handle[1]=0; + releaseLocationInputHandle(); rootMenu(dltIf,"NavigationAppBrowseMap"); } } @@ -1239,7 +1327,6 @@ NavigationAppHMIMenu { streetValue.text=Genivi.address[Genivi.NAVIGATIONCORE_STREET]; streetValue.disabled=false; numberValue.text=Genivi.address[Genivi.NAVIGATIONCORE_HOUSENUMBER]; - numberValue.disabled=false; }else{ showElementName(); hideLocationInput(); @@ -1267,12 +1354,13 @@ NavigationAppHMIMenu { hideElementName(); countryValue.text=Genivi.address[Genivi.NAVIGATIONCORE_COUNTRY]; countryValue.disabled=false; + countryKeyboard.disabled=false; cityValue.text=Genivi.address[Genivi.NAVIGATIONCORE_CITY]; cityValue.disabled=false; + cityKeyboard.disabled=false; streetValue.text=Genivi.address[Genivi.NAVIGATIONCORE_STREET]; streetValue.disabled=false; - numberValue.text=Genivi.address[Genivi.NAVIGATIONCORE_HOUSENUMBER]; - numberValue.disabled=false; + streetKeyboard.disabled=false; }else{ //destination is a poi showElementName(); diff --git a/src/update_navit.sh b/src/update_navit.sh index 7e85cad..0da0eb5 100755 --- a/src/update_navit.sh +++ b/src/update_navit.sh @@ -18,6 +18,7 @@ cd navit git checkout $navit_version patch -p0 -i ../patches/search_list_get_unique.diff patch -p0 -i ../patches/fsa_issue_padding.diff +patch -p0 -i ../patches/avoid-crash-on-guidance-when-delete-and-recreate-route.diff cd ../../../../ diff --git a/src/update_third_party.sh b/src/update_third_party.sh index 5cafa04..570b0d6 100755 --- a/src/update_third_party.sh +++ b/src/update_third_party.sh @@ -1,8 +1,8 @@ #!/bin/bash -navigation_version='58be072f387b9430944d7fd8d75900295ab53971' +navigation_version='e31de24c6f882a41ed13086712e97539cbf7b1a2' positioning_version='9725fe1f553197042d6445997690d452a73490c0' -navit_version='28478e7f26c1a0eedc06fb4765e2f736079c6f0c' +navit_version='f5abdd317e10d56226300d001469595658a605e4' echo "version of navigation is: $navigation_version" echo "version of positioning is: $positioning_version" @@ -27,6 +27,7 @@ case "$input" in git checkout $navit_version patch -p0 -i ../patches/search_list_get_unique.diff patch -p0 -i ../patches/fsa_issue_padding.diff + patch -p0 -i ../patches/avoid-crash-on-guidance-when-delete-and-recreate-route.diff cd ../ echo "Please rebuild with at least -c -n option" ;; -- cgit v1.2.1