summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorasanoaozora <fifitaneki@hotmail.com>2016-05-24 14:39:01 +0200
committerasanoaozora <fifitaneki@hotmail.com>2016-05-24 14:39:01 +0200
commit5ca0a6e28cf8dfcba41c299cc2b5340c7a0444f3 (patch)
tree89f02ccb525af984000c6a3c006330b148ef1293 /src
parent9953b6417f10e9d69feb7974f4fd85e1e38ee0eb (diff)
downloadpoi-service-5ca0a6e28cf8dfcba41c299cc2b5340c7a0444f3.tar.gz
fix patch for Weston
Diffstat (limited to 'src')
-rw-r--r--src/navigation/README.md4
-rw-r--r--src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx94
-rw-r--r--src/navigation/navigation-core/guidance-plugin/genivi_navigationcore_guidance.cxx2
3 files changed, 77 insertions, 23 deletions
diff --git a/src/navigation/README.md b/src/navigation/README.md
index 55b2421..3c026f3 100644
--- a/src/navigation/README.md
+++ b/src/navigation/README.md
@@ -14,10 +14,10 @@ Navit from [https://github.com/navit-gps/navit/](https://github.com/navit-gps/na
NB: Patches are applied to navit:
search_list_get_unique.diff features used by GetSpell
fsa_issue_padding.diff required to run on the GDP
-NB: For displaying current versions used by the code type ./reload.sh in command line
+NB: For displaying current versions used by the code type ./clone_and_build.sh in command line
The code is regularly aligned with the latest versions of the third parties software
-## Prerequisities
+## Prerequisites
Under Ubuntu, some packets are needed to be installed:
sudo apt-get install xsltproc libdbus-cpp-dev libdbus-c++-dev libglib2.0-dev gtk+-2.0 libglibmm-2.4-dev libxml++2.6-dev libgtk-3-dev libdbus-1-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev inkscape qt5-qmake qtbase5-dev-tools qtbase5-dev qttools5-dev-tools qtdeclarative5-dev
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 2ef555c..fb10f39 100644
--- a/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx
+++ b/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx
@@ -34,7 +34,7 @@
#include <ilm/ilm_control.h>
#ifndef FSA_LAYER
#define FSA_LAYER 600
-#define FSA_VERTICAL_OFFSET 68
+#define HMI_LAYER 700
#endif
#endif
@@ -1409,6 +1409,46 @@ MapViewerControlObj::ConvertGeoCoordsToPixelCoords(uint32_t sessionHandle, const
}
}
+#if LM
+static void callbackFunction(ilmObjectType object, t_ilm_uint surfaceId, t_ilm_bool created, void *user_data)
+{
+ (void)user_data;
+ struct ilmSurfaceProperties sp;
+
+ if (object == ILM_SURFACE) {
+ if (created) {
+ //m_handle not propageted here but it is m_handle=1.
+ if (surfaceId == FSA_LAYER+1) {
+ //Configure map surface
+ if (ilm_getPropertiesOfSurface(surfaceId, &sp) != ILM_SUCCESS) {
+ dbg(lvl_error,"error on ilm_getPropertiesOfSurface\n");
+ }
+
+ if (ilm_layerAddSurface(FSA_LAYER, surfaceId) != ILM_SUCCESS) {
+ dbg(lvl_error,"error on ilm_layerAddSurface\n");
+ }
+
+ if (ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, sp.origSourceWidth, sp.origSourceHeight) != ILM_SUCCESS) {
+ dbg(lvl_error,"error on ilm_surfaceSetSourceRectangle\n");
+ }
+
+ if (ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, sp.origSourceWidth, sp.origSourceHeight) != 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");
+ }
+
+ if (ilm_commitChanges() != ILM_SUCCESS) {
+ dbg(lvl_error,"error on ilm_commitChanges\n");
+ }
+ }
+ }
+ }
+}
+#endif
+
MapViewerControlObj::MapViewerControlObj(MapViewerControl *mapviewercontrol, uint32_t handle, const ::DBus::Struct< uint16_t, uint16_t >& MapViewSize)
{
m_mapviewercontrol=mapviewercontrol;
@@ -1489,35 +1529,49 @@ MapViewerControlObj::MapViewerControlObj(MapViewerControl *mapviewercontrol, uin
#if LM
t_ilm_nativedisplay display = (t_ilm_nativedisplay)graphics_get_data(m_graphics.u.graphics, "display");
- if (ilm_initWithNativedisplay(display) != ILM_SUCCESS) {
- dbg(lvl_debug, "error on ilm_initWidthNativeDisplay\n");
+
+ if (ilmClient_init(display) != ILM_SUCCESS) {
+ dbg(lvl_error, "error on ilm_initWidthNativeDisplay\n");
}
t_ilm_nativehandle nativehandle=(t_ilm_nativehandle)graphics_get_data(m_graphics.u.graphics,"xwindow_id");
t_ilm_surface surfaceId=FSA_LAYER+m_handle;
t_ilm_layer layerId=FSA_LAYER;
- if (ilm_surfaceCreate(nativehandle, MapViewSize._1, MapViewSize._2, ILM_PIXELFORMAT_RGBA_8888, &surfaceId) != ILM_SUCCESS) {
- dbg(lvl_debug,"error on ilm_surfaceCreate\n");
- }
- if (ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, MapViewSize._1, MapViewSize._2) != ILM_SUCCESS) {
- dbg(lvl_debug,"error on ilm_surfaceSetSourceRectangle\n");
+ //Configure Screen for FSA
+ t_ilm_layer renderOrder[1];
+ renderOrder[0] = FSA_LAYER;
+ renderOrder[1] = HMI_LAYER;
+ if (ilm_displaySetRenderOrder(0,renderOrder,2) != ILM_SUCCESS) {
+ dbg(lvl_error,"error on ilm_displaySetRenderOrder\n");
+ }
+
+ //Configure the FSA layer dimensions & visibility
+ if (ilm_layerSetSourceRectangle(layerId, 0, 0, MapViewSize._1, MapViewSize._2) != ILM_SUCCESS) {
+ dbg(lvl_error,"error on ilm_layerSetSourceRectangle\n");
+ }
+
+ if (ilm_layerSetDestinationRectangle(layerId, 0, 0, MapViewSize._1, MapViewSize._2) != ILM_SUCCESS) {
+ dbg(lvl_error,"error on ilm_layerSetDestinationRectangle\n");
}
- if (ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, MapViewSize._1, MapViewSize._2-FSA_VERTICAL_OFFSET) != ILM_SUCCESS) {
- dbg(lvl_debug,"error on ilm_surfaceSetDestinationRectangle\n");
+ if (ilm_layerSetVisibility(layerId, ILM_TRUE) != ILM_SUCCESS) {
+ dbg(lvl_error,"error on ilm_layerSetVisibility\n");
}
- if (ilm_surfaceSetVisibility(surfaceId, ILM_TRUE) != ILM_SUCCESS) {
- dbg(lvl_debug,"error on ilm_surfaceSetVisibility\n");
+ //Register Notification
+ if (ilm_registerNotification(callbackFunction, NULL) != ILM_SUCCESS) {
+ dbg(lvl_error,"error on ilm_registerNotification\n");
}
- if (ilm_layerAddSurface(layerId, surfaceId) != ILM_SUCCESS) {
- dbg(lvl_debug,"error on ilm_layerAddSurface\n");
+ //Create surface for the map and add notification when created
+ if (ilm_surfaceCreate(nativehandle, MapViewSize._1, MapViewSize._2, ILM_PIXELFORMAT_RGBA_8888, &surfaceId) != ILM_SUCCESS) {
+ dbg(lvl_error,"error on ilm_surfaceCreate\n");
}
+ //Commit all changes
if (ilm_commitChanges() != ILM_SUCCESS) {
- dbg(lvl_debug,"error on ilm_commitChanges\n");
+ dbg(lvl_error,"error on ilm_commitChanges\n");
}
#endif
@@ -1529,13 +1583,13 @@ MapViewerControlObj::~MapViewerControlObj()
t_ilm_surface surfaceId=FSA_LAYER+m_handle;
t_ilm_layer layerId=FSA_LAYER;
if (ilm_surfaceRemove(surfaceId) != ILM_SUCCESS) {
- dbg(lvl_debug,"error on ilm_surfaceRemove\n");
+ dbg(lvl_error,"error on ilm_surfaceRemove\n");
}
if (ilm_layerRemoveSurface(layerId, surfaceId) != ILM_SUCCESS) {
- dbg(lvl_debug,"error on ilm_layerAddSurface\n");
+ dbg(lvl_error,"error on ilm_layerAddSurface\n");
}
if (ilm_commitChanges() != ILM_SUCCESS) {
- dbg(lvl_debug,"error on ilm_commitChanges\n");
+ dbg(lvl_error,"error on ilm_commitChanges\n");
}
#endif
@@ -1709,10 +1763,8 @@ plugin_init(void)
server=new MapViewerControl(*conns[MAPVIEWER_CONTROL_CONNECTION]);
#if LM
-#if 0
if (ilm_init() != ILM_SUCCESS) {
- dbg(lvl_debug,"error on ilm_init\n");
+ dbg(lvl_error,"error on ilm_init\n");
}
#endif
-#endif
}
diff --git a/src/navigation/navigation-core/guidance-plugin/genivi_navigationcore_guidance.cxx b/src/navigation/navigation-core/guidance-plugin/genivi_navigationcore_guidance.cxx
index ce6e4f5..c70e1fb 100644
--- a/src/navigation/navigation-core/guidance-plugin/genivi_navigationcore_guidance.cxx
+++ b/src/navigation/navigation-core/guidance-plugin/genivi_navigationcore_guidance.cxx
@@ -605,6 +605,8 @@ GuidanceObj::GetManeuversList(const uint16_t& requestedNumberOfManeuvers, const
maneuver._3 = GENIVI_NAVIGATIONCORE_DEFAULT; //roadPropertyAfterManeuver
maneuver._4 = GENIVI_NAVIGATIONCORE_RIGHT; //drivingSide
maneuver._5 = 0; //offsetOfNextManeuver
+ //get infos about maneuver: sub_maneuver._1: DistanceToManeuver, sub_maneuver._4: Maneuver, maneuver._2: RoadAfterManeuver
+ //maneuver_data is a map of attribute and value (e.g. DIRECTION STRAIGHT_ON )
GetManeuver(item, sub_maneuver._1, sub_maneuver._4, maneuver._2, maneuver_data);
sub_maneuver._5.insert(maneuver_data);
maneuver._6.push_back(sub_maneuver);