mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refs #875, adjusted servicetool (DBus samples)
* use functions from blackcore/test * show signatures
This commit is contained in:
committed by
Mathew Sutcliffe
parent
9beb6c79e1
commit
f2e49987e0
@@ -12,8 +12,9 @@
|
||||
|
||||
#include "blackmisc/dbusserver.h"
|
||||
#include "blackmisc/registermetadata.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
#include "blackcore/test/testutils.h"
|
||||
#include "servicetool.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QDBusServer>
|
||||
@@ -33,6 +34,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
BlackMisc::registerMetadata();
|
||||
QCoreApplication a(argc, argv);
|
||||
QTextStream out(stdout, QIODevice::WriteOnly);
|
||||
QTextStream qtin(stdin);
|
||||
const bool verbose = false;
|
||||
|
||||
// trying to get the arguments into a list
|
||||
const QStringList cmdlineArgs = QCoreApplication::arguments();
|
||||
@@ -69,19 +73,34 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Create a Testservice instance and register it with the session bus only if
|
||||
// the service isn't already available.
|
||||
if (!clientFlag)
|
||||
if (clientFlag)
|
||||
{
|
||||
// 2nd Process !!! Running on the client's side
|
||||
// This runs in a second process, hence cannot be directly debugged within Qt Creators
|
||||
out << "Running client side " << QCoreApplication::applicationPid() << endl;
|
||||
|
||||
// run tests
|
||||
if (cmdlineArgs.contains("testservice", Qt::CaseInsensitive))
|
||||
{
|
||||
BlackSample::ServiceTool::dataTransferTestClient(address);
|
||||
}
|
||||
|
||||
// loop
|
||||
return a.exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Configure tests
|
||||
Menu:
|
||||
qDebug() << "1 .. Run testservice to test data transfer" << addressTcp;
|
||||
qDebug() << "1sb. Run testservice via session bus";
|
||||
qDebug() << "----- Change address / port (no validation, do before starting server)";
|
||||
qDebug() << "loop Address to loopback, 127.0.0.1";
|
||||
qDebug() << "ip some IP address, e.g 192.168.100.100";
|
||||
qDebug() << "port some port, e.g 12345";
|
||||
qDebug() << "-----";
|
||||
qDebug() << "x .. Bye";
|
||||
QTextStream qtin(stdin);
|
||||
out << "Pid: " << QCoreApplication::applicationPid() << endl;
|
||||
out << "1 .. Run testservice to test data transfer" << addressTcp << endl;
|
||||
out << "1sb. Run testservice via session bus" << endl;
|
||||
out << "2 .. Show signatures" << endl;
|
||||
out << "----- Change address / port (no validation, do before starting server)" << endl;
|
||||
out << "loop Address to loopback, 127.0.0.1" << endl;
|
||||
out << "ip some IP address, e.g " << ip << endl;
|
||||
out << "port some port, e.g 12345" << endl;
|
||||
out << "-----" << endl;
|
||||
out << "x .. Bye" << endl;
|
||||
QString mode = qtin.readLine().toLower().trimmed();
|
||||
|
||||
if (mode.startsWith("l"))
|
||||
@@ -92,7 +111,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
if (mode.startsWith("i"))
|
||||
{
|
||||
QStringList p = mode.split(QRegExp("\\s"));
|
||||
const QStringList p = mode.split(QRegExp("\\s"));
|
||||
if (p.length() > 1)
|
||||
{
|
||||
ip = p.at(1);
|
||||
@@ -102,7 +121,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
if (mode.startsWith("p"))
|
||||
{
|
||||
QStringList p = mode.split(QRegExp("\\s"));
|
||||
const QStringList p = mode.split(QRegExp("\\s"));
|
||||
if (p.length() > 1)
|
||||
{
|
||||
port = p.at(1);
|
||||
@@ -110,6 +129,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
goto Menu;
|
||||
}
|
||||
if (mode.startsWith("2"))
|
||||
{
|
||||
out << "---------------------------------" << endl;
|
||||
BlackCore::Test::CTestUtils::showDBusSignatures(out);
|
||||
out << "---------------------------------" << endl;
|
||||
goto Menu;
|
||||
}
|
||||
|
||||
// start DBus
|
||||
address = QString(useSessionBusForServer ? "session" : addressTcp); // testing with real transfer
|
||||
@@ -125,13 +151,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
// I know I am in the "server process here", so I can safely create a CDBusServer
|
||||
// this runs in the original process and can be directly debugged
|
||||
qDebug();
|
||||
qDebug("--------------------------------------------------------");
|
||||
out << "--------------------------------------------------------" << endl;
|
||||
|
||||
BlackMisc::CDBusServer *dBusServer = new BlackMisc::CDBusServer(useSessionBusForServer ? "session" : address);
|
||||
if (dBusServer->hasQDBusServer())
|
||||
{
|
||||
qDebug() << "server" << dBusServer->qDBusServer()->address() << "connected:" << dBusServer->qDBusServer()->isConnected();
|
||||
out << "server" << dBusServer->qDBusServer()->address() <<
|
||||
" connected:" << dBusServer->qDBusServer()->isConnected() << endl;
|
||||
}
|
||||
// start client process
|
||||
QStringList args;
|
||||
@@ -139,7 +165,7 @@ int main(int argc, char *argv[])
|
||||
args << mode;
|
||||
if (address == "session")
|
||||
{
|
||||
args << address; // set session as cmd arg
|
||||
args << "session"; // set session as cmd arg
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -150,29 +176,15 @@ int main(int argc, char *argv[])
|
||||
// run tests
|
||||
if (mode == "testservice")
|
||||
{
|
||||
BlackSample::ServiceTool::dataTransferTestServer(dBusServer);
|
||||
BlackSample::ServiceTool::dataTransferTestServer(dBusServer, verbose);
|
||||
}
|
||||
|
||||
// in new process
|
||||
// testing in new process
|
||||
BlackSample::ServiceTool::startNewProcess(executable, args, &a);
|
||||
|
||||
// in same process
|
||||
// testing in same process
|
||||
// BlackSample::ServiceTool::dataTransferTestClient(address);
|
||||
|
||||
// loop
|
||||
return a.exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 2nd Process !!! Running on the client's side
|
||||
// This runs in a second process, hence cannot be directly debugged within Qt Creators
|
||||
|
||||
// run tests
|
||||
if (cmdlineArgs.contains("testservice", Qt::CaseInsensitive))
|
||||
{
|
||||
BlackSample::ServiceTool::dataTransferTestClient(address);
|
||||
}
|
||||
|
||||
// loop
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
@@ -11,38 +11,12 @@
|
||||
//! \ingroup sampleblackmiscdbus
|
||||
|
||||
#include "servicetool.h"
|
||||
#include "testservice.h"
|
||||
#include "testserviceinterface.h"
|
||||
#include "blackmisc/aviation/aircrafticaocode.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/aviation/airport.h"
|
||||
#include "blackmisc/aviation/altitude.h"
|
||||
#include "blackmisc/aviation/atcstation.h"
|
||||
#include "blackmisc/aviation/comsystem.h"
|
||||
#include "blackmisc/aviation/track.h"
|
||||
#include "blackmisc/aviation/transponder.h"
|
||||
#include "blackmisc/compare.h"
|
||||
#include "blackcore/application.h"
|
||||
#include "blackcore/test/testservice.h"
|
||||
#include "blackcore/test/testserviceinterface.h"
|
||||
#include "blackcore/test/testutils.h"
|
||||
#include "blackmisc/dbusserver.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/iterator.h"
|
||||
#include "blackmisc/network/client.h"
|
||||
#include "blackmisc/network/server.h"
|
||||
#include "blackmisc/network/user.h"
|
||||
#include "blackmisc/pq/constants.h"
|
||||
#include "blackmisc/pq/frequency.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/pq/speed.h"
|
||||
#include "blackmisc/pq/units.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/propertyindexvariantmap.h"
|
||||
#include "blackmisc/sequence.h"
|
||||
#include "blackmisc/simulation/aircraftmodel.h"
|
||||
#include "blackmisc/simulation/fscommon/aircraftcfgentries.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
#include "blackmisc/variant.h"
|
||||
#include "blackmisc/variantlist.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -69,8 +43,6 @@
|
||||
#include <QVariant>
|
||||
#include <QtDebug>
|
||||
|
||||
class QDBusObjectPath;
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
@@ -79,6 +51,8 @@ using namespace BlackMisc::Math;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
using namespace BlackCore;
|
||||
using namespace BlackCore::Test;
|
||||
|
||||
namespace BlackSample
|
||||
{
|
||||
@@ -89,413 +63,160 @@ namespace BlackSample
|
||||
return process;
|
||||
}
|
||||
|
||||
void ServiceTool::displayQDBusArgument(const QDBusArgument &arg, qint32 level)
|
||||
{
|
||||
arg.beginArray();
|
||||
QVariant qv;
|
||||
QString indent(level * 2, ' ');
|
||||
|
||||
while (!arg.atEnd())
|
||||
{
|
||||
QDBusArgument::ElementType type = arg.currentType();
|
||||
QString signature = arg.currentSignature();
|
||||
qv = arg.asVariant(); // this advances in the stream
|
||||
if (qv.canConvert<QDBusArgument>())
|
||||
{
|
||||
qDebug() << indent << type << "signature" << signature;
|
||||
ServiceTool::displayQDBusArgument(qv.value<QDBusArgument>(), level + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << indent << "type:" << type << "signature" << signature << "value" << qv;
|
||||
}
|
||||
}
|
||||
arg.endArray();
|
||||
}
|
||||
|
||||
void ServiceTool::dataTransferTestServer(BlackMisc::CDBusServer *dBusServer)
|
||||
void ServiceTool::dataTransferTestServer(BlackMisc::CDBusServer *dBusServer, bool verbose)
|
||||
{
|
||||
QDBusConnection sessionBusConnection = QDBusConnection::sessionBus();
|
||||
if (sessionBusConnection.interface()->isServiceRegistered(Testservice::InterfaceName))
|
||||
if (sessionBusConnection.interface()->isServiceRegistered(CTestService::InterfaceName()))
|
||||
{
|
||||
qFatal("Testservice already registed on session bus");
|
||||
}
|
||||
|
||||
// as this is the receiver side, the slots can be debugged too
|
||||
Testservice *testservice = ServiceTool::registerTestservice(sessionBusConnection, QCoreApplication::instance());
|
||||
dBusServer->addObject(Testservice::ObjectPath, testservice);
|
||||
CTestService *testService = CTestService::registerTestService(sessionBusConnection, verbose, QCoreApplication::instance());
|
||||
dBusServer->addObject(CTestService::ObjectPath(), testService);
|
||||
}
|
||||
|
||||
void ServiceTool::dataTransferTestClient(const QString &address)
|
||||
{
|
||||
// send data as P2P to server (this can be session bus, too, but usually is P2P)
|
||||
bool sb = (address.toLower().startsWith("session"));
|
||||
QDBusConnection p2pConnection = sb ?
|
||||
QDBusConnection::sessionBus() :
|
||||
QDBusConnection::connectToPeer(address, "p2pConnection");
|
||||
const bool sb = (address.toLower().startsWith("session"));
|
||||
QDBusConnection connection = 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() << "address:" << address;
|
||||
qDebug() << "name:" << p2pConnection.name();
|
||||
qDebug() << "------------ connection info ---------------";
|
||||
// qtout << "server connection has interface? " << connection.interface(); // returns 0 with server and a real interface with session bus
|
||||
// qtout << "address: " << address;
|
||||
// qtout << "name: " << connection.name();
|
||||
|
||||
ServiceTool::sendDataToTestservice(p2pConnection);
|
||||
}
|
||||
|
||||
CCallsign ServiceTool::getRandomAtcCallsign()
|
||||
{
|
||||
static QList<CCallsign> callsigns;
|
||||
if (callsigns.isEmpty())
|
||||
{
|
||||
callsigns << CCallsign("EDDM_TWR");
|
||||
callsigns << CCallsign("EDDM_APP");
|
||||
callsigns << CCallsign("EDDM_GND");
|
||||
callsigns << CCallsign("EDDF_TWR");
|
||||
callsigns << CCallsign("EDDF_APP");
|
||||
callsigns << CCallsign("EDDF_GND");
|
||||
}
|
||||
int i = (rand() % (callsigns.size()));
|
||||
CCallsign cs = callsigns.at(i);
|
||||
return cs;
|
||||
}
|
||||
|
||||
CAtcStationList ServiceTool::getStations(int number)
|
||||
{
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
|
||||
BlackMisc::Aviation::CAtcStationList list;
|
||||
for (int i = 0; i < number; i++)
|
||||
{
|
||||
BlackMisc::Aviation::CAtcStation s;
|
||||
s.setCallsign(QString::number(i));
|
||||
s.setFrequency(BlackMisc::PhysicalQuantities::CFrequency(i, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz()));
|
||||
s.setController(CUser(QString::number(i), "FooBar", "", ""));
|
||||
s.setOnline(i % 2 == 0 ? true : false);
|
||||
s.setPosition(CCoordinateGeodetic(i, i, i));
|
||||
list.push_back(s);
|
||||
}
|
||||
|
||||
qDebug() << number << "stations in" << timer.nsecsElapsed() / 1000000; // ms
|
||||
return list;
|
||||
}
|
||||
|
||||
CAircraftCfgEntriesList ServiceTool::getAircraftCfgEntries(int number)
|
||||
{
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
|
||||
CAircraftCfgEntriesList list;
|
||||
for (int i = 0; i < number; i++)
|
||||
{
|
||||
CAircraftCfgEntries e;
|
||||
e.setAtcModel("atc model");
|
||||
e.setAtcParkingCode(QString::number(i));
|
||||
e.setIndex(i);
|
||||
e.setFileName("this will be the file path and pretty long");
|
||||
e.setTitle("i am the aircraft title foobar");
|
||||
e.setAtcType("B737");
|
||||
list.push_back(e);
|
||||
}
|
||||
|
||||
qDebug() << number << "aircraft entries in" << timer.nsecsElapsed() / 1000000; // ms
|
||||
return list;
|
||||
}
|
||||
|
||||
CAirportList ServiceTool::getAirports(int 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(int 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::FsdWithIcaoCodes);
|
||||
const QString myFooModel = QString("fooModel %1").arg(i);
|
||||
client.setQueriedModelString(myFooModel);
|
||||
list.push_back(client);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
Testservice *ServiceTool::registerTestservice(QDBusConnection &connection, QObject *parent)
|
||||
{
|
||||
Testservice *pTestservice = new Testservice(parent); // just a QObject with signals / slots and Q_CLASSINFO("D-Bus Interface", some service name)
|
||||
if (!connection.registerService(Testservice::InterfaceName))
|
||||
{
|
||||
QDBusError err = connection.lastError();
|
||||
qWarning() << err.message();
|
||||
qWarning() << "Started dbus-daemon.exe --session (Windows)?";
|
||||
qWarning() << "Created directory session.d (e.g. ../Qt/Qt5.1.0Vatsim/5.1.0-32/qtbase/etc/dbus-1/session.d)?";
|
||||
qWarning() << "See https://dev.vatsim-germany.org/projects/vatpilotclient/wiki/DBusExample#Running-the-example";
|
||||
qFatal("Could not register service!");
|
||||
}
|
||||
|
||||
if (!connection.registerObject(Testservice::ObjectPath, pTestservice, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals | QDBusConnection::ExportAdaptors))
|
||||
{
|
||||
qFatal("Could not register service object!");
|
||||
}
|
||||
|
||||
qDebug() << "Registration running as pid:" << ServiceTool::getPid();
|
||||
if (pTestservice) qDebug() << "Service registered";
|
||||
|
||||
QString service; // service not needed
|
||||
if (connection.connect(
|
||||
service, Testservice::ObjectPath, Testservice::InterfaceName,
|
||||
"sendStringMessage", pTestservice, SLOT(receiveStringMessage(const QString &))))
|
||||
{
|
||||
qDebug() << "Connected object with bus sendStringMessage";
|
||||
}
|
||||
else
|
||||
{
|
||||
qFatal("Cannot connect service with DBus");
|
||||
}
|
||||
return pTestservice;
|
||||
ServiceTool::sendDataToTestservice(connection);
|
||||
}
|
||||
|
||||
void ServiceTool::sendDataToTestservice(const QDBusConnection &connection)
|
||||
{
|
||||
// on the client's side
|
||||
TestServiceInterface testserviceInterface(Testservice::InterfaceName, Testservice::ObjectPath, connection);
|
||||
|
||||
CSpeed speed(200, CSpeedUnit::km_h());
|
||||
CSpeed speedNull(0, nullptr);
|
||||
CAltitude al(1000, CAltitude::MeanSeaLevel, CLengthUnit::ft());
|
||||
ITestServiceInterface testServiceInterface(CTestService::InterfaceName(), CTestService::ObjectPath(), connection);
|
||||
QTextStream qtin(stdin);
|
||||
QTextStream qtout(stdout);
|
||||
QString line;
|
||||
|
||||
while (true)
|
||||
{
|
||||
QDBusMessage m = QDBusMessage::createSignal(
|
||||
Testservice::ObjectPath, Testservice::InterfaceName,
|
||||
CTestService::ObjectPath(), CTestService::InterfaceName(),
|
||||
"sendStringMessage");
|
||||
|
||||
// The << operator is used to add the parameters for the slot
|
||||
QDateTime dtnow = QDateTime::currentDateTimeUtc();
|
||||
QString msg = QString("Message from %1 at %2").arg(ServiceTool::getPid()).arg(dtnow.toString("MM/dd/yyyy @ hh:mm:ss"));
|
||||
const QDateTime dtnow = QDateTime::currentDateTimeUtc();
|
||||
const QString msg = QString("Message at %1").arg(dtnow.toString("MM/dd/yyyy @ hh:mm:ss"));
|
||||
m << msg;
|
||||
|
||||
// We send this as a non-replying message. This is used for sending errors, replys, signals,
|
||||
// and method calls (slots) that don't return
|
||||
if (connection.send(m)) { qDebug() << "Send via low level method" << m; }
|
||||
// We send this as a non-replying message. This is used for sending errors, replys, signals.
|
||||
// Values can be seen on the receiver side
|
||||
qtout << "----------------- receiver tests ----------------" << endl;
|
||||
|
||||
// Low level test
|
||||
if (connection.send(m)) { qtout << "Send via low level method " << endl; }
|
||||
|
||||
// same as interface message
|
||||
// but call the slot
|
||||
testserviceInterface.receiveStringMessage(msg);
|
||||
qDebug() << "Send string via interface" << msg;
|
||||
testServiceInterface.receiveStringMessage(msg);
|
||||
qtout << "Send string via interface " << msg << endl;
|
||||
|
||||
// a list
|
||||
QList<double> list;
|
||||
list << 1.0 << 2.0 << 3.0;
|
||||
testserviceInterface.receiveList(list);
|
||||
qDebug() << "Send list via interface" << list;
|
||||
testServiceInterface.receiveList(list);
|
||||
qtout << "Send list via interface " << list.size() << endl;
|
||||
|
||||
// PQs
|
||||
testserviceInterface.receiveSpeed(speed);
|
||||
qDebug() << "Send speed via interface" << speed;
|
||||
testserviceInterface.receiveSpeed(speedNull);
|
||||
qDebug() << "Send null speed via interface" << speedNull;
|
||||
CSpeed speed(200, CSpeedUnit::km_h());
|
||||
const CSpeed speedNull(0, nullptr);
|
||||
|
||||
testServiceInterface.receiveSpeed(speed);
|
||||
qtout << "Send speed via interface " << speed << endl;
|
||||
testServiceInterface.receiveSpeed(speedNull);
|
||||
qtout << "Send null speed via interface " << speedNull << endl;
|
||||
speed.switchUnit(CSpeedUnit::kts());
|
||||
testserviceInterface.receiveSpeed(speed);
|
||||
qDebug() << "Send speed via interface" << speed;
|
||||
testServiceInterface.receiveSpeed(speed);
|
||||
qtout << "Send speed via interface " << speed << endl;
|
||||
QThread::msleep(2500);
|
||||
speed.switchUnit(CSpeedUnit::km_h());
|
||||
speed.addValueSameUnit(1.0);
|
||||
|
||||
// Network
|
||||
CServer trafficServer("fooserver", "a foo server", "localhost", 1234,
|
||||
CUser("112233", "Some real name", "email@xyz.com", "secret"));
|
||||
const CServer trafficServer("fooserver", "a foo server", "localhost", 1234,
|
||||
CUser("112233", "Some real name", "email@xyz.com", "secret"));
|
||||
QVariant tsqv = QVariant::fromValue(trafficServer);
|
||||
QDBusVariant tsv(tsqv);
|
||||
testserviceInterface.receiveVariant(tsv, tsqv.userType());
|
||||
qDebug() << "Send server via interface and variant" << trafficServer << tsqv.userType();
|
||||
testServiceInterface.receiveVariant(tsv, tsqv.userType());
|
||||
qtout << "Send server via interface and variant " << trafficServer << tsqv.userType() << endl;
|
||||
|
||||
// Aviation
|
||||
CComSystem comSystem = CComSystem("DBUS COM1", CPhysicalQuantitiesConstants::FrequencyInternationalAirDistress(), CPhysicalQuantitiesConstants::FrequencyUnicom());
|
||||
testserviceInterface.receiveComUnit(comSystem);
|
||||
qDebug() << "Send COM via interface" << comSystem;
|
||||
const CComSystem comSystem = CComSystem("DBUS COM1", CPhysicalQuantitiesConstants::FrequencyInternationalAirDistress(), CPhysicalQuantitiesConstants::FrequencyUnicom());
|
||||
testServiceInterface.receiveComUnit(comSystem);
|
||||
qtout << "Send COM via interface " << comSystem << endl;
|
||||
|
||||
QVariant qvAl = QVariant::fromValue(al);
|
||||
CAltitude altitude(1000, CAltitude::MeanSeaLevel, CLengthUnit::ft());
|
||||
QVariant qvAl = QVariant::fromValue(altitude);
|
||||
QDBusVariant qv(qvAl);
|
||||
testserviceInterface.receiveVariant(qv, qvAl.userType());
|
||||
testserviceInterface.receiveAltitude(al);
|
||||
qDebug() << "Send altitude via interface and variant" << al << qvAl.userType();
|
||||
al.addValueSameUnit(1);
|
||||
testServiceInterface.receiveVariant(qv, qvAl.userType());
|
||||
testServiceInterface.receiveAltitude(altitude);
|
||||
qtout << "Send altitude via interface and variant " << altitude << qvAl.userType() << endl;
|
||||
altitude.addValueSameUnit(1);
|
||||
|
||||
CTransponder transponder(7000, CTransponder::ModeC);
|
||||
testserviceInterface.receiveTransponder(transponder);
|
||||
qDebug() << "Send transponder via interface" << transponder;
|
||||
const CTransponder transponder(7000, CTransponder::ModeC);
|
||||
testServiceInterface.receiveTransponder(transponder);
|
||||
qtout << "Send transponder via interface " << transponder << endl;
|
||||
|
||||
CTrack track(123.45, CTrack::Magnetic, CAngleUnit::deg());
|
||||
testserviceInterface.receiveTrack(track);
|
||||
qDebug() << "Send track via interface" << track;
|
||||
const CTrack track(123.45, CTrack::Magnetic, CAngleUnit::deg());
|
||||
testServiceInterface.receiveTrack(track);
|
||||
qtout << "Send track via interface " << track << endl;
|
||||
|
||||
CLength len(33, CLengthUnit::m());
|
||||
testserviceInterface.receiveLength(len);
|
||||
qDebug() << "Send length via interface" << len;
|
||||
const CLength len(33, CLengthUnit::m());
|
||||
testServiceInterface.receiveLength(len);
|
||||
qtout << "Send length via interface " << len << endl;
|
||||
|
||||
CAltitude alt(44, CAltitude::MeanSeaLevel, CLengthUnit::m());
|
||||
testserviceInterface.receiveLength(alt);
|
||||
qDebug() << "Send altitude via interface" << alt;
|
||||
const CAltitude alt(44, CAltitude::MeanSeaLevel, CLengthUnit::m());
|
||||
testServiceInterface.receiveLength(alt);
|
||||
qtout << "Send altitude via interface " << alt << endl;
|
||||
|
||||
CCallsign callsign("d-ambz");
|
||||
testserviceInterface.receiveCallsign(callsign);
|
||||
qDebug() << "Send callsign via interface" << callsign;
|
||||
const CCallsign callsign("d-ambz");
|
||||
testServiceInterface.receiveCallsign(callsign);
|
||||
qtout << "Send callsign via interface " << callsign << endl;
|
||||
|
||||
CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() }); // Munich
|
||||
CAtcStation station(CCallsign("eddm_twr"), CUser("123456", "Joe Controller"),
|
||||
CFrequency(118.7, CFrequencyUnit::MHz()),
|
||||
geoPos, CLength(50, CLengthUnit::km()));
|
||||
|
||||
testserviceInterface.receiveAtcStation(station);
|
||||
qDebug() << "Send ATC" << station;
|
||||
testServiceInterface.receiveAtcStation(station);
|
||||
qtout << "Send ATC " << station << endl;
|
||||
|
||||
// Geo
|
||||
// EDDF: 50° 2′ 0″ N, 8° 34′ 14″ E, 100m MSL
|
||||
geoPos = CCoordinateGeodetic::fromWgs84("50° 2′ 1″ 23 N", "8° 34′ 14″ E", { 111, CLengthUnit::m() });
|
||||
testserviceInterface.receiveGeoPosition(geoPos);
|
||||
qDebug() << "Send geo position" << geoPos;
|
||||
testServiceInterface.receiveGeoPosition(geoPos);
|
||||
qtout << "Send geo position " << geoPos << endl;
|
||||
|
||||
qDebug() << "----------------- pings ----------------";
|
||||
CPropertyIndex pi({ 1000, 2000, 3000, 4000, 5000}); // numbers >= global index
|
||||
pi = testserviceInterface.pingPropertyIndex(pi);
|
||||
qDebug() << "Pinged property index via interface" << pi;
|
||||
|
||||
CPropertyIndexVariantMap ivm;
|
||||
ivm.addValue(1000, "one");
|
||||
ivm.addValue(2000, "two");
|
||||
ivm.addValue(3000, "three");
|
||||
ivm = testserviceInterface.pingIndexVariantMap(ivm);
|
||||
qDebug() << "Pinged variant map via interface" << ivm;
|
||||
|
||||
CSimulatorPluginInfo pluginInfo("fsx", "FSX Simulator", "FSX", "Flight Simulator X", true);
|
||||
CSimulatorPluginInfo pluginInfoReceived = testserviceInterface.pingPluginInfo(pluginInfo);
|
||||
qDebug() << "Pinged info via interface"
|
||||
<< ((pluginInfo == pluginInfoReceived) ? "OK" : "------------- ERROR! ------------") << pluginInfoReceived;
|
||||
|
||||
CSpeed speedNotNull(22, CSpeedUnit::m_s());
|
||||
speedNull = CSpeed(0, CSpeedUnit::nullUnit());
|
||||
speed = testserviceInterface.pingSpeed(speedNotNull);
|
||||
qDebug() << "Pinged not null speed via interface"
|
||||
<< ((speedNotNull == speed) ? "OK" : "------------- ERROR! ------------") << speed;
|
||||
speed = testserviceInterface.pingSpeed(speedNull);
|
||||
qDebug() << "Pinged null speed via interface"
|
||||
<< ((speedNull == speed) ? "OK" : "------------- ERROR! ------------") << speed;
|
||||
|
||||
CAtcStation stationReceived = testserviceInterface.pingAtcStation(station);
|
||||
qDebug() << "Pinged ATC station via interface"
|
||||
<< ((station == stationReceived) ? "OK" : "------------- ERROR! ------------") << stationReceived;
|
||||
|
||||
CAircraftIcaoCode icaoData("B737", "L2J");
|
||||
CAircraftIcaoCode icaoReceived = testserviceInterface.pingAircraftIcaoData(icaoData);
|
||||
qDebug() << "Pinged ICAO data via interface"
|
||||
<< ((icaoData == icaoReceived) ? "OK" : "------------- ERROR! ------------") << icaoReceived;
|
||||
qDebug() << icaoData << icaoReceived;
|
||||
|
||||
CUser pingUser("223344", "Ping Me User");
|
||||
CUser userReceived = testserviceInterface.pingUser(pingUser);
|
||||
qDebug() << "Pinged user via interface"
|
||||
<< ((userReceived == pingUser) ? "OK" : "------------- ERROR! ------------") << userReceived;
|
||||
|
||||
CAircraftSituation situation;
|
||||
CAircraftSituation situationReceived = testserviceInterface.pingSituation(situation);
|
||||
qDebug() << "Pinged situation via interface"
|
||||
<< ((situation == situationReceived) ? "OK" : "------------- ERROR! ------------") << situationReceived;
|
||||
|
||||
CTransponder transponderReceived = testserviceInterface.pingTransponder(transponder);
|
||||
qDebug() << "Pinged transponder via interface"
|
||||
<< ((transponderReceived == transponder) ? "OK" : "------------- ERROR! ------------") << transponderReceived;
|
||||
|
||||
CAircraftLights lights(true, false, true, false, true, false);
|
||||
CAircraftLights lightsReceived = testserviceInterface.pingAircraftLights(lights);
|
||||
qDebug() << "Pinged lights via interface"
|
||||
<< ((lightsReceived == lights) ? "OK" : "------------- ERROR! ------------") << lightsReceived;
|
||||
|
||||
CAircraftEngine engine(3, true);
|
||||
CAircraftEngine engineReceived = testserviceInterface.pingAircraftEngine(engine);
|
||||
qDebug() << "Pinged engine via interface"
|
||||
<< ((engineReceived == engine) ? "OK" : "------------- ERROR! ------------") << engineReceived;
|
||||
|
||||
CAircraftEngineList engines({engine});
|
||||
CAircraftParts parts(lights, true, 11, true, engines, true);
|
||||
CAircraftParts partsReceived = testserviceInterface.pingAircraftParts(parts);
|
||||
qDebug() << "Pinged parts via interface"
|
||||
<< ((partsReceived == parts) ? "OK" : "------------- ERROR! ------------") << partsReceived;
|
||||
|
||||
CSimulatedAircraft aircraft(callsign, CUser("123456", "Joe Pilot"), situation);
|
||||
aircraft.setTransponder(transponder);
|
||||
CSimulatedAircraft aircraftReceived(testserviceInterface.pingSimulatedAircraft(aircraft));
|
||||
qDebug() << "Pinged aircraft via interface"
|
||||
<< ((aircraft == aircraftReceived) ? "OK" : "------------- ERROR! ------------") << aircraftReceived;
|
||||
|
||||
CSimulatedAircraft simAircraft(aircraft);
|
||||
CAircraftModel model("foobar", CAircraftModel::TypeManuallySet);
|
||||
simAircraft.setModel(model);
|
||||
CSimulatedAircraft simAircraftReceived = testserviceInterface.pingSimulatedAircraft(simAircraft);
|
||||
qDebug() << "Pinged simulated aircraft via interface"
|
||||
<< ((simAircraft == simAircraftReceived) ? "OK" : "------------- ERROR! ------------") << simAircraftReceived;
|
||||
|
||||
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;
|
||||
|
||||
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.toQString();
|
||||
cv = testserviceInterface.pingCVariant(client);
|
||||
qDebug() << "Pinged CVariant via interface" << cv.toQString();
|
||||
|
||||
// test variant lists with different types wrapped in CVariant
|
||||
qDebug() << "----------------- variant tests ----------------";
|
||||
qtout << "----------------- variant tests ----------------" << endl;
|
||||
CVariantList cvList;
|
||||
cvList.push_back(CVariant::fromValue(len));
|
||||
cvList.push_back(CVariant::fromValue(alt));
|
||||
CVariantList lengthsV;
|
||||
lengthsV.push_back(CVariant::fromValue(len));
|
||||
lengthsV.push_back(CVariant::fromValue(alt));
|
||||
testserviceInterface.receiveLengthsQvl(cvList);
|
||||
qDebug() << "Send lengths via interface as CVariantList:";
|
||||
testserviceInterface.receiveLengthsQl(lengthsV);
|
||||
qDebug() << "Send lengths via interface as QList<CVariant>:";
|
||||
foreach (CVariant lv, cvList)
|
||||
testServiceInterface.receiveLengthsQvl(cvList);
|
||||
qtout << "Send lengths via interface as CVariantList" << endl;
|
||||
testServiceInterface.receiveLengthsQl(lengthsV);
|
||||
qtout << "Send lengths via interface as QList<CVariant>" << endl;
|
||||
for (const CVariant &lv : cvList)
|
||||
{
|
||||
qDebug() << " " << "Send length in list:" << lv;
|
||||
qtout << " " << "Send length in list: " << lv << endl;
|
||||
}
|
||||
QThread::msleep(2500);
|
||||
CApplication::processEventsFor(2000);
|
||||
|
||||
// Value map
|
||||
qDebug() << "----------------- index variant map ----------------";
|
||||
qtout << "----------------- index variant map ----------------" << endl;
|
||||
|
||||
CPropertyIndexVariantMap valueMap;
|
||||
valueMap.addValue(1000, 111.222);
|
||||
@@ -504,112 +225,112 @@ namespace BlackSample
|
||||
valueMap.addValue(4000, track);
|
||||
valueMap.addValue(5000, QDateTime::currentDateTime().addDays(1));
|
||||
valueMap.addValue(6000, QString("foobar"));
|
||||
testserviceInterface.receiveValueMap(valueMap);
|
||||
qDebug() << "Send index variant map" << valueMap;
|
||||
testServiceInterface.receiveValueMap(valueMap);
|
||||
qtout << "Send index variant map " << valueMap << endl;
|
||||
CApplication::processEventsFor(2000);
|
||||
|
||||
qtout << "----------------- pings ----------------" << endl;
|
||||
int errors = ITestServiceInterface::pingTests(testServiceInterface, false);
|
||||
qtout << "Ping errors " << errors << endl;
|
||||
CApplication::processEventsFor(2000);
|
||||
|
||||
// Performance tools
|
||||
QThread::msleep(2500);
|
||||
qDebug() << "----------------- performance ----------------";
|
||||
qtout << "----------------- performance ----------------" << endl;
|
||||
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
CSpeed speedDummy(i, CSpeedUnit::km_h());
|
||||
speedDummy = testserviceInterface.getSpeed();
|
||||
speedDummy = testServiceInterface.getSpeed();
|
||||
}
|
||||
qint64 t10 = timer.nsecsElapsed() / 1000000; // ms
|
||||
qint64 t10 = timer.elapsed(); // ms
|
||||
|
||||
timer.restart();
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
CSpeed speedDummy(i, CSpeedUnit::km_h());
|
||||
speedDummy = testserviceInterface.getSpeed();
|
||||
speedDummy = testServiceInterface.getSpeed();
|
||||
}
|
||||
qint64 t100 = timer.nsecsElapsed() / 1000000; // ms
|
||||
qint64 t100 = timer.elapsed(); // ms
|
||||
|
||||
timer.restart();
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
CSpeed speedDummy(i, CSpeedUnit::km_h());
|
||||
speedDummy = testserviceInterface.getSpeed();
|
||||
speedDummy = testServiceInterface.getSpeed();
|
||||
}
|
||||
qint64 t1000 = timer.nsecsElapsed() / 1000000; // ms
|
||||
qint64 t1000 = timer.elapsed(); // ms
|
||||
timer.invalidate();
|
||||
qDebug() << "Reading speed objects 10/100/1000 in ms:" << t10 << t100 << t1000;
|
||||
qtout << "Reading speed objects 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl;
|
||||
|
||||
timer.start();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
CAtcStation stationDummy(QString::number(i));
|
||||
stationDummy = testserviceInterface.getAtcStation();
|
||||
stationDummy = testServiceInterface.getAtcStation();
|
||||
}
|
||||
t10 = timer.nsecsElapsed() / 1000000; // ms
|
||||
t10 = timer.elapsed(); // ms
|
||||
timer.restart();
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
CAtcStation stationDummy(QString::number(i));
|
||||
stationDummy = testserviceInterface.getAtcStation();
|
||||
stationDummy = testServiceInterface.getAtcStation();
|
||||
}
|
||||
t100 = timer.nsecsElapsed() / 1000000; // ms
|
||||
t100 = timer.elapsed(); // ms
|
||||
timer.restart();
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
CAtcStation stationDummy(QString::number(i));
|
||||
stationDummy = testserviceInterface.getAtcStation();
|
||||
stationDummy = testServiceInterface.getAtcStation();
|
||||
}
|
||||
t1000 = timer.nsecsElapsed() / 1000000; // ms
|
||||
qDebug() << "Reading station objects 10/100/1000 in ms:" << t10 << t100 << t1000;
|
||||
t1000 = timer.elapsed(); // ms
|
||||
qtout << "Reading station objects 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl;
|
||||
|
||||
timer.restart();
|
||||
atcStationList = testserviceInterface.getAtcStationList(10);
|
||||
if (atcStationList.size() != 10) qDebug() << "wrong list size" << atcStationList.size();
|
||||
t10 = timer.nsecsElapsed() / 1000000; // ms
|
||||
QThread::msleep(1000);
|
||||
|
||||
CAtcStationList atcStationList = testServiceInterface.getAtcStationList(10);
|
||||
if (atcStationList.size() != 10) qtout << "wrong list size" << atcStationList.size() << endl;
|
||||
t10 = timer.elapsed(); // ms
|
||||
timer.restart();
|
||||
atcStationList = testserviceInterface.getAtcStationList(100);
|
||||
if (atcStationList.size() != 100) qDebug() << "wrong list size" << atcStationList.size();
|
||||
t100 = timer.nsecsElapsed() / 1000000; // ms
|
||||
QThread::msleep(1000);
|
||||
|
||||
atcStationList = testServiceInterface.getAtcStationList(100);
|
||||
if (atcStationList.size() != 100) qtout << "wrong list size" << atcStationList.size() << endl;
|
||||
t100 = timer.elapsed(); // ms
|
||||
timer.restart();
|
||||
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;
|
||||
atcStationList = testServiceInterface.getAtcStationList(1000);
|
||||
if (atcStationList.size() != 1000) qtout << "wrong list size" << atcStationList.size() << endl;
|
||||
t1000 = timer.elapsed(); // ms
|
||||
qtout << "Reading station list 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl;
|
||||
|
||||
// test reading model entries with a realistic size
|
||||
timer.restart();
|
||||
CAircraftCfgEntriesList entriesList = testserviceInterface.getAircraftCfgEntriesList(5000);
|
||||
if (entriesList.size() != 5000) qDebug() << "wrong list size" << entriesList.size();
|
||||
qint64 t5000 = timer.nsecsElapsed() / 1000000; // ms
|
||||
qDebug() << "Reading aircraft cfg entries in ms:" << t5000;
|
||||
CAircraftCfgEntriesList entriesList = testServiceInterface.getAircraftCfgEntriesList(5000);
|
||||
if (entriesList.size() != 5000) qtout << "wrong list size" << entriesList.size() << endl;
|
||||
qint64 t5000 = timer.elapsed(); // ms
|
||||
qtout << "Reading aircraft cfg entries in ms: " << t5000 << endl;
|
||||
|
||||
// object paths
|
||||
timer.restart();
|
||||
QList<QDBusObjectPath> objectPaths = testserviceInterface.getObjectPaths(10);
|
||||
if (objectPaths.size() != 10) qDebug() << "wrong list size" << objectPaths.size();
|
||||
t10 = timer.nsecsElapsed() / 1000000; // ms
|
||||
|
||||
QList<QDBusObjectPath> objectPaths = testServiceInterface.getObjectPaths(10);
|
||||
if (objectPaths.size() != 10) qtout << "wrong list size" << objectPaths.size() << endl;
|
||||
t10 = timer.elapsed(); // ms
|
||||
timer.restart();
|
||||
objectPaths = testserviceInterface.getObjectPaths(100);
|
||||
if (objectPaths.size() != 100) qDebug() << "wrong list size" << objectPaths.size();
|
||||
t100 = timer.nsecsElapsed() / 1000000; // ms
|
||||
|
||||
objectPaths = testServiceInterface.getObjectPaths(100);
|
||||
if (objectPaths.size() != 100) qtout << "wrong list size" << objectPaths.size() << endl;
|
||||
t100 = timer.elapsed(); // ms
|
||||
timer.restart();
|
||||
objectPaths = testserviceInterface.getObjectPaths(1000);
|
||||
if (objectPaths.size() != 1000) qDebug() << "wrong list size" << objectPaths.size();
|
||||
t1000 = timer.nsecsElapsed() / 1000000; // ms
|
||||
|
||||
qDebug() << "Reading paths list 10/100/1000 in ms:" << t10 << t100 << t1000;
|
||||
objectPaths = testServiceInterface.getObjectPaths(1000);
|
||||
if (objectPaths.size() != 1000) qtout << "wrong list size" << objectPaths.size() << endl;
|
||||
t1000 = timer.elapsed(); // ms
|
||||
qtout << "Reading paths list 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl;
|
||||
timer.invalidate();
|
||||
|
||||
// next round?
|
||||
qDebug() << "---------------------------------------";
|
||||
qDebug() << "Key ....... x to exit, pid:" << ServiceTool::getPid();
|
||||
qtout << "---------------------------------------" << endl;
|
||||
qtout << "Key ....... x to exit" << endl;
|
||||
line = qtin.readLine().toLower().trimmed();
|
||||
if (line.startsWith('x'))
|
||||
{
|
||||
qDebug() << "Ending!";
|
||||
qtout << "Ending!" << endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,6 @@
|
||||
#ifndef BLACKSAMPLE_SERVICETOOL_H
|
||||
#define BLACKSAMPLE_SERVICETOOL_H
|
||||
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
#include "blackmisc/network/clientlist.h"
|
||||
#include "blackmisc/simulation/fscommon/aircraftcfgentrieslist.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDBusArgument>
|
||||
#include <QString>
|
||||
@@ -39,21 +33,12 @@ namespace BlackSample
|
||||
*/
|
||||
class ServiceTool
|
||||
{
|
||||
private:
|
||||
ServiceTool() {}
|
||||
|
||||
public:
|
||||
//! Process id
|
||||
static qint64 getPid()
|
||||
{
|
||||
return QCoreApplication::applicationPid();
|
||||
}
|
||||
|
||||
//! Client side of data transfer test
|
||||
static void dataTransferTestClient(const QString &address);
|
||||
|
||||
//! Server side of data transfer test
|
||||
static void dataTransferTestServer(BlackMisc::CDBusServer *dBusServer);
|
||||
static void dataTransferTestServer(BlackMisc::CDBusServer *dBusServer, bool verbose);
|
||||
|
||||
//! Start a new process
|
||||
static QProcess *startNewProcess(const QString &executable, const QStringList &arguments = QStringList(), QObject *parent = 0);
|
||||
@@ -61,26 +46,9 @@ namespace BlackSample
|
||||
//! Loop to send data to test service (slots on server)
|
||||
static void sendDataToTestservice(const QDBusConnection &connection);
|
||||
|
||||
//! Display QDBusArgument
|
||||
static void displayQDBusArgument(const QDBusArgument &arg, qint32 level = 0);
|
||||
|
||||
//! Register testservice with connection
|
||||
static Testservice *registerTestservice(QDBusConnection &connection, QObject *parent = 0);
|
||||
|
||||
//! Get a random callsign
|
||||
static BlackMisc::Aviation::CCallsign getRandomAtcCallsign();
|
||||
|
||||
//! Get stations
|
||||
static BlackMisc::Aviation::CAtcStationList getStations(int number);
|
||||
|
||||
//! Get aircraft cfg entries
|
||||
static BlackMisc::Simulation::FsCommon::CAircraftCfgEntriesList getAircraftCfgEntries(int number);
|
||||
|
||||
//! Get airports
|
||||
static BlackMisc::Aviation::CAirportList getAirports(int number);
|
||||
|
||||
//! Get clients
|
||||
static BlackMisc::Network::CClientList getClients(int number);
|
||||
private:
|
||||
//! No constructor
|
||||
ServiceTool() = delete;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user