diff options
author | asanoaozora <fifitaneki@hotmail.com> | 2017-08-18 17:36:33 +0200 |
---|---|---|
committer | asanoaozora <fifitaneki@hotmail.com> | 2017-08-18 17:36:33 +0200 |
commit | 3ffbca17769bd12cece19d47d20e96257e5e990f (patch) | |
tree | 3fecf38fc2bce07438041b05555562db80eec41c | |
parent | 4993854cf11586b328a70d2a61dd3b8ad91b7150 (diff) | |
download | navigation-3ffbca17769bd12cece19d47d20e96257e5e990f.tar.gz |
add time at arrival, create a bug table
-rwxr-xr-x | src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapRoute.xcf | bin | 23531 -> 23527 bytes | |||
-rw-r--r-- | src/hmi/qml/Core/genivi-capi.js | 26 | ||||
-rw-r--r-- | src/hmi/qml/Core/genivi-origin.js | 26 | ||||
-rw-r--r-- | src/hmi/qml/NavigationAppBrowseMap.qml | 22 | ||||
-rw-r--r-- | src/hmi/qml/NavigationAppSearch.qml | 2 | ||||
-rwxr-xr-x | src/set_window_location | 7 | ||||
-rwxr-xr-x | src/update_navit.sh | 23 | ||||
-rwxr-xr-x | src/update_positioning.sh | 25 | ||||
-rwxr-xr-x | src/update_third_party.sh | 71 | ||||
-rw-r--r-- | test/bugList.ods | bin | 0 -> 16775 bytes | |||
-rw-r--r-- | test/log/test-route-calculation.pdf | bin | 0 -> 35279 bytes |
11 files changed, 117 insertions, 85 deletions
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapRoute.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapRoute.xcf Binary files differindex 89cf390..734f161 100755 --- a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapRoute.xcf +++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapRoute.xcf diff --git a/src/hmi/qml/Core/genivi-capi.js b/src/hmi/qml/Core/genivi-capi.js index a3ab685..dfe1eb2 100644 --- a/src/hmi/qml/Core/genivi-capi.js +++ b/src/hmi/qml/Core/genivi-capi.js @@ -247,14 +247,28 @@ function distance(meter) } } -// Give the formated time +// Give the formated duration +function duration(seconds) +{ + if (seconds >= 3600) { + return Math.floor(seconds/3600)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); + } else { + return Math.floor(seconds/60)+":"+(seconds%60); + } +} + +// 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) { - if (seconds >= 3600) { - return Math.floor(seconds/3600)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); - } else { - return Math.floor(seconds/60)+":"+(seconds%60); - } + 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); + } else { + return Math.floor(seconds/60)+":"+(seconds%60); + } } // Keyboard parameters diff --git a/src/hmi/qml/Core/genivi-origin.js b/src/hmi/qml/Core/genivi-origin.js index 268c5af..be3192e 100644 --- a/src/hmi/qml/Core/genivi-origin.js +++ b/src/hmi/qml/Core/genivi-origin.js @@ -247,14 +247,28 @@ function distance(meter) } } -// Give the formated time +// Give the formated duration +function duration(seconds) +{ + if (seconds >= 3600) { + return Math.floor(seconds/3600)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); + } else { + return Math.floor(seconds/60)+":"+(seconds%60); + } +} + +// 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) { - if (seconds >= 3600) { - return Math.floor(seconds/3600)+":"+(Math.floor(seconds/60)%60)+":"+(seconds%60); - } else { - return Math.floor(seconds/60)+":"+(seconds%60); - } + 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); + } else { + return Math.floor(seconds/60)+":"+(seconds%60); + } } // Keyboard parameters diff --git a/src/hmi/qml/NavigationAppBrowseMap.qml b/src/hmi/qml/NavigationAppBrowseMap.qml index f4013ca..6bc35e5 100644 --- a/src/hmi/qml/NavigationAppBrowseMap.qml +++ b/src/hmi/qml/NavigationAppBrowseMap.qml @@ -154,8 +154,9 @@ NavigationAppHMIMenu { function guidanceWaypointReached(args) { Genivi.hookSignal(dltIf,"guidanceWaypointReached"); - if (args[2]) { - // "Destination reached" TBD + if (args[1]) { + // "Destination reached" + stopGuidance(); } else { // "Waypoint reached" TBD } @@ -704,7 +705,10 @@ NavigationAppHMIMenu { var res1=Genivi.guidance_GetDestinationInformation(dbusIf,dltIf); distancetodestinationValue.text = Genivi.distance(res1[1]); - timetodestinationValue.text = Genivi.time(res1[3]); + 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); updateAddress(); } @@ -712,6 +716,7 @@ NavigationAppHMIMenu { function stopGuidance() { Genivi.guidance_StopGuidance(dbusIf,dltIf); + Genivi.mapviewer_HideRoute(dbusIf,dltIf,Genivi.g_routing_handle); } function startGuidance() @@ -841,7 +846,7 @@ NavigationAppHMIMenu { maneuverList.disabled=false; roadaftermaneuverValue.visible=true; distancetodestinationValue.visible=true; - timetodestinationValue.visible=true; + timeofarrivalValue.visible=true; } function hideRoutePanel() @@ -850,7 +855,7 @@ NavigationAppHMIMenu { maneuverList.disabled=true; roadaftermaneuverValue.visible=false; distancetodestinationValue.visible=false; - timetodestinationValue.visible=false; + timeofarrivalValue.visible=false; } function showScrollPanel() @@ -1108,11 +1113,11 @@ NavigationAppHMIMenu { } } Text { - x:StyleSheetBrowseMapRoute.timetodestinationValue[Constants.X]; y:StyleSheetBrowseMapRoute.timetodestinationValue[Constants.Y]; width:StyleSheetBrowseMapRoute.timetodestinationValue[Constants.WIDTH]; height:StyleSheetBrowseMapRoute.timetodestinationValue[Constants.HEIGHT];color:StyleSheetBrowseMapRoute.timetodestinationValue[Constants.TEXTCOLOR];styleColor:StyleSheetBrowseMapRoute.timetodestinationValue[Constants.STYLECOLOR]; font.pixelSize:StyleSheetBrowseMapRoute.timetodestinationValue[Constants.PIXELSIZE]; + x:StyleSheetBrowseMapRoute.timeofarrivalValue[Constants.X]; y:StyleSheetBrowseMapRoute.timeofarrivalValue[Constants.Y]; width:StyleSheetBrowseMapRoute.timeofarrivalValue[Constants.WIDTH]; height:StyleSheetBrowseMapRoute.timeofarrivalValue[Constants.HEIGHT];color:StyleSheetBrowseMapRoute.timeofarrivalValue[Constants.TEXTCOLOR];styleColor:StyleSheetBrowseMapRoute.timeofarrivalValue[Constants.STYLECOLOR]; font.pixelSize:StyleSheetBrowseMapRoute.timeofarrivalValue[Constants.PIXELSIZE]; visible: true style: Text.Sunken; smooth: true - id:timetodestinationValue + id:timeofarrivalValue text: "-------" } Text { @@ -1605,7 +1610,7 @@ NavigationAppHMIMenu { text: Genivi.gettext("Restart") disabled: (Genivi.guidance_activated || !Genivi.route_calculated); onPressed: { - //restart guidance + //restart guidance (the route is displayed when the menu is reloaded due to guidance status changed) startGuidance(); } } @@ -1617,6 +1622,7 @@ NavigationAppHMIMenu { onPressed: { //stop guidance Genivi.guidance_StopGuidance(dbusIf,dltIf); + Genivi.mapviewer_HideRoute(dbusIf,dltIf,Genivi.g_routing_handle); } } StdButton { diff --git a/src/hmi/qml/NavigationAppSearch.qml b/src/hmi/qml/NavigationAppSearch.qml index 051cf5f..9541844 100644 --- a/src/hmi/qml/NavigationAppSearch.qml +++ b/src/hmi/qml/NavigationAppSearch.qml @@ -699,7 +699,7 @@ NavigationAppHMIMenu { } distanceValue.text =Genivi.distance(distance); - timeValue.text= Genivi.time(time); + timeValue.text= Genivi.duration(time); } function showRoutePanel() diff --git a/src/set_window_location b/src/set_window_location index 9da8e87..d43fd1b 100755 --- a/src/set_window_location +++ b/src/set_window_location @@ -6,14 +6,11 @@ function get_window_id() window_id=$(wmctrl -l | grep "$1" | tail -1 | cut -f1 -d" ") } -get_window_id "hmi-launcher" +get_window_id "fsa" wmctrl -i -r "$window_id" -e 0,100,100,800,480 get_window_id "navit" wmctrl -i -r "$window_id" -e 0,100,72,800,480 -wmctrl -a "hmi-launcher" - -get_window_id "Simulation dashboard" -wmctrl -i -r "$window_id" -e 0,100,600,800,480 +wmctrl -a "fsa" diff --git a/src/update_navit.sh b/src/update_navit.sh new file mode 100755 index 0000000..7e85cad --- /dev/null +++ b/src/update_navit.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ $# -eq 0 ] + then + echo "Need navit commit version" + exit +fi + +navit_version=$1 + + +rm -rf build/navigation/navit +rm -rf navigation/src/navigation/navit + +cd navigation/src/navigation +git clone https://github.com/navit-gps/navit.git +cd navit +git checkout $navit_version +patch -p0 -i ../patches/search_list_get_unique.diff +patch -p0 -i ../patches/fsa_issue_padding.diff +cd ../../../../ + + diff --git a/src/update_positioning.sh b/src/update_positioning.sh new file mode 100755 index 0000000..d84d006 --- /dev/null +++ b/src/update_positioning.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +if [ $# -eq 0 ] + then + echo "Need positioning commit version" + exit +fi + +positioning_version=$1 + +if [ -d "./build" ] +then + find ./build/navigation/positioning ! -name '*.cbp' -type f -exec rm -f {} + +fi + +rm -rf navigation/src/navigation/positioning + +cd navigation/src/navigation + +git clone https://github.com/GENIVI/positioning.git ./positioning +cd positioning +git checkout $positioning_version +cd ../../../../ + + diff --git a/src/update_third_party.sh b/src/update_third_party.sh index 4e9cfde..d21b3d4 100755 --- a/src/update_third_party.sh +++ b/src/update_third_party.sh @@ -1,58 +1,18 @@ #!/bin/bash -navigation=0 -navit=0 -navigation_version='14e7e553b2391915b50b2b990bf0d5a959fd5d01' +navigation_version='faed34d71ab44536cc077a6a6edf9e6903e40c1f' positioning_version='9725fe1f553197042d6445997690d452a73490c0' -navit_version='1e71b5fd4c0bf5ac96e5207c51db7d17057ed798' - -if [ $# -lt 1 ] ; then - echo "Argument required, please enter -h " - exit 1 -fi - -while getopts a:hn:d opt -do - case $opt in - a) - navigation=1 - navigation_version=$OPTARG - ;; - n) - navit=1 - navit_version=$OPTARG - ;; - d) - navigation=1 - navit=1 - ;; - h) - echo "Usage:" - echo "$0 [-ahnd]" - echo "-a <navigation version>: clean and load this version of navigation " - echo "-h: Help" - echo "-n <navit version>: clean and load this version of navit " - echo "-d clean and load all with default version " - exit 1 - esac -done +navit_version='28478e7f26c1a0eedc06fb4765e2f736079c6f0c' echo "version of navigation is: $navigation_version" echo "version of positioning is: $positioning_version" echo "version of navit is: $navit_version" -echo "This script deletes and reloads third party software" -echo -n "So rebuild will be necessary, are you sure ? (y or n) " -read input +echo "This script deletes and reloads all the third party software" +read -r -p "Are you sure ? [y/N] " input -if [ "$input" != 'y' ] -then - exit 1 -fi - -if [ "$navigation" = 1 ] -then - #it's needed to reload everything +case "$input" in + [y/Y]) rm -rf navigation git clone https://github.com/GENIVI/navigation.git ./navigation cd navigation @@ -68,20 +28,13 @@ then patch -p0 -i ../patches/search_list_get_unique.diff patch -p0 -i ../patches/fsa_issue_padding.diff cd ../ + echo "Please rebuild with at least -c -n option" + ;; + *) + exit 1 + ;; +esac -else - if [ "$navit" = 1 ] - then - #reload navit - cd navigation/src/navigation - git clone https://github.com/navit-gps/navit.git - cd navit - git checkout $navit_version - patch -p0 -i ../patches/search_list_get_unique.diff - patch -p0 -i ../patches/fsa_issue_padding.diff - cd ../../../../ - fi -fi diff --git a/test/bugList.ods b/test/bugList.ods Binary files differnew file mode 100644 index 0000000..05e71e5 --- /dev/null +++ b/test/bugList.ods diff --git a/test/log/test-route-calculation.pdf b/test/log/test-route-calculation.pdf Binary files differnew file mode 100644 index 0000000..cee2d81 --- /dev/null +++ b/test/log/test-route-calculation.pdf |