summaryrefslogtreecommitdiff
path: root/src/navigation/map-viewer
diff options
context:
space:
mode:
Diffstat (limited to 'src/navigation/map-viewer')
-rw-r--r--src/navigation/map-viewer/configuration-server-plugin/CMakeLists.txt1
-rw-r--r--src/navigation/map-viewer/mapviewercontrol-server-plugin/CMakeLists.txt1
-rw-r--r--src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx50
-rw-r--r--src/navigation/map-viewer/session-server-plugin/CMakeLists.txt1
4 files changed, 33 insertions, 20 deletions
diff --git a/src/navigation/map-viewer/configuration-server-plugin/CMakeLists.txt b/src/navigation/map-viewer/configuration-server-plugin/CMakeLists.txt
index 3e31d54..8986abe 100644
--- a/src/navigation/map-viewer/configuration-server-plugin/CMakeLists.txt
+++ b/src/navigation/map-viewer/configuration-server-plugin/CMakeLists.txt
@@ -72,6 +72,7 @@ link_directories(
)
set(LIBRARIES
+ ${LIBRARIES}
${DBUS_LIBRARIES}
${COMMONAPI_LIBRARIES}
${COMMONAPI_DBUS_LIBRARIES}
diff --git a/src/navigation/map-viewer/mapviewercontrol-server-plugin/CMakeLists.txt b/src/navigation/map-viewer/mapviewercontrol-server-plugin/CMakeLists.txt
index 7bc22c8..acaca40 100644
--- a/src/navigation/map-viewer/mapviewercontrol-server-plugin/CMakeLists.txt
+++ b/src/navigation/map-viewer/mapviewercontrol-server-plugin/CMakeLists.txt
@@ -82,6 +82,7 @@ link_directories(
)
set(LIBRARIES
+ ${LIBRARIES}
${DBUS_LIBRARIES}
${COMMONAPI_LIBRARIES}
${COMMONAPI_DBUS_LIBRARIES}
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 c818db1..bbacb2d 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
@@ -65,6 +65,10 @@
#include <RoutingProxy.hpp>
#include <navigationcore/SessionProxy.hpp>
+#include "log.h"
+
+DLT_DECLARE_CONTEXT(gCtx);
+
#if (!DEBUG_ENABLED)
#undef dbg
#define dbg(level,...) ;
@@ -1195,13 +1199,11 @@ MapViewerControlObj::SetMapViewScale(NavigationTypes::Handle SessionHandle, uint
void
MapViewerControlObj::SetMapViewScaleByDelta(NavigationTypes::Handle SessionHandle, int16_t ScaleDelta)
{
- if (!ScaleDelta)
- throw DBus::ErrorInvalidArgs("ScaleDelta must not be 0");
- else {
- if (ScaleDelta < 0)
- navit_zoom_out(m_navit.u.navit,1 << (-ScaleDelta),NULL);
- else navit_zoom_in(m_navit.u.navit,1 << ScaleDelta,NULL);
- }
+ LOG_INFO(gCtx,"Delta=%d",ScaleDelta);
+ if (ScaleDelta < 0)
+ navit_zoom_in(m_navit.u.navit,1 << (-ScaleDelta),NULL);
+ else if (ScaleDelta > 0)
+ navit_zoom_out(m_navit.u.navit,1 << ScaleDelta,NULL);
}
void
@@ -1209,21 +1211,18 @@ MapViewerControlObj::GetMapViewScale(uint8_t& ScaleID, MapViewerControl::MapScal
{
struct transformation *trans=navit_get_trans(m_navit.u.navit);
long scale=transform_get_scale(trans);
- if (scale >= 2097152)
- IsMinMax=MapViewerControl::MapScaleType::MAX;
- else {
- if (scale <= 1) {
- IsMinMax=MapViewerControl::MapScaleType::MIN;
- } else {
+ if (scale <= 1)
+ IsMinMax=MapViewerControl::MapScaleType::MIN;
+ else
+ if (scale >= 2097152)
+ IsMinMax=MapViewerControl::MapScaleType::MAX;
+ else
IsMinMax=MapViewerControl::MapScaleType::MID;
- ScaleID=0;
- while (scale > 1) { //strange code here, to be investigated ?
- scale >>=1;
- ScaleID++;
- }
- }
+ ScaleID=0;
+ while (scale > 1) {
+ scale >>=1;
+ ScaleID++;
}
-
}
void
@@ -1973,6 +1972,9 @@ DisplayedRoute::~DisplayedRoute()
void
plugin_init(void)
{
+ DLT_REGISTER_APP("MPVS","MAP VIEWER CONTROL SERVER");
+ DLT_REGISTER_CONTEXT(gCtx,"MPVS","Global Context");
+
dbg(lvl_debug,"enter\n");
event_request_system("glib","genivi_mapviewercontrol");
@@ -1991,20 +1993,28 @@ plugin_init(void)
successfullyRegistered = runtime->registerService(domain, instanceMapViewerControl, myServiceMapViewerControl);
}
+ LOG_INFO_MSG(gCtx,"map viewer control server");
+
//init the session client
const std::string instanceNavigationCoreSession = "Session";
mp_navigationCoreSessionClientProxy = new NavigationCoreSessionClientProxy(domain,instanceNavigationCoreSession);
+ LOG_INFO_MSG(gCtx,"session client");
+
//init the routing client
const std::string instanceRouting = "Routing";
mp_routingClientProxy = new RoutingClientProxy(domain,instanceRouting);
mp_routingClientProxy->setListeners();
+ LOG_INFO_MSG(gCtx,"routing client");
+
// init the map matched position client
const std::string instanceMapMatchedPosition = "MapMatchedPosition";
mp_mapMatchedPositionClientProxy = new MapMatchedPositionClientProxy(domain,instanceMapMatchedPosition);
mp_mapMatchedPositionClientProxy->setListeners();
+ LOG_INFO_MSG(gCtx,"map matched position client");
+
#if LM
if (ilm_init() != ILM_SUCCESS) {
fprintf(stderr,"error on ilm_init\n");
diff --git a/src/navigation/map-viewer/session-server-plugin/CMakeLists.txt b/src/navigation/map-viewer/session-server-plugin/CMakeLists.txt
index df45597..c122f14 100644
--- a/src/navigation/map-viewer/session-server-plugin/CMakeLists.txt
+++ b/src/navigation/map-viewer/session-server-plugin/CMakeLists.txt
@@ -73,6 +73,7 @@ link_directories(
)
set(LIBRARIES
+ ${LIBRARIES}
${DBUS_LIBRARIES}
${COMMONAPI_LIBRARIES}
${COMMONAPI_DBUS_LIBRARIES}