From 5cd44f75e3380d87010780d8e6d4877bcdcfdcad Mon Sep 17 00:00:00 2001 From: Date: Tue, 17 Mar 2015 10:31:10 +0100 Subject: Add patch to fix ksvg2png issue --- .gitignore | 4 +- src/navigation/README | 34 +++-- .../genivi_navigationcore_locationinput.cxx | 7 +- .../patches/ksvg2png_remove_output_param.diff | 13 ++ src/navigation/patches/search_list_get_unique.diff | 143 +++++++++++++++++++++ src/navigation/script/README | 62 ++++++++- 6 files changed, 245 insertions(+), 18 deletions(-) create mode 100644 src/navigation/patches/ksvg2png_remove_output_param.diff create mode 100644 src/navigation/patches/search_list_get_unique.diff diff --git a/.gitignore b/.gitignore index 4bdaf60..e4fc485 100644 --- a/.gitignore +++ b/.gitignore @@ -9,10 +9,10 @@ positioning/ #files *~ *.pro.user -*.txt.user +*.txt.user* /.project CMakeFiles/ CMakeCache.txt -*.cmake +cmake_install.cmake src-gen diff --git a/src/navigation/README b/src/navigation/README index 3d967d1..3fd0427 100644 --- a/src/navigation/README +++ b/src/navigation/README @@ -1,4 +1,4 @@ -Release date of the file: 5-02-2015 +Release date of the file: 17-03-2015 Status: OK Project: @@ -10,7 +10,7 @@ The GENIVI APIs are implemented into navit plugins, running on DBus. The HMI is See also other navigation projects like proof of concepts implemented for poi-service, traffic-info and positioning What is in: -This folder contains scripts for building Navit and the GENIVI plugins. It runs only the navigation middleware (without the HMI) +This folder contains the code for building Navit and the GENIVI plugins. It runs only the navigation middleware (without the HMI) FYI: the application (with the HMI) is located into git://git.projects.genivi.org/lbs/navigation-application.git it's possible to build and run the whole stuff directly from that repository @@ -30,12 +30,30 @@ git clone http://git.projects.genivi.org/lbs/navigation-service.git $WORKING-DIR NB: potential issue may occur due to path change of freetype stuff. If necessary, add a link to /usr/include/freetype2/ into /usr/include +Folders: +The code is shared between: +map-viewer/ +the plugins for the map rendering and manipulation (zoom, scroll..) +navigation-core/ +the plugins for basic navigation features (location input, route calculation...) +poi-cam/ +the plugins for poi content access module +patches/ +some patches to complete the navit code + +After cloning the additional code and building it, some folders will be added: +bin/ +the built code +ilm/ +the code of layer manager (not tested) +map/ +the map +navit/ +basic code of navit +positioning/ +the code of positioning + Build scripts (cmake based) are located into: cd $WORKING-DIR/navigation-service/src/navigation/script -./build.sh clone -./build.sh make - -./run - -See the README into the script dir for further explanations +See the README into the script dir for further explanations about how to build and run the code diff --git a/src/navigation/navigation-core/locationinput-plugin/genivi_navigationcore_locationinput.cxx b/src/navigation/navigation-core/locationinput-plugin/genivi_navigationcore_locationinput.cxx index 3afbd56..77984f0 100644 --- a/src/navigation/navigation-core/locationinput-plugin/genivi_navigationcore_locationinput.cxx +++ b/src/navigation/navigation-core/locationinput-plugin/genivi_navigationcore_locationinput.cxx @@ -434,12 +434,13 @@ LocationInputObj::Idle(void) } count++; } - if (m_spell) { + // the search_list_get_unique has been removed from the svn in the r5549, so navit needs to be patched for upper versions + if (m_spell) { char *unique; if (m_spell_backspace) unique=g_strdup(m_search.u.str); else - unique=search_list_get_unique(m_sl, NULL); + unique=search_list_get_unique(m_sl, NULL); m_spell_backspace=false; if (unique) { g_free(m_search.u.str); @@ -452,7 +453,7 @@ LocationInputObj::Idle(void) } else m_locationinput->SpellResult(m_handle, "", "\b", false); - } + } for (int i = 0 ; i <= chunk ; i++) { uint16_t window=m_data[i].size(); if (window != 0 || i == 0) diff --git a/src/navigation/patches/ksvg2png_remove_output_param.diff b/src/navigation/patches/ksvg2png_remove_output_param.diff new file mode 100644 index 0000000..ff99fbc --- /dev/null +++ b/src/navigation/patches/ksvg2png_remove_output_param.diff @@ -0,0 +1,13 @@ +Index: navit/navit/xpm/CMakeLists.txt +=================================================================== +--- navit/navit/xpm/CMakeLists.txt (revision 5532) ++++ navit/navit/xpm/CMakeLists.txt (working copy) +@@ -22,7 +22,7 @@ + file(STRINGS ${IMAGE_INPUT} NEW_SCALE_LINE REGEX "[^-]width=\"[0-9pxt.]*\"") + string(REGEX REPLACE ".*width=\"([0-9]*).*" "\\1" NEW_SCALE ${NEW_SCALE_LINE}) + endif() +- set(COMMAND_ARGS ${NEW_SCALE} ${NEW_SCALE} ${IMAGE_INPUT} --output ${IMAGE_OUTPUT}) ++ set(COMMAND_ARGS ${NEW_SCALE} ${NEW_SCALE} ${IMAGE_INPUT} ${IMAGE_OUTPUT}) + elseif(${IMAGE_CONVERTER_${FILE_TYPE}} MATCHES "inkscape") + if (${SCALE} GREATER 0) + set(SCALE_ARGS --export-width=${SCALE} --export-height=${SCALE}) diff --git a/src/navigation/patches/search_list_get_unique.diff b/src/navigation/patches/search_list_get_unique.diff new file mode 100644 index 0000000..650c481 --- /dev/null +++ b/src/navigation/patches/search_list_get_unique.diff @@ -0,0 +1,143 @@ +Index: navit/navit/search.c +=================================================================== +--- navit/navit/search.c (revision 5827) ++++ navit/navit/search.c (working copy) +@@ -1043,3 +1043,138 @@ + search_init(void) + { + } ++ ++// The following code has been removed into the release 5549 ++// It's used by the Spell function of location input ++// So a patch is necessary ++static char * ++search_list_get_unique_truncate(char *common, char *result) ++{ ++ dbg(1,"%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); ++ return common; ++ } ++ result=g_utf8_next_char(result); ++ common=g_utf8_next_char(common); ++ } ++ return common; ++} ++ ++static char * ++search_list_get_unique_append(char *list, char *append) ++{ ++ char *c=list; ++ int llen=list?strlen(list):0; ++ int len=g_utf8_next_char(append)-append; ++ gunichar a=g_utf8_get_char(append); ++ while(c && *c) { ++ if (g_utf8_get_char(c) == a) ++ return list; ++ c=g_utf8_next_char(c); ++ } ++ list=g_renew(char, list, llen+len+1); ++ strncpy(list+llen,append,len); ++ list[llen+len]='\0'; ++ return list; ++} ++ ++char * ++search_list_get_unique(struct search_list *this_, char *unique) ++{ ++ int level=this_->level; ++ struct search_list_level *le=&this_->levels[level]; ++ struct search_list_country *slc; ++ struct search_list_town *slt; ++ struct search_list_street *sls; ++ struct search_list_house_number *slh; ++ char *retf=NULL,*ret=NULL; ++ char *strings[4]={NULL,}; ++ char *search=g_utf8_casefold(unique?unique:le->attr->u.str,-1); ++ char *name,*max; ++ int search_len=strlen(search); ++ int i,count=sizeof(strings)/sizeof(char *); ++ GList *l; ++ ++ //dbg(0,"enter level=%d %s %s\n",level,search,unique); ++ l=le->list; ++ while (l) { ++ switch (level) { ++ case 0: ++ slc=l->data; ++ strings[0]=g_strdup(slc->name); ++ strings[1]=g_strdup(slc->car); ++ strings[2]=g_strdup(slc->iso2); ++ strings[3]=g_strdup(slc->iso3); ++ break; ++ case 1: ++ slt=l->data; ++ name=slt->common.town_name; ++ for (i = 0 ; i < 3 ; i++) ++ strings[i]=linguistics_expand_special(name, i); ++ break; ++ case 2: ++ sls=l->data; ++ name=sls->name; ++ for (i = 0 ; i < 3 ; i++) ++ strings[i]=linguistics_expand_special(name, i); ++ break; ++ case 3: ++ slh=l->data; ++ name=slh->house_number; ++ for (i = 0 ; i < 3 ; i++) ++ strings[i]=linguistics_expand_special(name, i); ++ break; ++ default: ++ dbg(0,"entry\n"); ++ } ++ dbg(1,"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); ++ if (!strncmp(strf, search, search_len)) { ++ dbg(1,"match\n"); ++ if (unique) { ++ dbg(1,"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); ++ } else { ++ if (!ret) { ++ ret=g_strdup(str); ++ retf=g_utf8_casefold(ret,-1); ++ dbg(1,"ret now %s\n",ret); ++ } else { ++ char *end=search_list_get_unique_truncate(retf,strf); ++ dbg(1,"%d characters\n",end-retf); ++ if (!max || max < end) ++ max=end; ++ } ++ } ++ } ++ g_free(strf); ++ str=linguistics_next_word(str); ++ } ++ g_free(strings[i]); ++ } ++ if (!unique) { ++ if (max) { ++ dbg(1,"max %s (%d characters)\n",max,max-retf); ++ ret[max-retf]='\0'; ++ } else { ++ dbg(1,"new max\n"); ++ } ++ } ++ dbg(1,"common %s\n",ret); ++ l=g_list_next(l); ++ } ++ g_free(search); ++ g_free(retf); ++ //dbg(0,"return %s\n",ret); ++ return ret; ++} ++ diff --git a/src/navigation/script/README b/src/navigation/script/README index f422ed2..daba0a8 100644 --- a/src/navigation/script/README +++ b/src/navigation/script/README @@ -1,14 +1,60 @@ -For using the layer manager, you need to set the env variable and the paths: -source set-ilm-env.sh +Release date of the file: 17-03-2015 +Status: OK + +Project: +Navigation software based on Navit and compliant with the Navigation APIs standardized by the GENIVI Alliance +This project is one of the navigation-service common projects that implements the GENIVI navigation APIs. + +More: +The GENIVI APIs are implemented into navit plugins, running on DBus. The HMI is made in Qml +See also other navigation projects like proof of concepts implemented for poi-service, traffic-info and positioning + +What is in: +This folder contains scripts for building Navit and the GENIVI plugins. It runs only the navigation middleware (without the HMI) +FYI: the application (with the HMI) is located into git://git.projects.genivi.org/lbs/navigation-application.git + it's possible to build and run the whole stuff directly from that repository + +Author: +Martin Schaller +Philippe Colliot philippe.colliot@mpsa.com +Marco Residori marco.residori@xse.de + +License: +See headers and LICENSE file + +Test target: +Ubuntu 14.04 LTS + +To build the code: To build the navigation middleware you need first to clone some additional stuff: ./build.sh clone -To build without the layer manager: +So, build it: ./build.sh make -To build with the layer manager: -./build.sh makelm +And run: +./run + +Issues with Navit: +The current version of Navit used by the code is the r5532. It's an already old version (but the POC runs with it). + +Upgrade is under progress, with some issues listed below: + +Note 1: There's an issue with the latest version of ksvg2png, that doesn't requires --output into the command line +It's a problem because the png are not correctly generated. +So, please apply the patch +patch -p0 -i ../patches/ksvg2png_remove_output_param.diff +The issue is fixed by the r5827 + +Note 2: Issues during upgrade +r5549 removed the get_unique features used by GetSpell +So, please apply the patch +patch -p0 -i ../patches/search_list_get_unique.diff +r5822 removed the attribute distance_metric, it's fixed by the r5898 + +r5970 Test route calculation is OK, but stability problems when testing the full FSA stuff, to be investigated + CMakeLists.txt organization: @@ -18,3 +64,9 @@ To get the map src/navigation/map/CMakeLists.txt +For using the layer manager, you need to set the env variable and the paths: +source set-ilm-env.sh + +To build with the layer manager: +./build.sh makelm + -- cgit v1.2.1