mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
refs #292, fixed DBus sample to reflect / test issues found during debugging
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
#include "testservice.h"
|
||||
#include "testservice_interface.h"
|
||||
#include "blackcore/dbus_server.h"
|
||||
#include "blackmisc/indexvariantmap.h"
|
||||
#include "blackmisc/nwserver.h"
|
||||
|
||||
#include <QTextStream>
|
||||
#include <QString>
|
||||
#include <QFuture>
|
||||
@@ -79,24 +78,25 @@ namespace BlackMiscTest
|
||||
*/
|
||||
void ServiceTool::dataTransferTestClient(const QString &address)
|
||||
{
|
||||
// send data via session
|
||||
QDBusConnection sessionBusConnection = QDBusConnection::sessionBus();
|
||||
qDebug() << "------------ sending via session bus" << sessionBusConnection.name();
|
||||
ServiceTool::sendDataToTestservice(sessionBusConnection);
|
||||
|
||||
// send data as P2P to server (this can be session bus, too, but usually is P2P)
|
||||
QDBusConnection p2pConnection = address == "session" ?
|
||||
bool sb = (address.toLower().startsWith("session"));
|
||||
QDBusConnection p2pConnection = sb ?
|
||||
QDBusConnection::sessionBus() :
|
||||
QDBusConnection::connectToPeer(address, "p2pConnection");
|
||||
|
||||
qDebug() << "------------ connection info ---------------";
|
||||
qDebug() << "server connection has interface?" << p2pConnection.interface(); // returns 0 with server and a real interface with session bus
|
||||
qDebug() << "------------ sending via P2P server " << p2pConnection.name();
|
||||
qDebug() << "address:" << address;
|
||||
qDebug() << "name:" << p2pConnection.name();
|
||||
qDebug() << "------------ connection info ---------------";
|
||||
|
||||
ServiceTool::sendDataToTestservice(p2pConnection);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get callsign
|
||||
*/
|
||||
CCallsign ServiceTool::getRandomCallsign()
|
||||
CCallsign ServiceTool::getRandomAtcCallsign()
|
||||
{
|
||||
static QList<CCallsign> callsigns;
|
||||
if (callsigns.isEmpty())
|
||||
@@ -108,7 +108,7 @@ namespace BlackMiscTest
|
||||
callsigns << CCallsign("EDDF_APP");
|
||||
callsigns << CCallsign("EDDF_GND");
|
||||
}
|
||||
int i = (rand() % (6));
|
||||
int i = (rand() % (callsigns.size()));
|
||||
CCallsign cs = callsigns.at(i);
|
||||
return cs;
|
||||
}
|
||||
@@ -130,7 +130,42 @@ namespace BlackMiscTest
|
||||
list.push_back(s);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/*
|
||||
* Airports
|
||||
*/
|
||||
CAirportList ServiceTool::getAirports(qint32 number)
|
||||
{
|
||||
BlackMisc::Aviation::CAirportList list;
|
||||
for (int i = 0; i < number; i++)
|
||||
{
|
||||
char cc = 65 + (i % 26);
|
||||
QString icao = QString("EXX%1").arg(QLatin1Char(cc));
|
||||
BlackMisc::Aviation::CAirport a(icao);
|
||||
a.setPosition(CCoordinateGeodetic(i, i, i));
|
||||
list.push_back(a);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
CClientList ServiceTool::getClients(qint32 number)
|
||||
{
|
||||
BlackMisc::Network::CClientList list;
|
||||
for (int i = 0; i < number; i++)
|
||||
{
|
||||
CCallsign cs(QString("DXX%1").arg(i));
|
||||
QString rn = QString("Joe Doe%1").arg(i);
|
||||
CUser user(QString::number(i), rn, cs);
|
||||
user.setCallsign(cs);
|
||||
CClient client(user);
|
||||
client.setCapability(true, CClient::FsdWithInterimPositions);
|
||||
client.setCapability(true, CClient::FsdWithModelDescription);
|
||||
QString myFooModel = QString("fooModel %1").arg(i);
|
||||
client.setAircraftModel(CAircraftModel(myFooModel, "nope"));
|
||||
list.push_back(client);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -181,9 +216,10 @@ namespace BlackMiscTest
|
||||
|
||||
CSpeed speed(200, BlackMisc::PhysicalQuantities::CSpeedUnit::km_h());
|
||||
CAltitude al(1000, CAltitude::MeanSeaLevel, CLengthUnit::ft());
|
||||
bool loop = true;
|
||||
QTextStream qtin(stdin);
|
||||
QString line;
|
||||
|
||||
while (loop)
|
||||
while (true)
|
||||
{
|
||||
QDBusMessage m = QDBusMessage::createSignal(
|
||||
Testservice::ServicePath, Testservice::ServiceName,
|
||||
@@ -269,7 +305,21 @@ namespace BlackMiscTest
|
||||
geoPos, CLength(50, CLengthUnit::km()));
|
||||
|
||||
testserviceInterface.receiveAtcStation(station);
|
||||
qDebug() << "Send ATC" << station;
|
||||
|
||||
// Math
|
||||
CMatrix3x3 m33;
|
||||
m33.setCellIndex();
|
||||
testserviceInterface.receiveMatrix(m33);
|
||||
qDebug() << "Send matrix" << m33;
|
||||
|
||||
// Geo
|
||||
// EDDF: 50° 2′ 0″ N, 8° 34′ 14″ E, 100m MSL
|
||||
geoPos = CCoordinateGeodetic::fromWgs84("50° 2′ 1″ 23 N", "8° 34′ 14″ E", CLength(111, CLengthUnit::m()));
|
||||
testserviceInterface.receiveGeoPosition(geoPos);
|
||||
qDebug() << "Send geo position" << geoPos;
|
||||
|
||||
qDebug() << "----------------- pings ----------------";
|
||||
CAtcStation stationReceived = testserviceInterface.pingAtcStation(station);
|
||||
qDebug() << "Pinged ATC station via interface"
|
||||
<< ((station == stationReceived) ? "OK" : "ERROR!") << stationReceived;
|
||||
@@ -280,17 +330,31 @@ namespace BlackMiscTest
|
||||
qDebug() << "Pinged aircraft via interface"
|
||||
<< ((aircraft == aircraftReceived) ? "OK" : "ERROR!") << aircraftReceived;
|
||||
|
||||
CAtcStationList AtcStationList;
|
||||
AtcStationList.push_back(station);
|
||||
AtcStationList.push_back(station);
|
||||
AtcStationList.push_back(station);
|
||||
AtcStationList = testserviceInterface.pingAtcStationList(AtcStationList);
|
||||
qDebug() << "Pinged ATC stations list via interface" << AtcStationList.size() << AtcStationList;
|
||||
CAtcStationList atcStationList;
|
||||
atcStationList.push_back(station);
|
||||
atcStationList.push_back(station);
|
||||
atcStationList.push_back(station);
|
||||
atcStationList = testserviceInterface.pingAtcStationList(atcStationList);
|
||||
qDebug() << "Pinged ATC station list via interface" << atcStationList.size() << atcStationList;
|
||||
|
||||
AtcStationList = ServiceTool::getStations(10);
|
||||
qDebug() << "Pinged ATC stations list via interface" << AtcStationList.size() << AtcStationList;
|
||||
CAirportList airportList = ServiceTool::getAirports(10);
|
||||
airportList = testserviceInterface.pingAirportList(airportList);
|
||||
qDebug() << "Pinged airport list via interface" << airportList.size() << airportList;
|
||||
|
||||
CClientList clients = ServiceTool::getClients(10);
|
||||
CClient client = clients.front();
|
||||
client = testserviceInterface.pingClient(client);
|
||||
qDebug() << "Pinged client via interface" << client;
|
||||
clients = testserviceInterface.pingClientList(clients);
|
||||
qDebug() << "Pinged client list via interface" << clients.size() << clients;
|
||||
|
||||
CVariant cv = CVariant::fromValue(clients);
|
||||
qDebug() << "cv" << cv.toString();
|
||||
cv = testserviceInterface.pingCVariant(client);
|
||||
qDebug() << "Pinged CVariant via interface" << cv.toString();
|
||||
|
||||
// test variant lists with different types wrapped in QVariant
|
||||
qDebug() << "----------------- variant tests ----------------";
|
||||
QVariantList qvList;
|
||||
qvList << QVariant::fromValue(len);
|
||||
qvList << QVariant::fromValue(alt);
|
||||
@@ -307,19 +371,9 @@ namespace BlackMiscTest
|
||||
}
|
||||
QThread::msleep(2500);
|
||||
|
||||
// Math
|
||||
CMatrix3x3 m33;
|
||||
m33.setCellIndex();
|
||||
testserviceInterface.receiveMatrix(m33);
|
||||
qDebug() << "Send matrix" << m33;
|
||||
|
||||
// Geo
|
||||
// EDDF: 50° 2′ 0″ N, 8° 34′ 14″ E, 100m MSL
|
||||
geoPos = CCoordinateGeodetic::fromWgs84("50° 2′ 1″ 23 N", "8° 34′ 14″ E", CLength(111, CLengthUnit::m()));
|
||||
testserviceInterface.receiveGeoPosition(geoPos);
|
||||
qDebug() << "Send geo position" << geoPos;
|
||||
|
||||
// Value map
|
||||
qDebug() << "----------------- index variant map ----------------";
|
||||
|
||||
CIndexVariantMap valueMap;
|
||||
valueMap.addValue(1, 111.222);
|
||||
valueMap.addValue(2, callsign);
|
||||
@@ -332,7 +386,8 @@ namespace BlackMiscTest
|
||||
|
||||
// Performance tools
|
||||
QThread::msleep(2500);
|
||||
qDebug() << "--- PERFORMANCE testing";
|
||||
qDebug() << "----------------- performance ----------------";
|
||||
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
for (int i = 0; i < 10; i++)
|
||||
@@ -382,20 +437,20 @@ namespace BlackMiscTest
|
||||
qDebug() << "Reading station objects 10/100/1000 in ms:" << t10 << t100 << t1000;
|
||||
|
||||
timer.restart();
|
||||
AtcStationList = testserviceInterface.getAtcStationList(10);
|
||||
if (AtcStationList.size() != 10) qDebug() << "wrong list size" << AtcStationList.size();
|
||||
atcStationList = testserviceInterface.getAtcStationList(10);
|
||||
if (atcStationList.size() != 10) qDebug() << "wrong list size" << atcStationList.size();
|
||||
t10 = timer.nsecsElapsed() / 1000000; // ms
|
||||
QThread::msleep(1000);
|
||||
|
||||
timer.restart();
|
||||
AtcStationList = testserviceInterface.getAtcStationList(100);
|
||||
if (AtcStationList.size() != 100) qDebug() << "wrong list size" << AtcStationList.size();
|
||||
atcStationList = testserviceInterface.getAtcStationList(100);
|
||||
if (atcStationList.size() != 100) qDebug() << "wrong list size" << atcStationList.size();
|
||||
t100 = timer.nsecsElapsed() / 1000000; // ms
|
||||
QThread::msleep(1000);
|
||||
|
||||
timer.restart();
|
||||
AtcStationList = testserviceInterface.getAtcStationList(1000);
|
||||
if (AtcStationList.size() != 1000) qDebug() << "wrong list size" << AtcStationList.size();
|
||||
atcStationList = testserviceInterface.getAtcStationList(1000);
|
||||
if (atcStationList.size() != 1000) qDebug() << "wrong list size" << atcStationList.size();
|
||||
t1000 = timer.nsecsElapsed() / 1000000; // ms
|
||||
|
||||
qDebug() << "Reading station list 10/100/1000 in ms:" << t10 << t100 << t1000;
|
||||
@@ -420,9 +475,14 @@ namespace BlackMiscTest
|
||||
timer.invalidate();
|
||||
|
||||
// next round?
|
||||
qDebug() << "---------------------------------------";
|
||||
qDebug() << "Key ....... x to exit, pid:" << ServiceTool::getPid();
|
||||
int ch = getchar();
|
||||
if (ch == 'x') loop = false;
|
||||
line = qtin.readLine().toLower().trimmed();
|
||||
if (line.startsWith('x'))
|
||||
{
|
||||
qDebug() << "Ending!";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "blackcore/dbus_server.h"
|
||||
#include "blackmisc/avatcstationlist.h"
|
||||
#include "blackmisc/avairportlist.h"
|
||||
#include "blackmisc/nwclientlist.h"
|
||||
#include <QCoreApplication>
|
||||
#include <QProcess>
|
||||
#include <QDBusConnection>
|
||||
@@ -73,7 +75,7 @@ namespace BlackMiscTest
|
||||
* \brief Get a random callsign
|
||||
* \return
|
||||
*/
|
||||
static BlackMisc::Aviation::CCallsign getRandomCallsign();
|
||||
static BlackMisc::Aviation::CCallsign getRandomAtcCallsign();
|
||||
|
||||
/*!
|
||||
* \brief Get stations
|
||||
@@ -82,6 +84,20 @@ namespace BlackMiscTest
|
||||
*/
|
||||
static BlackMisc::Aviation::CAtcStationList getStations(qint32 number);
|
||||
|
||||
/*!
|
||||
* \brief Get airports
|
||||
* \param number
|
||||
* \return
|
||||
*/
|
||||
static BlackMisc::Aviation::CAirportList getAirports(qint32 number);
|
||||
|
||||
/*!
|
||||
* \brief Get clients
|
||||
* \param number
|
||||
* \return
|
||||
*/
|
||||
static BlackMisc::Network::CClientList getClients(qint32 number);
|
||||
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -60,7 +60,6 @@ namespace BlackMiscTest
|
||||
return speed;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get speed
|
||||
*/
|
||||
@@ -97,14 +96,6 @@ namespace BlackMiscTest
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "Received altitude:" << altitude;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ping altitude
|
||||
*/
|
||||
BlackMisc::Aviation::CAltitude Testservice::pingAltitude(const BlackMisc::Aviation::CAltitude &altitude)
|
||||
{
|
||||
return altitude;
|
||||
}
|
||||
|
||||
/*
|
||||
* Receive matrix
|
||||
*/
|
||||
@@ -192,17 +183,9 @@ namespace BlackMiscTest
|
||||
/*
|
||||
* Receive ATC list
|
||||
*/
|
||||
void Testservice::receiveAtcStationList(const BlackMisc::Aviation::CAtcStationList &AtcStationList) const
|
||||
void Testservice::receiveAtcStationList(const BlackMisc::Aviation::CAtcStationList &atcStationList) const
|
||||
{
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "Received ATC list:" << AtcStationList;
|
||||
}
|
||||
|
||||
/*
|
||||
* Receive ATC list
|
||||
*/
|
||||
BlackMisc::Aviation::CAtcStationList Testservice::pingAtcStationList(const BlackMisc::Aviation::CAtcStationList &AtcStationList) const
|
||||
{
|
||||
return AtcStationList;
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "Received ATC list:" << atcStationList;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -221,14 +204,6 @@ namespace BlackMiscTest
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "Received ATC station:" << station;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ping ATC station
|
||||
*/
|
||||
const BlackMisc::Aviation::CAtcStationList Testservice::getAtcStationList(const qint32 number) const
|
||||
{
|
||||
return BlackMisc::Aviation::CAtcStationList(ServiceTool::getStations(number));
|
||||
}
|
||||
|
||||
/*
|
||||
* Object paths
|
||||
*/
|
||||
@@ -242,11 +217,74 @@ namespace BlackMiscTest
|
||||
return paths;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ping ATC station
|
||||
*/
|
||||
const BlackMisc::Aviation::CAtcStationList Testservice::getAtcStationList(const qint32 number) const
|
||||
{
|
||||
return BlackMisc::Aviation::CAtcStationList(ServiceTool::getStations(number));
|
||||
}
|
||||
|
||||
/*
|
||||
* Ping ATC list
|
||||
*/
|
||||
BlackMisc::Aviation::CAtcStationList Testservice::pingAtcStationList(const BlackMisc::Aviation::CAtcStationList &atcStationList) const
|
||||
{
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "ping ATCs:" << atcStationList;
|
||||
return atcStationList;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ping aircrafts
|
||||
*/
|
||||
CAircraftList Testservice::pingAircraftList(const CAircraftList &aircraftList)
|
||||
{
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "ping ATCs:" << aircraftList;
|
||||
return aircraftList;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ping airports
|
||||
*/
|
||||
CAirportList Testservice::pingAirportList(const CAirportList &airportList)
|
||||
{
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "ping airports:" << airportList;
|
||||
return airportList;
|
||||
}
|
||||
|
||||
/*
|
||||
* NW client
|
||||
*/
|
||||
CClient Testservice::pingClient(const CClient &client)
|
||||
{
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "ping client:" << client;
|
||||
return client;
|
||||
}
|
||||
|
||||
/*
|
||||
* NW clients
|
||||
*/
|
||||
CClientList Testservice::pingClientList(const CClientList &clientList)
|
||||
{
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "ping clients:" << clientList;
|
||||
return clientList;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ping altitude
|
||||
*/
|
||||
BlackMisc::Aviation::CAltitude Testservice::pingAltitude(const BlackMisc::Aviation::CAltitude &altitude)
|
||||
{
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "ping alt:" << altitude;
|
||||
return altitude;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ping ATC station
|
||||
*/
|
||||
BlackMisc::Aviation::CAtcStation Testservice::pingAtcStation(const BlackMisc::Aviation::CAtcStation &station)
|
||||
{
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "ping ATC:" << station;
|
||||
return station;
|
||||
}
|
||||
|
||||
@@ -255,6 +293,19 @@ namespace BlackMiscTest
|
||||
*/
|
||||
BlackMisc::Aviation::CAircraft Testservice::pingAircraft(const BlackMisc::Aviation::CAircraft &aircraft)
|
||||
{
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "ping aircraft:" << aircraft;
|
||||
return aircraft;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ping variant
|
||||
*/
|
||||
BlackMisc::CVariant Testservice::pingCVariant(const BlackMisc::Network::CClient &client)
|
||||
{
|
||||
// we receive as QVariant, but return as CVariant!
|
||||
qDebug() << "Pid:" << ServiceTool::getPid() << "client sent back as CVariant:" << client.toQString();
|
||||
return BlackMisc::CVariant::fromValue(client);
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#undef interface
|
||||
|
||||
#include "blackmisc/avallclasses.h"
|
||||
#include "blackmisc/networkallclasses.h"
|
||||
#include "blackmisc/pqallquantities.h"
|
||||
#include "blackmisc/mathallclasses.h"
|
||||
#include "servicetool.h"
|
||||
@@ -27,18 +28,10 @@ namespace BlackMiscTest
|
||||
{
|
||||
|
||||
/*!
|
||||
* Testservice for PQ DBus tests. Needs to re-generate the introspection xml file
|
||||
* (qdbuscpp2xml) when new slots have been added.
|
||||
* Testservice for PQ / CValueObject DBus tests
|
||||
*/
|
||||
class Testservice : public QObject
|
||||
{
|
||||
// see the readme.txt on how to qdbuscpp2xml
|
||||
// remember to recompile the plugin when new class have been createdand registered
|
||||
// http://techbase.kde.org/Development/Tutorials/D-Bus/CustomTypes#Write_a_class
|
||||
// https://dev.vatsim-germany.org/projects/vatpilotclient/wiki/DBusExample
|
||||
// http://qt-project.org/doc/qt-4.8/examples-dbus.html
|
||||
// http://dbus.freedesktop.org/doc/dbus-tutorial.html#meta
|
||||
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKMISCKTEST_TESTSERVICE_INTERFACENAME)
|
||||
|
||||
@@ -73,12 +66,6 @@ namespace BlackMiscTest
|
||||
*/
|
||||
void receiveSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed);
|
||||
|
||||
/*!
|
||||
* \brief Receive speed
|
||||
* \param speed
|
||||
*/
|
||||
BlackMisc::PhysicalQuantities::CSpeed pingSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed);
|
||||
|
||||
/*!
|
||||
* \brief Receive com unit
|
||||
* \param comUnit
|
||||
@@ -91,12 +78,6 @@ namespace BlackMiscTest
|
||||
*/
|
||||
void receiveAltitude(const BlackMisc::Aviation::CAltitude &altitude);
|
||||
|
||||
/*!
|
||||
* \brief Receive altitude
|
||||
* \param comUnit
|
||||
*/
|
||||
BlackMisc::Aviation::CAltitude pingAltitude(const BlackMisc::Aviation::CAltitude &altitude);
|
||||
|
||||
/*!
|
||||
* \brief Receive matrix
|
||||
* \param matrix
|
||||
@@ -151,6 +132,37 @@ namespace BlackMiscTest
|
||||
*/
|
||||
void receiveAtcStation(const BlackMisc::Aviation::CAtcStation &station) const;
|
||||
|
||||
/*!
|
||||
* \brief Receive callsign
|
||||
* \param callsign
|
||||
*/
|
||||
void receiveCallsign(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Receive ATC list
|
||||
* \param atcStationList
|
||||
*/
|
||||
void receiveAtcStationList(const BlackMisc::Aviation::CAtcStationList &atcStationList) const;
|
||||
|
||||
/*!
|
||||
* \brief Receive an value map
|
||||
* \param valueMap
|
||||
*/
|
||||
void receiveValueMap(const BlackMisc::CIndexVariantMap &valueMap) const;
|
||||
|
||||
/*!
|
||||
* \brief Receive speed
|
||||
* \param speed
|
||||
*/
|
||||
BlackMisc::PhysicalQuantities::CSpeed pingSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed);
|
||||
|
||||
/*!
|
||||
* \brief Receive altitude
|
||||
* \param comUnit
|
||||
*/
|
||||
BlackMisc::Aviation::CAltitude pingAltitude(const BlackMisc::Aviation::CAltitude &altitude);
|
||||
|
||||
/*!
|
||||
* \brief Ping ATC station
|
||||
* \param station
|
||||
@@ -165,10 +177,58 @@ namespace BlackMiscTest
|
||||
BlackMisc::Aviation::CAircraft pingAircraft(const BlackMisc::Aviation::CAircraft &aircraft);
|
||||
|
||||
/*!
|
||||
* \brief Receive callsign
|
||||
* \param callsign
|
||||
* \brief Ping ATC list
|
||||
* \param atcStationList
|
||||
* \return
|
||||
*/
|
||||
void receiveCallsign(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
BlackMisc::Aviation::CAtcStationList pingAtcStationList(const BlackMisc::Aviation::CAtcStationList &atcStationList) const;
|
||||
|
||||
/*!
|
||||
* \brief Ping aircrafts list
|
||||
* \param aircraftList
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Aviation::CAircraftList pingAircraftList(const BlackMisc::Aviation::CAircraftList &aircraftList);
|
||||
|
||||
/*!
|
||||
* \brief Ping airports list
|
||||
* \param airportList
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Aviation::CAirportList pingAirportList(const BlackMisc::Aviation::CAirportList &airportList);
|
||||
|
||||
/*!
|
||||
* \brief Ping client
|
||||
* \param client
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Network::CClient pingClient(const BlackMisc::Network::CClient &client);
|
||||
|
||||
/*!
|
||||
* \brief Ping NW clients list
|
||||
* \param clientList
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Network::CClientList pingClientList(const BlackMisc::Network::CClientList &clientList);
|
||||
|
||||
/*!
|
||||
* \brief Ping CVariant
|
||||
* \param variant
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::CVariant pingCVariant(const BlackMisc::Network::CClient &client);
|
||||
|
||||
/*!
|
||||
* \brief Get speed
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::PhysicalQuantities::CSpeed getSpeed() const;
|
||||
|
||||
/*!
|
||||
* \brief Get station
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Aviation::CAtcStation getAtcStation() const;
|
||||
|
||||
/*!
|
||||
* \brief return n ATC stations
|
||||
@@ -184,37 +244,6 @@ namespace BlackMiscTest
|
||||
*/
|
||||
const QList<QDBusObjectPath> getObjectPaths(const qint32 number) const;
|
||||
|
||||
/*!
|
||||
* \brief Receive ATC list
|
||||
* \param AtcStationList
|
||||
*/
|
||||
void receiveAtcStationList(const BlackMisc::Aviation::CAtcStationList &AtcStationList) const;
|
||||
|
||||
/*!
|
||||
* \brief Receive an value map
|
||||
* \param valueMap
|
||||
*/
|
||||
void receiveValueMap(const BlackMisc::CIndexVariantMap &valueMap) const;
|
||||
|
||||
/*!
|
||||
* \brief Ping atc list
|
||||
* \param AtcStationList
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Aviation::CAtcStationList pingAtcStationList(const BlackMisc::Aviation::CAtcStationList &AtcStationList) const;
|
||||
|
||||
/*!
|
||||
* \brief Get speed
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::PhysicalQuantities::CSpeed getSpeed() const;
|
||||
|
||||
/*!
|
||||
* \brief Get station
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Aviation::CAtcStation getAtcStation() const;
|
||||
|
||||
public:
|
||||
static const QString ServiceName;
|
||||
static const QString ServicePath;
|
||||
|
||||
@@ -83,10 +83,10 @@ namespace BlackMiscTest
|
||||
return asyncCallWithArgumentList(QLatin1String("pingAircraft"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<BlackMisc::Aviation::CAtcStationList> pingAtcStationList(BlackMisc::Aviation::CAtcStationList AtcStationList)
|
||||
inline QDBusPendingReply<BlackMisc::Aviation::CAtcStationList> pingAtcStationList(BlackMisc::Aviation::CAtcStationList atcStationList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(AtcStationList);
|
||||
argumentList << QVariant::fromValue(atcStationList);
|
||||
return asyncCallWithArgumentList(QLatin1String("pingAtcStationList"), argumentList);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,42 @@ namespace BlackMiscTest
|
||||
return asyncCallWithArgumentList(QLatin1String("pingSpeed"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> receiveAltitude(BlackMisc::Aviation::CAltitude altitude)
|
||||
inline QDBusPendingReply<BlackMisc::Aviation::CAircraftList> pingAircraftList(BlackMisc::Aviation::CAircraftList aircraftList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << aircraftList.toQVariant();
|
||||
return asyncCallWithArgumentList(QLatin1String("pingAircraftList"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<BlackMisc::Aviation::CAirportList> pingAirportList(BlackMisc::Aviation::CAirportList airportList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << airportList.toQVariant();
|
||||
return asyncCallWithArgumentList(QLatin1String("pingAirportList"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<BlackMisc::Network::CClientList> pingClientList(BlackMisc::Network::CClientList clientList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << clientList.toQVariant();
|
||||
return asyncCallWithArgumentList(QLatin1String("pingClientList"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<BlackMisc::Network::CClient> pingClient(BlackMisc::Network::CClient client)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << client.toQVariant();
|
||||
return asyncCallWithArgumentList(QLatin1String("pingClient"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<BlackMisc::CVariant> pingCVariant(BlackMisc::Network::CClient client)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << client.toQVariant();
|
||||
return asyncCallWithArgumentList(QLatin1String("pingCVariant"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<BlackMisc::Aviation::CAltitude> receiveAltitude(BlackMisc::Aviation::CAltitude altitude)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(altitude);
|
||||
|
||||
Reference in New Issue
Block a user