From aa65e80c3bd4f69fe0344db7beec9c2af64be9e7 Mon Sep 17 00:00:00 2001 From: Date: Tue, 1 Sep 2015 16:57:04 +0200 Subject: align the navit version to 6135, fix the run script --- src/navigation/README | 2 +- src/navigation/patches/search_list_get_unique.diff | 30 +++++++++++----------- src/navigation/run | 25 +++++++++++++++--- test/navigation/test-route-calculation.py | 3 ++- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/navigation/README b/src/navigation/README index fa03e73..d63e832 100644 --- a/src/navigation/README +++ b/src/navigation/README @@ -29,7 +29,7 @@ Ubuntu 14.04 LTS Current versions of additional code =============================== (git): 8bcb5aee2172bf1672b4402a2dbae480d5fbdc25 - (svn): 6084 + (svn): 6135 =============================== How to get additional code diff --git a/src/navigation/patches/search_list_get_unique.diff b/src/navigation/patches/search_list_get_unique.diff index 7aae776..e315c78 100644 --- a/src/navigation/patches/search_list_get_unique.diff +++ b/src/navigation/patches/search_list_get_unique.diff @@ -13,10 +13,10 @@ Index: navit/navit/search.c +static char * +search_list_get_unique_truncate(char *common, char *result) +{ -+ dbg(1,"%s vs %s\n",common,result); ++ dbg(lvl_debug,"%s vs %s\n",common,result); + while (*common) { + if (g_utf8_get_char(common) != g_utf8_get_char(result)) { -+ dbg(1,"truncating at %s vs %s\n",common,result); ++ dbg(lvl_debug,"truncating at %s vs %s\n",common,result); + return common; + } + result=g_utf8_next_char(result); @@ -60,7 +60,7 @@ Index: navit/navit/search.c + int i,count=sizeof(strings)/sizeof(char *); + GList *l; + -+ //dbg(0,"enter level=%d %s %s\n",level,search,unique); ++ //dbg(lvl_debug,"enter level=%d %s %s\n",level,search,unique); + l=le->list; + while (l) { + switch (level) { @@ -90,30 +90,30 @@ Index: navit/navit/search.c + strings[i]=linguistics_expand_special(name, i); + break; + default: -+ dbg(0,"entry\n"); ++ dbg(lvl_warning,"entry\n"); + } -+ dbg(1,"entry %s %s %s %s\n",strings[0],strings[1],strings[2],strings[3]); ++ dbg(lvl_debug,"entry %s %s %s %s\n",strings[0],strings[1],strings[2],strings[3]); + max=NULL; + for (i = 0 ; i < count ; i++) { + char *str=strings[i]; + while (str) { + char *strf=g_utf8_casefold(str,-1); -+ dbg(1,"word %s\n",strf); ++ dbg(lvl_debug,"word %s\n",strf); + if (!strncmp(strf, search, search_len)) { -+ dbg(1,"match\n"); ++ dbg(lvl_debug,"match\n"); + if (unique) { -+ dbg(1,"possible next %s %s ret %s\n",strf+search_len,str+search_len,ret); ++ dbg(lvl_debug,"possible next %s %s ret %s\n",strf+search_len,str+search_len,ret); + ret=search_list_get_unique_append(ret, strf+search_len); + ret=search_list_get_unique_append(ret, str+search_len); -+ dbg(1,"ret now %s\n",ret); ++ dbg(lvl_debug,"ret now %s\n",ret); + } else { + if (!ret) { + ret=g_strdup(str); + retf=g_utf8_casefold(ret,-1); -+ dbg(1,"ret now %s\n",ret); ++ dbg(lvl_debug,"ret now %s\n",ret); + } else { + char *end=search_list_get_unique_truncate(retf,strf); -+ dbg(1,"%d characters\n",end-retf); ++ dbg(lvl_debug,"%d characters\n",end-retf); + if (!max || max < end) + max=end; + } @@ -126,18 +126,18 @@ Index: navit/navit/search.c + } + if (!unique) { + if (max) { -+ dbg(1,"max %s (%d characters)\n",max,max-retf); ++ dbg(lvl_debug,"max %s (%d characters)\n",max,max-retf); + ret[max-retf]='\0'; + } else { -+ dbg(1,"new max\n"); ++ dbg(lvl_debug,"new max\n"); + } + } -+ dbg(1,"common %s\n",ret); ++ dbg(lvl_debug,"common %s\n",ret); + l=g_list_next(l); + } + g_free(search); + g_free(retf); -+ //dbg(0,"return %s\n",ret); ++ //dbg(lvl_debug,"return %s\n",ret); + return ret; +} + diff --git a/src/navigation/run b/src/navigation/run index 556d5cd..1f80483 100755 --- a/src/navigation/run +++ b/src/navigation/run @@ -87,6 +87,7 @@ xterm=0 log=0 enhpos=1 replayer=1 +verbose=0 #no debug or log messages displayed center="4612 N 0608 E" CUR_DIR=$PWD @@ -95,7 +96,7 @@ SRC_DIR=$PWD LOGREPLAYER_LOGS_DIR=$SRC_DIR/positioning/log-replayer/logs NAVIT_BIN_DIR=$CUR_DIR/build/navit/navit/navit/ -while getopts c:gnorx opt +while getopts c:gnorvx opt do case $opt in c) @@ -127,17 +128,21 @@ do r) replayer=0 ;; + v) #enable log messages + verbose=1 + ;; x) xterm=1 ;; \?) echo "Usage:" - echo "$0 [-c center][-gnorx]" + echo "$0 [-c center][-gnorvx]" echo "-c: Set center (supported values: paris,tokyo,longitude,latitude). Default is geneve" echo "-g: Run subprocesses within gdb (only with -x)" echo "-n: Don't start enhanced-position-service" echo "-r: Don't start replayer" echo "-o: Create log file of subprocess output" + echo "-v: Enable the output debug messages" echo "-x: Run subprocesses in own xterm to get separated log messages" exit 1 esac @@ -167,12 +172,24 @@ cd $NAVIT_BIN_DIR >bookmark.txt echo "$center" >center.txt -run MapViewer ./navit navit_genivi_mapviewer.xml +if [ "$verbose" = "1" ] +then + run MapViewer ./navit -d 3 -c navit_genivi_mapviewer.xml +else + run MapViewer ./navit -d 0 -c navit_genivi_mapviewer.xml +fi + wait_for_service org.genivi.mapviewer.Configuration /org/genivi/mapviewer wait_for_service org.genivi.mapviewer.MapViewerControl /org/genivi/mapviewer wait_for_service org.genivi.mapviewer.Session /org/genivi/mapviewer -run NavigationCore ./navit navit_genivi_navigationcore.xml +if [ "$verbose" = "1" ] +then + run NavigationCore ./navit -d 3 -c navit_genivi_navigationcore.xml +else + run NavigationCore ./navit -d 0 -c navit_genivi_navigationcore.xml +fi + wait_for_service org.genivi.navigationcore.Configuration /org/genivi/navigationcore wait_for_service org.genivi.navigationcore.Guidance /org/genivi/navigationcore wait_for_service org.genivi.navigationcore.LocationInput /org/genivi/navigationcore diff --git a/test/navigation/test-route-calculation.py b/test/navigation/test-route-calculation.py index f26c31c..12b02b9 100755 --- a/test/navigation/test-route-calculation.py +++ b/test/navigation/test-route-calculation.py @@ -35,6 +35,7 @@ import dbus.mainloop.glib LATITUDE = 0x00a0 LONGITUDE = 0x00a1 TOTAL_DISTANCE = 0x018f +TIME_OUT = 10000 print '\n--------------------------' print 'Route Calculation Test' @@ -111,7 +112,7 @@ routing_interface.SetWaypoints(dbus.UInt32(sessionhandle), \ routing_interface.CalculateRoute(dbus.UInt32(sessionhandle),dbus.UInt32(routehandle)) #main loop -gobject.timeout_add(5000, timeout) +gobject.timeout_add(TIME_OUT, timeout) loop = gobject.MainLoop() loop.run() -- cgit v1.2.1