summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorasanoaozora <fifitaneki@hotmail.com>2017-04-28 11:23:56 +0200
committerasanoaozora <fifitaneki@hotmail.com>2017-04-28 11:23:56 +0200
commitb865fbca8d4e308ae8b4862ad94ea8b30f87e5ba (patch)
treecc30213637bbf47f725dcf5125e0cc78abc81530 /src
parent70e44b6b5df23d8a8708885f1f4f7ce90cb12fae (diff)
downloadpoi-service-b865fbca8d4e308ae8b4862ad94ea8b30f87e5ba.tar.gz
GT-3434 GT-3435 GT-3494 GT-3495 GT-3496
GT-3434 Unclear ByteBuffer type for LaneType bitmask laneDirections GT-3435 VehicleReturnedToTheRoadNetwork broadcast is missing from Guidance API GT-3494 setTargetPoint is ambiguous GT-3495 Documentation for travelTime can be improved GT-3496 Add map gesture support to MapViewer
Diffstat (limited to 'src')
-rw-r--r--src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx86
-rw-r--r--src/navigation/map-viewer/mapviewercontrol-server-plugin/genivi_mapviewer_mapviewercontrol.cxx34
2 files changed, 87 insertions, 33 deletions
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 db18c0d..5929cba 100644
--- a/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx
+++ b/src/navigation/map-viewer/mapviewercontrol-plugin/genivi_mapviewer_mapviewercontrol.cxx
@@ -119,7 +119,7 @@ class MapViewerControlObj
struct mapset *m_mapset;
uint32_t m_handle;
double m_scrolldirection, m_scrollspeed;
- double m_rotationangle, m_rotationangleperframe;
+ double m_rotationangle, m_rotationanglepersecond;
struct callback *m_postdraw_callback;
struct callback *m_move_callback;
@@ -162,8 +162,8 @@ class MapViewerControlObj
void GetTargetPoint(::DBus::Struct<double, double, double> &target);
void SetMapViewPan(uint32_t SessionHandle, int32_t panningAction, ::DBus::Struct< uint16_t, uint16_t >p);
void GetMapViewPan(const int32_t &panningAction, ::DBus::Struct< uint16_t, uint16_t > &p);
- void SetMapViewRotation(uint32_t sessionHandle, double rotationAngle, double rotationAnglePerFrame);
- void GetMapViewRotation(int32_t& rotationAngle, int32_t& rotationAnglePerFrame);
+ void SetMapViewRotation(uint32_t sessionHandle, double rotationAngle, double rotationAnglePerSecond);
+ void GetMapViewRotation(int32_t& rotationAngle, int32_t& rotationAnglePerSecond);
void SetMapViewBoundingBox(uint32_t sessionHandle, const ::DBus::Struct< ::DBus::Struct< double, double >, ::DBus::Struct< double, double > >& boundingBox);
void GetMapViewBoundingBox(::DBus::Struct< ::DBus::Struct< double, double >, ::DBus::Struct< double, double > >& boundingBox);
void GetDisplayedRoutes(std::vector< ::DBus::Struct< uint32_t, bool > >& displayedRoutes);
@@ -734,12 +734,12 @@ class MapViewerControl
}
void
- GetMapViewRotation(const uint32_t& mapViewInstanceHandle, int32_t& rotationAngle, int32_t& rotationAnglePerFrame)
+ GetMapViewRotation(const uint32_t& mapViewInstanceHandle, int32_t& rotationAngle, int32_t& rotationAnglePerSecond)
{
MapViewerControlObj *obj=handles[mapViewInstanceHandle];
if (!obj)
throw DBus::ErrorInvalidArgs("Invalid mapviewinstance handle");
- else obj->GetMapViewRotation(rotationAngle, rotationAnglePerFrame);
+ else obj->GetMapViewRotation(rotationAngle, rotationAnglePerSecond);
}
void
@@ -939,6 +939,60 @@ class MapViewerControl
}
+ int32_t MapViewRotateBegin(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const ::DBus::Struct< uint16_t, uint16_t >& anchorPoint)
+ {
+ throw DBus::ErrorNotSupported("Not yet supported");
+ return 0;
+ }
+
+ int32_t MapViewRotateUpdate(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const ::DBus::Struct< uint16_t, uint16_t >& anchorPoint, const int16_t& rotationAngle)
+ {
+ throw DBus::ErrorNotSupported("Not yet supported");
+ return 0;
+ }
+
+ int32_t MapViewRotateEnd(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const uint16_t& velocity)
+ {
+ throw DBus::ErrorNotSupported("Not yet supported");
+ return 0;
+ }
+
+ int32_t MapViewPinchBegin(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const ::DBus::Struct< uint16_t, uint16_t >& anchorPoint)
+ {
+ throw DBus::ErrorNotSupported("Not yet supported");
+ return 0;
+ }
+
+ int32_t MapViewPinchUpdate(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const ::DBus::Struct< uint16_t, uint16_t >& anchorPoint, const double& scaleFactor)
+ {
+ throw DBus::ErrorNotSupported("Not yet supported");
+ return 0;
+ }
+
+ int32_t MapViewPinchEnd(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const double& velocity)
+ {
+ throw DBus::ErrorNotSupported("Not yet supported");
+ return 0;
+ }
+
+ int32_t MapViewTiltBegin(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const ::DBus::Struct< uint16_t, uint16_t >& anchorPoint)
+ {
+ throw DBus::ErrorNotSupported("Not yet supported");
+ return 0;
+ }
+
+ int32_t MapViewTiltUpdate(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const int32_t& translation)
+ {
+ throw DBus::ErrorNotSupported("Not yet supported");
+ return 0;
+ }
+
+ int32_t MapViewTiltEnd(const uint32_t& sessionHandle, const uint32_t& mapViewInstanceHandle, const uint32_t& velocity)
+ {
+ throw DBus::ErrorNotSupported("Not yet supported");
+ return 0;
+ }
+
};
void
@@ -1291,27 +1345,27 @@ MapViewerControlObj::GetTargetPoint(::DBus::Struct< double, double, double >&tar
void
MapViewerControlObj::MoveMap(void)
{
- if (m_scrollspeed || m_rotationangleperframe || m_force_draw) {
+ if (m_scrollspeed || m_rotationanglepersecond || m_force_draw) {
int w,h;
double refresh_time=0.3; // Time needed to redraw map
double r=m_scrollspeed*refresh_time;
struct point p;
struct transformation *t=navit_get_trans(m_navit.u.navit);
- if (m_rotationangleperframe) {
+ if (m_rotationanglepersecond) {
int yaw=transform_get_yaw(t);
int delta=((int)(m_rotationangle+0.5)-yaw)%360;
if (delta > 180)
delta-=180;
if (delta < -180)
delta+=180;
- if (delta < 0 && delta < -m_rotationangleperframe)
- delta=-m_rotationangleperframe;
- if (delta > 0 && delta > m_rotationangleperframe)
- delta=m_rotationangleperframe;
+ if (delta < 0 && delta < -m_rotationanglepersecond)
+ delta=-m_rotationanglepersecond;
+ if (delta > 0 && delta > m_rotationanglepersecond)
+ delta=m_rotationanglepersecond;
if (delta)
transform_set_yaw(t, yaw+delta);
else
- m_rotationangleperframe=0;
+ m_rotationanglepersecond=0;
}
transform_get_size(t, &w, &h);
p.x=w/2+sin(m_scrolldirection*M_PI/180)*r;
@@ -1373,20 +1427,20 @@ MapViewerControlObj::GetMapViewPan(const int32_t& panningAction, ::DBus::Struct<
}
void
-MapViewerControlObj::SetMapViewRotation(uint32_t sessionHandle, double rotationAngle, double rotationAnglePerFrame)
+MapViewerControlObj::SetMapViewRotation(uint32_t sessionHandle, double rotationAngle, double rotationAnglePerSecond)
{
m_rotationangle=rotationAngle;
- m_rotationangleperframe=rotationAnglePerFrame;
+ m_rotationanglepersecond=rotationAnglePerSecond;
SetFollowCarMode(sessionHandle, false);
MoveMap();
}
void
-MapViewerControlObj::GetMapViewRotation(int32_t& rotationAngle, int32_t& rotationAnglePerFrame)
+MapViewerControlObj::GetMapViewRotation(int32_t& rotationAngle, int32_t& rotationAnglePerSecond)
{
rotationAngle=m_rotationangle;
- rotationAnglePerFrame=m_rotationangleperframe;
+ rotationAnglePerSecond=m_rotationanglepersecond;
}
void
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 e419331..be56f53 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
@@ -116,7 +116,7 @@ class MapViewerControlObj
struct mapset *m_mapset;
uint32_t m_handle;
double m_scrolldirection, m_scrollspeed;
- double m_rotationangle, m_rotationangleperframe;
+ double m_rotationangle, m_rotationanglepersecond;
struct callback *m_postdraw_callback;
struct callback *m_move_callback;
@@ -157,8 +157,8 @@ class MapViewerControlObj
void GetTargetPoint(NavigationTypes::Coordinate3D &target);
void SetMapViewPan(NavigationTypes::Handle SessionHandle, MapViewerControl::PanAction panningAction, MapViewerControl::Pixel p);
void GetMapViewPan(const int32_t &panningAction, MapViewerControl::Pixel &p);
- void SetMapViewRotation(NavigationTypes::Handle SessionHandle, double rotationAngle, double rotationAnglePerFrame);
- void GetMapViewRotation(int32_t& rotationAngle, int32_t& rotationAnglePerFrame);
+ void SetMapViewRotation(NavigationTypes::Handle SessionHandle, double rotationAngle, double rotationAnglePerSecond);
+ void GetMapViewRotation(int32_t& rotationAngle, int32_t& _rotationAnglePerSecond);
void SetMapViewBoundingBox(NavigationTypes::Handle SessionHandle, const NavigationTypes::Rectangle& boundingBox);
void GetMapViewBoundingBox(NavigationTypes::Rectangle& boundingBox);
void GetDisplayedRoutes(std::vector<MapViewerControl::DisplayedRoute> &displayedRoutes);
@@ -848,12 +848,12 @@ class MapViewerControlServerStub : public MapViewerControlStubDefault
*/
void getMapViewRotation(const std::shared_ptr<CommonAPI::ClientId> _client, ::v4::org::genivi::navigation::NavigationTypes::Handle _mapViewInstanceHandle, getMapViewRotationReply_t _reply){
int32_t _rotationAngle=0;
- int32_t _rotationAnglePerFrame=0;
+ int32_t _rotationAnglePerSecond=0;
MapViewerControlObj *obj=mp_handles[_mapViewInstanceHandle];
if (!obj)
throw DBus::ErrorInvalidArgs("Invalid mapviewinstance handle");
- else obj->GetMapViewRotation(_rotationAngle, _rotationAnglePerFrame);
- _reply(_rotationAngle,_rotationAnglePerFrame);
+ else obj->GetMapViewRotation(_rotationAngle, _rotationAnglePerSecond);
+ _reply(_rotationAngle,_rotationAnglePerSecond);
}
/**
@@ -1434,27 +1434,27 @@ MapViewerControlObj::GetTargetPoint(NavigationTypes::Coordinate3D&target)
void
MapViewerControlObj::MoveMap(void)
{
- if (m_scrollspeed || m_rotationangleperframe || m_force_draw) {
+ if (m_scrollspeed || m_rotationanglepersecond || m_force_draw) {
int w,h;
double refresh_time=0.3; // Time needed to redraw map
double r=m_scrollspeed*refresh_time;
struct point p;
struct transformation *t=navit_get_trans(m_navit.u.navit);
- if (m_rotationangleperframe) {
+ if (m_rotationanglepersecond) {
int yaw=transform_get_yaw(t);
int delta=((int)(m_rotationangle+0.5)-yaw)%360;
if (delta > 180)
delta-=180;
if (delta < -180)
delta+=180;
- if (delta < 0 && delta < -m_rotationangleperframe)
- delta=-m_rotationangleperframe;
- if (delta > 0 && delta > m_rotationangleperframe)
- delta=m_rotationangleperframe;
+ if (delta < 0 && delta < -m_rotationanglepersecond)
+ delta=-m_rotationanglepersecond;
+ if (delta > 0 && delta > m_rotationanglepersecond)
+ delta=m_rotationanglepersecond;
if (delta)
transform_set_yaw(t, yaw+delta);
else
- m_rotationangleperframe=0;
+ m_rotationanglepersecond=0;
}
transform_get_size(t, &w, &h);
p.x=w/2+sin(m_scrolldirection*M_PI/180)*r;
@@ -1515,20 +1515,20 @@ MapViewerControlObj::GetMapViewPan(const int32_t& panningAction, MapViewerContro
}
void
-MapViewerControlObj::SetMapViewRotation(NavigationTypes::Handle SessionHandle, double rotationAngle, double rotationAnglePerFrame)
+MapViewerControlObj::SetMapViewRotation(NavigationTypes::Handle SessionHandle, double rotationAngle, double rotationAnglePerSecond)
{
m_rotationangle=rotationAngle;
- m_rotationangleperframe=rotationAnglePerFrame;
+ m_rotationanglepersecond=rotationAnglePerSecond;
SetFollowCarMode(SessionHandle, false);
MoveMap();
}
void
-MapViewerControlObj::GetMapViewRotation(int32_t& rotationAngle, int32_t& rotationAnglePerFrame)
+MapViewerControlObj::GetMapViewRotation(int32_t& rotationAngle, int32_t& _rotationAnglePerSecond)
{
rotationAngle=m_rotationangle;
- rotationAnglePerFrame=m_rotationangleperframe;
+ _rotationAnglePerSecond=m_rotationanglepersecond;
}
void