diff options
author | asanoaozora <fifitaneki@hotmail.com> | 2017-03-02 11:14:57 +0100 |
---|---|---|
committer | asanoaozora <fifitaneki@hotmail.com> | 2017-03-02 11:14:57 +0100 |
commit | 07095c495f1c088522e103846448651249d4c324 (patch) | |
tree | 114f7cd1041a07873909b2c4531174086455aabf /src/navigation | |
parent | 292d2ab9d3a9ded69f0135e23ace632fa9021d80 (diff) | |
download | poi-service-07095c495f1c088522e103846448651249d4c324.tar.gz |
fix a bug for GDP version, add test for Tokyo area
Diffstat (limited to 'src/navigation')
3 files changed, 47 insertions, 97 deletions
diff --git a/src/navigation/README.md b/src/navigation/README.md index dec2bb1..47270a0 100644 --- a/src/navigation/README.md +++ b/src/navigation/README.md @@ -40,18 +40,24 @@ sudo apt-get install python-pip python-dbus python-gobject python-pil sudo pip install --upgrade pip To test, launch the navigation middleware by entering: -./run -r -'bug safe' test files (can be launched several times): -./test-location-input.py -l location.xml -./test-route-calculation.py -r route.xml -'bug to be fixed' test files (can be launched only one time): -./test-guidance.py -r route.xml -./test-map-viewer-control.py +../../src/navigation/run -r +and the test batch: +./test-all If everything is OK, you must see: Test PASSED +### How to test for Tokyo area (draft) +It's also possible to launch test for Japan. +Before testing it's necessary to get the map by picking it from this site: +http://maps9.navit-project.org/api/map/?bbox=139.1,35.5,140.4,36.0×tamp=170217 +Rename the file to tokyo.bin, copy it to ./map and do ./build.sh -c +To test, launch the navigation middleware by entering: +../../src/navigation/run -r -c tokyo +and the test batch: +./test-all_tokyo + ##Directory Structure map-viewer/ diff --git a/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx b/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx index a591cfb..726503a 100644 --- a/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx +++ b/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx @@ -30,7 +30,6 @@ #if LM #include <ilm/ilm_client.h> -#include <ilm/ilm_client.h> #include <ilm/ilm_control.h> //Align with Qt Surfaces = 8000 + Layer. #ifndef FSA_SURFACE @@ -1431,7 +1430,6 @@ MapViewerControlObj::ConvertGeoCoordsToPixelCoords(uint32_t sessionHandle, const static void callbackFunction(ilmObjectType object, t_ilm_uint surfaceId, t_ilm_bool created, void *user_data) { (void)user_data; - struct ilmSurfaceProperties sp; t_ilm_int pLength = 0; t_ilm_layer* ppArray = NULL; @@ -1441,53 +1439,27 @@ static void callbackFunction(ilmObjectType object, t_ilm_uint surfaceId, t_ilm_b if (object == ILM_SURFACE) { if (created) { if (surfaceId == FSA_SURFACE) { - //Configure map surface - if (ilm_getPropertiesOfSurface(surfaceId, &sp) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_getPropertiesOfSurface\n"); - } - if (ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, sp.origSourceWidth, sp.origSourceHeight) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_surfaceSetSourceRectangle\n"); - } + //Timing issue for creation - Need to add tempo + sleep(1); - //RenderOrder with the hmi-launcher Qt surface - /* - * ilm_getLayerIDsOnScreen will give the layer attached - * to the hmi-launcher Qt surface following hmi-launcher Qt surface - */ - if (ilm_getLayerIDsOnScreen(0, &pLength, &ppArray) != ILM_SUCCESS) { - dbg(lvl_error, "error on ilm_getLayerIDsOnScreen\n"); + //Grab all the layers - HMI will be pLength-2 and FSA pLength-1 + if (ilm_getLayerIDs(&pLength, &ppArray) != ILM_SUCCESS) { + fprintf(stderr, "error on ilm_getLayerIDs\n"); } - /* The last one is the hmi-launcher layer and thus surface. - * Then hmi-launcher surface toped the map surface into the hmi-launcher layer. - */ - renderOrder[1] = SURFACE_OFFSET + ppArray[pLength - 1]; + renderOrder[1] = SURFACE_OFFSET + ppArray[pLength - 2]; renderOrder[0] = FSA_SURFACE; if (ilm_layerSetRenderOrder(ppArray[pLength - 1],renderOrder,2) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_layerSetRenderOrder\n"); - } - - //Put the map at the same resolution as the hmi-launcher - if (ilm_getPropertiesOfSurface(SURFACE_OFFSET + ppArray[pLength - 1], &pSurfaceProperties) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_getPropertiesOfSurface\n"); - } - - if (ilm_surfaceSetDestinationRectangle(surfaceId, pSurfaceProperties.destX, pSurfaceProperties.destY, - pSurfaceProperties.destWidth, pSurfaceProperties.destHeight) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_surfaceSetDestinationRectangle\n"); - } - - if (ilm_surfaceSetVisibility(surfaceId, ILM_TRUE) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_surfaceSetVisibility\n"); + fprintf(stderr,"error on ilm_layerSetRenderOrder\n"); } if (ilm_commitChanges() != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_commitChanges\n"); + fprintf(stderr,"error on ilm_commitChanges\n"); } } - } + } } } #endif @@ -1575,7 +1547,7 @@ MapViewerControlObj::MapViewerControlObj(MapViewerControl *mapviewercontrol, uin t_ilm_nativedisplay display = (t_ilm_nativedisplay)graphics_get_data(m_graphics.u.graphics, "display"); if (ilmClient_init(display) != ILM_SUCCESS) { - dbg(lvl_error, "error on ilm_initWidthNativeDisplay\n"); + fprintf(stderr, "error on ilm_initWidthNativeDisplay\n"); } t_ilm_nativehandle nativehandle=(t_ilm_nativehandle)graphics_get_data(m_graphics.u.graphics,"xwindow_id"); @@ -1583,17 +1555,17 @@ MapViewerControlObj::MapViewerControlObj(MapViewerControl *mapviewercontrol, uin //Register Notification if (ilm_registerNotification(callbackFunction, NULL) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_registerNotification\n"); + fprintf(stderr,"error on ilm_registerNotification\n"); } - //Create surface for the map and add notification when created + //Create surface for the map and add notification when created. Note: width, heigh & pixel format are not taking in count at the end. if (ilm_surfaceCreate(nativehandle, MapViewSize._1, MapViewSize._2, ILM_PIXELFORMAT_RGBA_8888, &surfaceId) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_surfaceCreate\n"); + fprintf(stderr,"error on ilm_surfaceCreate\n"); } //Commit all changes if (ilm_commitChanges() != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_commitChanges\n"); + fprintf(stderr,"error on ilm_commitChanges\n"); } #endif @@ -1605,11 +1577,11 @@ MapViewerControlObj::~MapViewerControlObj() t_ilm_surface surfaceId=FSA_SURFACE; if (ilm_surfaceRemove(surfaceId) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_surfaceRemove\n"); + fprintf(stderr,"error on ilm_surfaceRemove\n"); } if (ilm_commitChanges() != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_commitChanges\n"); + fprintf(stderr,"error on ilm_commitChanges\n"); } #endif @@ -1784,7 +1756,7 @@ plugin_init(void) #if LM if (ilm_init() != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_init\n"); + fprintf(stderr,"error on ilm_init\n"); } #endif } diff --git a/src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx b/src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx index 62a7b0f..c5a3a00 100644 --- a/src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx +++ b/src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx @@ -29,7 +29,6 @@ #include <stdlib.h> #if LM #include <ilm/ilm_client.h> -#include <ilm/ilm_client.h> #include <ilm/ilm_control.h> //Align with Qt Surfaces = 8000 + Layer. #ifndef FSA_SURFACE @@ -1581,7 +1580,6 @@ MapViewerControlObj::ConvertGeoCoordsToPixelCoords(NavigationTypes::Handle Sessi static void callbackFunction(ilmObjectType object, t_ilm_uint surfaceId, t_ilm_bool created, void *user_data) { (void)user_data; - struct ilmSurfaceProperties sp; t_ilm_int pLength = 0; t_ilm_layer* ppArray = NULL; @@ -1591,53 +1589,27 @@ static void callbackFunction(ilmObjectType object, t_ilm_uint surfaceId, t_ilm_b if (object == ILM_SURFACE) { if (created) { if (surfaceId == FSA_SURFACE) { - //Configure map surface - if (ilm_getPropertiesOfSurface(surfaceId, &sp) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_getPropertiesOfSurface\n"); - } - if (ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, sp.origSourceWidth, sp.origSourceHeight) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_surfaceSetSourceRectangle\n"); - } + //Timing issue for creation - Need to add tempo + sleep(1); - //RenderOrder with the hmi-launcher Qt surface - /* - * ilm_getLayerIDsOnScreen will give the layer attached - * to the hmi-launcher Qt surface following hmi-launcher Qt surface - */ - if (ilm_getLayerIDsOnScreen(0, &pLength, &ppArray) != ILM_SUCCESS) { - dbg(lvl_error, "error on ilm_getLayerIDsOnScreen\n"); + //Grab all the layers - HMI will be pLength-2 and FSA pLength-1 + if (ilm_getLayerIDs(&pLength, &ppArray) != ILM_SUCCESS) { + fprintf(stderr, "error on ilm_getLayerIDs\n"); } - /* The last one is the hmi-launcher layer and thus surface. - * Then hmi-launcher surface toped the map surface into the hmi-launcher layer. - */ - renderOrder[1] = SURFACE_OFFSET + ppArray[pLength - 1]; + renderOrder[1] = SURFACE_OFFSET + ppArray[pLength - 2]; renderOrder[0] = FSA_SURFACE; if (ilm_layerSetRenderOrder(ppArray[pLength - 1],renderOrder,2) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_layerSetRenderOrder\n"); - } - - //Put the map at the same resolution as the hmi-launcher - if (ilm_getPropertiesOfSurface(SURFACE_OFFSET + ppArray[pLength - 1], &pSurfaceProperties) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_getPropertiesOfSurface\n"); - } - - if (ilm_surfaceSetDestinationRectangle(surfaceId, pSurfaceProperties.destX, pSurfaceProperties.destY, - pSurfaceProperties.destWidth, pSurfaceProperties.destHeight) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_surfaceSetDestinationRectangle\n"); - } - - if (ilm_surfaceSetVisibility(surfaceId, ILM_TRUE) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_surfaceSetVisibility\n"); + fprintf(stderr,"error on ilm_layerSetRenderOrder\n"); } if (ilm_commitChanges() != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_commitChanges\n"); + fprintf(stderr,"error on ilm_commitChanges\n"); } } - } + } } } #endif @@ -1731,7 +1703,7 @@ MapViewerControlObj::MapViewerControlObj(MapViewerControlServerStub *mapviewerco t_ilm_nativedisplay display = (t_ilm_nativedisplay)graphics_get_data(m_graphics.u.graphics, "display"); if (ilmClient_init(display) != ILM_SUCCESS) { - dbg(lvl_error, "error on ilm_initWidthNativeDisplay\n"); + fprintf(stderr, "error on ilm_initWidthNativeDisplay\n"); } t_ilm_nativehandle nativehandle=(t_ilm_nativehandle)graphics_get_data(m_graphics.u.graphics,"xwindow_id"); @@ -1739,17 +1711,17 @@ MapViewerControlObj::MapViewerControlObj(MapViewerControlServerStub *mapviewerco //Register Notification if (ilm_registerNotification(callbackFunction, NULL) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_registerNotification\n"); + fprintf(stderr,"error on ilm_registerNotification\n"); } - //Create surface for the map and add notification when created + //Create surface for the map and add notification when created. Note: width, heigh & pixel format are not taking in count at the end. if (ilm_surfaceCreate(nativehandle, MapViewSize._1, MapViewSize._2, ILM_PIXELFORMAT_RGBA_8888, &surfaceId) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_surfaceCreate\n"); + fprintf(stderr,"error on ilm_surfaceCreate\n"); } //Commit all changes if (ilm_commitChanges() != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_commitChanges\n"); + fprintf(stderr,"error on ilm_commitChanges\n"); } #endif @@ -1761,11 +1733,11 @@ MapViewerControlObj::~MapViewerControlObj() t_ilm_surface surfaceId=FSA_SURFACE; if (ilm_surfaceRemove(surfaceId) != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_surfaceRemove\n"); + fprintf(stderr,"error on ilm_surfaceRemove\n"); } if (ilm_commitChanges() != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_commitChanges\n"); + fprintf(stderr,"error on ilm_commitChanges\n"); } #endif @@ -1942,7 +1914,7 @@ plugin_init(void) #if LM if (ilm_init() != ILM_SUCCESS) { - dbg(lvl_error,"error on ilm_init\n"); + fprintf(stderr,"error on ilm_init\n"); } #endif |