summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/dbus_server.cpp44
-rw-r--r--app/dbus_server.h2
-rw-r--r--app/navigation.qml9
-rw-r--r--dbus_interface/org.agl.naviapi.xml6
4 files changed, 49 insertions, 12 deletions
diff --git a/app/dbus_server.cpp b/app/dbus_server.cpp
index 57fa3d5..99ae363 100644
--- a/app/dbus_server.cpp
+++ b/app/dbus_server.cpp
@@ -20,21 +20,21 @@ void DBus_Server::initDBus(){
new NaviapiAdaptor(this);
if (!QDBusConnection::sessionBus().registerService(m_pathName))
- qDebug() << m_serverName << "registerService() failed";
+ qWarning() << m_serverName << "registerService() failed";
if (!QDBusConnection::sessionBus().registerObject(m_objName, this))
- qDebug() << m_serverName << "registerObject() failed";
+ qWarning() << m_serverName << "registerObject() failed";
- QDBusConnection sessionBus = QDBusConnection::connectToBus(QDBusConnection::SessionBus, m_serverName);
+ QDBusConnection sessionBus = QDBusConnection::connectToBus(QDBusConnection::SessionBus, m_serverName);
if (!sessionBus.isConnected()) {
- qDebug() << m_serverName << "connectToBus() failed";
+ qWarning() << m_serverName << "connectToBus() failed";
}
//for receive dbus signal
org::agl::naviapi *mInterface;
mInterface = new org::agl::naviapi(QString(),QString(),QDBusConnection::sessionBus(),this);
if (!connect(mInterface,SIGNAL(getRouteInfo()),this,SLOT(getRouteInfoSlot()))){
- qDebug() << m_serverName << "sessionBus.connect():getRouteInfoSlot failed";
+ qWarning() << m_serverName << "sessionBus.connect():getRouteInfoSlot failed";
}
}
@@ -43,29 +43,37 @@ void DBus_Server::initAPIs(QObject *parent){
if(!QObject::connect(this,SIGNAL(doGetRouteInfo()),
parent,SLOT(doGetRouteInfoSlot()))) {
- qDebug() << m_serverName << "cppSIGNAL:doGetRouteInfo to qmlSLOT:doGetRouteInfoSlot connect is failed";
+ qWarning() << m_serverName << "cppSIGNAL:doGetRouteInfo to qmlSLOT:doGetRouteInfoSlot connect failed";
}
if(!QObject::connect(parent,SIGNAL(qmlSignalRouteInfo(double,double,double,double)),
this,SLOT(sendSignalRouteInfo(double,double,double,double)))) {
- qDebug() << m_serverName << "qmlSIGNAL:qmlSignalRouteInfo to cppSLOT:sendSignalRouteInfo connect is failed";
+ qWarning() << m_serverName << "qmlSIGNAL:qmlSignalRouteInfo to cppSLOT:sendSignalRouteInfo connect failed";
}
if(!QObject::connect(parent,SIGNAL(qmlSignalPosInfo(double,double,double,double)),
this,SLOT(sendSignalPosInfo(double,double,double,double)))) {
- qDebug() << m_serverName << "qmlSIGNAL:qmlSignalPosInfo to cppSLOT:sendSignalPosInfo connect is failed";
+ qWarning() << m_serverName << "qmlSIGNAL:qmlSignalPosInfo to cppSLOT:sendSignalPosInfo connect failed";
+ }
+
+ if(!QObject::connect(parent,SIGNAL(qmlSignalStopDemo()),
+ this,SLOT(sendSignalStopDemo()))) {
+ qWarning() << m_serverName << "qmlSIGNAL:qmlSignalStopDemo to cppSLOT:sendSignalStopDemo connect failed";
+ }
+
+ if(!QObject::connect(parent,SIGNAL(qmlSignalArrived()),
+ this,SLOT(sendSignalArrived()))) {
+ qWarning() << m_serverName << "qmlSIGNAL:qmlSignalArrived to cppSLOT:sendSignalArrived connect failed";
}
}
void DBus_Server::getRouteInfoSlot(){
- qDebug() << "call getRouteInfoSlot ";
emit doGetRouteInfo();
return;
}
// Signal
void DBus_Server::sendSignalRouteInfo(double srt_lat, double srt_lon, double end_lat, double end_lon){
- qDebug() << "call sendSignalRouteInfo ";
QDBusMessage message = QDBusMessage::createSignal(m_objName,
org::agl::naviapi::staticInterfaceName(),
"signalRouteInfo");
@@ -82,3 +90,19 @@ void DBus_Server::sendSignalPosInfo(double lat, double lon, double drc, double d
QDBusConnection::sessionBus().send(message);
return;
}
+
+void DBus_Server::sendSignalStopDemo(void){
+ QDBusMessage message = QDBusMessage::createSignal(m_objName,
+ org::agl::naviapi::staticInterfaceName(),
+ "signalStopDemo");
+ QDBusConnection::sessionBus().send(message);
+ return;
+}
+
+void DBus_Server::sendSignalArrived(void){
+ QDBusMessage message = QDBusMessage::createSignal(m_objName,
+ org::agl::naviapi::staticInterfaceName(),
+ "signalArrived");
+ QDBusConnection::sessionBus().send(message);
+ return;
+}
diff --git a/app/dbus_server.h b/app/dbus_server.h
index 5fe7562..aaa4d73 100644
--- a/app/dbus_server.h
+++ b/app/dbus_server.h
@@ -27,5 +27,7 @@ public slots:
void getRouteInfoSlot();
void sendSignalRouteInfo(double srt_lat,double srt_lon,double end_lat,double end_lon);
void sendSignalPosInfo(double lat,double lon,double drc,double dst);
+ void sendSignalStopDemo();
+ void sendSignalArrived();
};
#endif // DBUS_SERVER_H
diff --git a/app/navigation.qml b/app/navigation.qml
index b1b5d9f..c23d1d5 100644
--- a/app/navigation.qml
+++ b/app/navigation.qml
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016 The Qt Company Ltd.
+ * Copyright (C) 2019 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,6 +47,10 @@ ApplicationWindow {
name: "mapbox.access_token";
value: fileOperation.getMapAccessToken()
}
+ PluginParameter {
+ name: "mapbox.mapping.additional_style_urls"
+ value: fileOperation.getMapStyleUrls()
+ }
}
Plugin {
id: osm
@@ -72,7 +77,7 @@ ApplicationWindow {
signal qmlSignalRouteInfo(double srt_lat,double srt_lon,double end_lat,double end_lon);
signal qmlSignalPosInfo(double lat,double lon,double drc,double dst);
signal qmlSignalStopDemo();
- signal qmlSignalArrvied();
+ signal qmlSignalArrived();
signal qmlCheckDirection(double cur_dir,double next_dir,double is_rot);
width: parent.width
@@ -542,7 +547,7 @@ ApplicationWindow {
{
// Arrive at your destination
btn_guidance.sts_guide = 0
- map.qmlSignalArrvied()
+ map.qmlSignalArrived()
}
}else{
setNextCoordinate(map.currentpostion.latitude, map.currentpostion.longitude,next_direction,root.car_moving_distance)
diff --git a/dbus_interface/org.agl.naviapi.xml b/dbus_interface/org.agl.naviapi.xml
index 488a29a..87bf87d 100644
--- a/dbus_interface/org.agl.naviapi.xml
+++ b/dbus_interface/org.agl.naviapi.xml
@@ -15,6 +15,12 @@
<arg name="direction" type="d" direction="out"/>
<arg name="distance" type="d" direction="out"/>
</signal>
+ <!-- void signalStopDemo() -->
+ <signal name="signalStopDemo">
+ </signal>
+ <!-- void signalArrived() -->
+ <signal name="signalArrived">
+ </signal>
<!-- void getRouteInfo() -->
<signal name="getRouteInfo">
</signal>