mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
refs #875, moved DBus test classes to blackmisc
https://dev.vatsim-germany.org/issues/875#note-8
This commit is contained in:
committed by
Mathew Sutcliffe
parent
09ea40a1f7
commit
31b6ef83f0
366
src/blackmisc/test/testservice.cpp
Normal file
366
src/blackmisc/test/testservice.cpp
Normal file
@@ -0,0 +1,366 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "testservice.h"
|
||||
#include "testutils.h"
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
#include "blackmisc/aviation/comsystem.h"
|
||||
#include "blackmisc/aviation/track.h"
|
||||
#include "blackmisc/dbus.h"
|
||||
#include "blackmisc/pq/frequency.h"
|
||||
#include "blackmisc/pq/units.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
|
||||
#include <QDBusArgument>
|
||||
#include <QDBusObjectPath>
|
||||
#include <QDBusError>
|
||||
#include <QDebug>
|
||||
#include <QVariant>
|
||||
#include <QtDebug>
|
||||
#include <QtGlobal>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Test
|
||||
{
|
||||
CTestService::CTestService(QObject *parent) : QObject(parent)
|
||||
{ }
|
||||
|
||||
CTestService::CTestService(bool verbose, QObject *parent) :
|
||||
QObject(parent), m_verbose(verbose)
|
||||
{ }
|
||||
|
||||
bool CTestService::canRegisterTestService(QDBusConnection &connection)
|
||||
{
|
||||
const bool r = connection.registerService(CTestService::InterfaceName());
|
||||
if (r)
|
||||
{
|
||||
connection.unregisterService(CTestService::InterfaceName());
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
const QString &CTestService::InterfaceName()
|
||||
{
|
||||
static const QString i(BLACKMISC_TESTSERVICE_INTERFACENAME);
|
||||
return i;
|
||||
}
|
||||
|
||||
const QString &CTestService::ObjectPath()
|
||||
{
|
||||
static const QString p("/ts");
|
||||
return p;
|
||||
}
|
||||
|
||||
CTestService *CTestService::registerTestService(QDBusConnection &connection, bool verbose, QObject *parent)
|
||||
{
|
||||
CTestService *pTestService = new CTestService(verbose, parent); // just a QObject with signals / slots and Q_CLASSINFO("D-Bus Interface", some service name)
|
||||
if (!connection.registerService(CTestService::InterfaceName()))
|
||||
{
|
||||
QDBusError error = connection.lastError();
|
||||
err() << error.message();
|
||||
err() << "Started dbus-daemon.exe --session (Windows)?" << endl;
|
||||
err() << "Created directory session.d (e.g. ../Qt/5.8.0/qtbase/etc/dbus-1/session.d)?" << endl;
|
||||
qFatal("Could not register service!");
|
||||
}
|
||||
|
||||
if (!connection.registerObject(CTestService::ObjectPath(), pTestService, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals | QDBusConnection::ExportAdaptors))
|
||||
{
|
||||
qFatal("Could not register service object!");
|
||||
}
|
||||
|
||||
out() << "Registration running as pid: " << CTestService::getPid() << endl;
|
||||
if (pTestService) { out() << "Service registered" << endl; }
|
||||
|
||||
QString service; // service not needed
|
||||
if (connection.connect(service, CTestService::ObjectPath(), CTestService::InterfaceName(),
|
||||
"sendStringMessage", pTestService, SLOT(receiveStringMessage(const QString &))))
|
||||
{
|
||||
out() << "Connected object with DBus 'sendStringMessage'" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
qFatal("Cannot connect service with DBus");
|
||||
}
|
||||
return pTestService;
|
||||
}
|
||||
|
||||
bool CTestService::unregisterTestService(QDBusConnection &connection)
|
||||
{
|
||||
return connection.unregisterService(CTestService::InterfaceName());
|
||||
}
|
||||
|
||||
QTextStream &CTestService::out()
|
||||
{
|
||||
static QTextStream out(stdout);
|
||||
return out;
|
||||
}
|
||||
|
||||
QTextStream &CTestService::err()
|
||||
{
|
||||
static QTextStream err(stderr);
|
||||
return err;
|
||||
}
|
||||
|
||||
void CTestService::receiveStringMessage(const QString &message) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received message: " << message << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveVariant(const CVariant &variant) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received variant: " << variant << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received speed: " << speed << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveComUnit(const CComSystem &comUnit) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received COM: " << comUnit << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveAltitude(const CAltitude &altitude) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received altitude: " << altitude << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveList(const QList<double> &list) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received list: " << list.size() << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveGeoPosition(const BlackMisc::Geo::CCoordinateGeodetic &geo) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received geo data: " << geo << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveTransponder(const CTransponder &transponder) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received transponder: " << transponder << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveTrack(const CTrack &track) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received track: " << track << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveLength(const BlackMisc::PhysicalQuantities::CLength &length) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received length: " << length << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveLengthsQvl(const QVariantList &lengthsVariantList) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " " << lengthsVariantList.size() << endl;
|
||||
foreach (QVariant lv, lengthsVariantList)
|
||||
{
|
||||
BlackMisc::PhysicalQuantities::CLength l;
|
||||
lv.value<QDBusArgument>() >> l;
|
||||
if (m_verbose) out() << " Received length in list: " << l << endl;
|
||||
}
|
||||
}
|
||||
|
||||
void CTestService::receiveLengthsQl(const QList<QVariant> &lengthsList) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received " << lengthsList.size() << endl;
|
||||
foreach (QVariant lv, lengthsList)
|
||||
{
|
||||
BlackMisc::PhysicalQuantities::CLength l;
|
||||
lv.value<QDBusArgument>() >> l;
|
||||
if (m_verbose) out() << " Received length in list: " << l << endl;
|
||||
}
|
||||
}
|
||||
|
||||
void CTestService::receiveCallsign(const CCallsign &callsign) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received callsign: " << callsign << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveAtcStationList(const CAtcStationList &atcStationList) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received ATC list: " << atcStationList << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveValueMap(const BlackMisc::CPropertyIndexVariantMap &valueMap) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received value map: " << valueMap << endl;
|
||||
}
|
||||
|
||||
void CTestService::receiveAtcStation(const CAtcStation &station) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received ATC station: " << station << endl;
|
||||
}
|
||||
|
||||
CAtcStationList CTestService::pingAtcStationList(const CAtcStationList &atcStationList) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ATCs: " << atcStationList << endl;
|
||||
return atcStationList;
|
||||
}
|
||||
|
||||
CSimulatedAircraftList CTestService::pingAircraftList(const CSimulatedAircraftList &aircraftList) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft: " << aircraftList << endl;
|
||||
return aircraftList;
|
||||
}
|
||||
|
||||
CAircraftParts CTestService::pingAircraftParts(const CAircraftParts &aircraftParts) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft parts: " << aircraftParts << endl;
|
||||
return aircraftParts;
|
||||
}
|
||||
|
||||
CAircraftEngine CTestService::pingAircraftEngine(const CAircraftEngine &aircraftEngine) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft engine: " << aircraftEngine << endl;
|
||||
return aircraftEngine;
|
||||
}
|
||||
|
||||
CAircraftModel CTestService::pingAircraftModel(const CAircraftModel &aircraftModel) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft model: " << aircraftModel << endl;
|
||||
return aircraftModel;
|
||||
}
|
||||
|
||||
CAircraftModelList CTestService::pingAircraftModelList(const CAircraftModelList &aircraftModels) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft modellist: " << aircraftModels << endl;
|
||||
return aircraftModels;
|
||||
}
|
||||
|
||||
CAircraftLights CTestService::pingAircraftLights(const CAircraftLights &aircraftLights) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft lights: " << aircraftLights << endl;
|
||||
return aircraftLights;
|
||||
}
|
||||
|
||||
CSimulatedAircraft CTestService::pingSimulatedAircraft(const CSimulatedAircraft &aircraft) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping simulated aircraft: " << aircraft << endl;
|
||||
return aircraft;
|
||||
}
|
||||
|
||||
CAirportList CTestService::pingAirportList(const CAirportList &airportList) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping airports: " << airportList << endl;
|
||||
return airportList;
|
||||
}
|
||||
|
||||
CPropertyIndex CTestService::pingPropertyIndex(const CPropertyIndex &properties) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping properties: " << properties << endl;
|
||||
return properties;
|
||||
}
|
||||
|
||||
CPropertyIndexVariantMap CTestService::pingIndexVariantMap(const CPropertyIndexVariantMap &indexVariantMap) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping properties: " << indexVariantMap << endl;
|
||||
return indexVariantMap;
|
||||
}
|
||||
|
||||
CClient CTestService::pingClient(const CClient &client) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping client: " << client << endl;
|
||||
return client;
|
||||
}
|
||||
|
||||
CClientList CTestService::pingClientList(const CClientList &clientList) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping clients: " << clientList << endl;
|
||||
return clientList;
|
||||
}
|
||||
|
||||
CSpeed CTestService::pingSpeed(const CSpeed &speed) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping speed: " << speed << endl;
|
||||
return speed;
|
||||
}
|
||||
|
||||
CAltitude CTestService::pingAltitude(const CAltitude &altitude) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping alt: " << altitude << endl;
|
||||
return altitude;
|
||||
}
|
||||
|
||||
CUser CTestService::pingUser(const CUser &user) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping user: " << user << endl;
|
||||
return user;
|
||||
}
|
||||
|
||||
CAircraftSituation CTestService::pingSituation(const CAircraftSituation &situation) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping situation: " << situation << endl;
|
||||
return situation;
|
||||
}
|
||||
|
||||
CTransponder CTestService::pingTransponder(const CTransponder &transponder) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping transponder: " << transponder << endl;
|
||||
return transponder;
|
||||
}
|
||||
|
||||
CAtcStation CTestService::pingAtcStation(const CAtcStation &station) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ATC: " << station << endl;
|
||||
return station;
|
||||
}
|
||||
|
||||
CAircraftIcaoCode CTestService::pingAircraftIcaoData(const CAircraftIcaoCode &icao) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ICAO data: " << icao << endl;
|
||||
return icao;
|
||||
}
|
||||
|
||||
CSimulatorPluginInfo CTestService::pingPluginInfo(const CSimulatorPluginInfo &info) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " info: " << info << endl;
|
||||
return info;
|
||||
}
|
||||
|
||||
BlackMisc::CVariant CTestService::pingCVariant(const CVariant &variant) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " client sent back as CVariant: " << variant.toQString() << endl;
|
||||
return variant;
|
||||
}
|
||||
|
||||
CAtcStationList CTestService::getAtcStationList(int n) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getAtcStationList" << endl;
|
||||
return CTestUtils::getStations(n);
|
||||
}
|
||||
|
||||
CAircraftCfgEntriesList CTestService::getAircraftCfgEntriesList(int n) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getAircraftCfgEntriesList" << endl;
|
||||
return CTestUtils::getAircraftCfgEntries(n);
|
||||
}
|
||||
|
||||
QList<QDBusObjectPath> CTestService::getObjectPaths(int n) const
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getObjectPaths" << endl;
|
||||
QList<QDBusObjectPath> paths;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
paths.append(QDBusObjectPath(ObjectPath()));
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
241
src/blackmisc/test/testservice.h
Normal file
241
src/blackmisc/test/testservice.h
Normal file
@@ -0,0 +1,241 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_TEST_TESTSERVICE_H
|
||||
#define BLACKMISC_TEST_TESTSERVICE_H
|
||||
|
||||
// clash with struct interface in objbase.h used to happen
|
||||
#pragma push_macro("interface")
|
||||
#undef interface
|
||||
|
||||
#include "blackmisc/aviation/aircrafticaocode.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
#include "blackmisc/aviation/altitude.h"
|
||||
#include "blackmisc/aviation/atcstation.h"
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
#include "blackmisc/aviation/transponder.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/network/client.h"
|
||||
#include "blackmisc/network/clientlist.h"
|
||||
#include "blackmisc/network/user.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/pq/speed.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/propertyindexvariantmap.h"
|
||||
#include "blackmisc/simulation/fscommon/aircraftcfgentrieslist.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/variant.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QTextStream>
|
||||
#include <QVariantList>
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusObjectPath>
|
||||
|
||||
class QDBusObjectPath;
|
||||
class QVariant;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
class CCallsign;
|
||||
class CComSystem;
|
||||
class CTrack;
|
||||
}
|
||||
}
|
||||
|
||||
//! DBus interface for test service
|
||||
#define BLACKMISC_TESTSERVICE_INTERFACENAME "blackmisc.test"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Test
|
||||
{
|
||||
//! Testservice for PQ / CValueObject DBus tests. This part is the callee.
|
||||
//! \remark corresponds with BlackMisc::Test::ITestServiceInterface
|
||||
class BLACKMISC_EXPORT CTestService : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKMISC_TESTSERVICE_INTERFACENAME)
|
||||
|
||||
// For some reasons the interface name in the XML is not set correctly
|
||||
// to the above name
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CTestService(QObject *parent = nullptr);
|
||||
|
||||
//! Constructor
|
||||
explicit CTestService(bool verbose, QObject *parent = nullptr);
|
||||
|
||||
//! Can the testservice be registered?
|
||||
static bool canRegisterTestService(QDBusConnection &connection);
|
||||
|
||||
//! Register testservice with connection
|
||||
static CTestService *registerTestService(QDBusConnection &connection, bool verbose, QObject *parent = nullptr);
|
||||
|
||||
//! Can the testservice be registered?
|
||||
static bool unregisterTestService(QDBusConnection &connection);
|
||||
|
||||
//! Process id
|
||||
static qint64 getPid() { return QCoreApplication::applicationPid(); }
|
||||
|
||||
//! DBus interface name
|
||||
static const QString &InterfaceName();
|
||||
|
||||
//! DBus object path
|
||||
static const QString &ObjectPath();
|
||||
|
||||
signals:
|
||||
//! Send string message
|
||||
void sendStringMessage(const QString &message);
|
||||
|
||||
public slots:
|
||||
//! Receive string message
|
||||
void receiveStringMessage(const QString &message) const;
|
||||
|
||||
//! Receive a QVariant
|
||||
void receiveVariant(const BlackMisc::CVariant &variant) const;
|
||||
|
||||
//! Receive speed
|
||||
void receiveSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed) const;
|
||||
|
||||
//! Receive com unit
|
||||
void receiveComUnit(const BlackMisc::Aviation::CComSystem &comUnit) const;
|
||||
|
||||
//! Receive altitude
|
||||
void receiveAltitude(const BlackMisc::Aviation::CAltitude &altitude) const;
|
||||
|
||||
//! Receive list
|
||||
void receiveList(const QList<double> &list) const;
|
||||
|
||||
//! Receive a geo position
|
||||
void receiveGeoPosition(const BlackMisc::Geo::CCoordinateGeodetic &geo) const;
|
||||
|
||||
//! Receive transponder
|
||||
void receiveTransponder(const BlackMisc::Aviation::CTransponder &transponder) const;
|
||||
|
||||
//! Receive track
|
||||
void receiveTrack(const BlackMisc::Aviation::CTrack &track) const;
|
||||
|
||||
//! Receive a length
|
||||
void receiveLength(const BlackMisc::PhysicalQuantities::CLength &length) const;
|
||||
|
||||
//! Receive lengths
|
||||
void receiveLengthsQl(const QList<QVariant> &lengthsList) const;
|
||||
|
||||
//! Receive lengths
|
||||
void receiveLengthsQvl(const QVariantList &lengthsVariantList) const;
|
||||
|
||||
//! Receive ATC station
|
||||
void receiveAtcStation(const BlackMisc::Aviation::CAtcStation &station) const;
|
||||
|
||||
//! Receive callsign
|
||||
void receiveCallsign(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
|
||||
//! Receive ATC list
|
||||
void receiveAtcStationList(const BlackMisc::Aviation::CAtcStationList &atcStationList) const;
|
||||
|
||||
//! Receive an value map
|
||||
void receiveValueMap(const BlackMisc::CPropertyIndexVariantMap &valueMap) const;
|
||||
|
||||
//! Ping speed
|
||||
BlackMisc::PhysicalQuantities::CSpeed pingSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed) const;
|
||||
|
||||
//! Ping altitude
|
||||
BlackMisc::Aviation::CAltitude pingAltitude(const BlackMisc::Aviation::CAltitude &altitude) const;
|
||||
|
||||
//! Ping user
|
||||
BlackMisc::Network::CUser pingUser(const BlackMisc::Network::CUser &user) const;
|
||||
|
||||
//! Ping situation
|
||||
BlackMisc::Aviation::CAircraftSituation pingSituation(const BlackMisc::Aviation::CAircraftSituation &situation) const;
|
||||
|
||||
//! Ping ATC station
|
||||
BlackMisc::Aviation::CAtcStation pingAtcStation(const BlackMisc::Aviation::CAtcStation &station) const;
|
||||
|
||||
//! Ping transponder
|
||||
BlackMisc::Aviation::CTransponder pingTransponder(const BlackMisc::Aviation::CTransponder &transponder) const;
|
||||
|
||||
//! Ping aircraft lights
|
||||
BlackMisc::Aviation::CAircraftLights pingAircraftLights(const BlackMisc::Aviation::CAircraftLights &aircraftLights) const;
|
||||
|
||||
//! Ping parts
|
||||
BlackMisc::Aviation::CAircraftParts pingAircraftParts(const BlackMisc::Aviation::CAircraftParts &aircraftParts) const;
|
||||
|
||||
//! Ping engine
|
||||
BlackMisc::Aviation::CAircraftEngine pingAircraftEngine(const BlackMisc::Aviation::CAircraftEngine &aircraftEngine) const;
|
||||
|
||||
//! Ping model
|
||||
BlackMisc::Simulation::CAircraftModel pingAircraftModel(const BlackMisc::Simulation::CAircraftModel &aircraftModel) const;
|
||||
|
||||
//! Ping model
|
||||
BlackMisc::Simulation::CAircraftModelList pingAircraftModelList(const BlackMisc::Simulation::CAircraftModelList &aircraftModels) const;
|
||||
|
||||
//! Ping simulated aircraft
|
||||
BlackMisc::Simulation::CSimulatedAircraft pingSimulatedAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft) const;
|
||||
|
||||
//! Ping ATC list
|
||||
BlackMisc::Aviation::CAtcStationList pingAtcStationList(const BlackMisc::Aviation::CAtcStationList &atcStationList) const;
|
||||
|
||||
//! Ping aircraft list
|
||||
BlackMisc::Simulation::CSimulatedAircraftList pingAircraftList(const BlackMisc::Simulation::CSimulatedAircraftList &aircraftList) const;
|
||||
|
||||
//! Ping airports list
|
||||
BlackMisc::Aviation::CAirportList pingAirportList(const BlackMisc::Aviation::CAirportList &airportList) const;
|
||||
|
||||
//! Ping property index
|
||||
BlackMisc::CPropertyIndex pingPropertyIndex(const BlackMisc::CPropertyIndex &properties) const;
|
||||
|
||||
//! Ping index variant map
|
||||
BlackMisc::CPropertyIndexVariantMap pingIndexVariantMap(const BlackMisc::CPropertyIndexVariantMap &indexVariantMap) const;
|
||||
|
||||
//! Ping client
|
||||
BlackMisc::Network::CClient pingClient(const BlackMisc::Network::CClient &client) const;
|
||||
|
||||
//! Ping NW clients list
|
||||
BlackMisc::Network::CClientList pingClientList(const BlackMisc::Network::CClientList &clientList) const;
|
||||
|
||||
//! Ping plugin info
|
||||
BlackMisc::Simulation::CSimulatorPluginInfo pingPluginInfo(const BlackMisc::Simulation::CSimulatorPluginInfo &info) const;
|
||||
|
||||
//! Ping ICAO data object
|
||||
BlackMisc::Aviation::CAircraftIcaoCode pingAircraftIcaoData(const BlackMisc::Aviation::CAircraftIcaoCode &icao) const;
|
||||
|
||||
//! Ping CVariant
|
||||
BlackMisc::CVariant pingCVariant(const BlackMisc::CVariant &variant) const;
|
||||
|
||||
//! Return stations via DBus
|
||||
BlackMisc::Aviation::CAtcStationList getAtcStationList(int n) const;
|
||||
|
||||
//! Return stations via DBus
|
||||
BlackMisc::Simulation::FsCommon::CAircraftCfgEntriesList getAircraftCfgEntriesList(int n) const;
|
||||
|
||||
//! Return paths via DBus
|
||||
QList<QDBusObjectPath> getObjectPaths(int n) const;
|
||||
|
||||
private:
|
||||
static QTextStream &out();
|
||||
static QTextStream &err();
|
||||
bool m_verbose = true;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#pragma pop_macro("interface")
|
||||
#endif // guard
|
||||
187
src/blackmisc/test/testserviceinterface.cpp
Normal file
187
src/blackmisc/test/testserviceinterface.cpp
Normal file
@@ -0,0 +1,187 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "testserviceinterface.h"
|
||||
#include "testservice.h"
|
||||
#include "testutils.h"
|
||||
#include "blackmisc/test/testdata.h"
|
||||
#include <QTextStream>
|
||||
|
||||
class QDBusConnection;
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Test;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Test
|
||||
{
|
||||
ITestServiceInterface::ITestServiceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: QDBusAbstractInterface(service, path, ITestServiceInterface::InterfaceName(), connection, parent)
|
||||
{}
|
||||
|
||||
ITestServiceInterface::~ITestServiceInterface()
|
||||
{}
|
||||
|
||||
int ITestServiceInterface::pingTests(ITestServiceInterface &testServiceInterface, bool verbose)
|
||||
{
|
||||
int errors = 0;
|
||||
bool ok = false;
|
||||
QTextStream out(stdout);
|
||||
|
||||
const CPropertyIndex pi({ 1000, 2000, 3000, 4000, 5000}); // numbers >= global index
|
||||
const CPropertyIndex piPing = testServiceInterface.pingPropertyIndex(pi);
|
||||
ok = pingCompare(pi, piPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged property index via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
CPropertyIndexVariantMap ivm;
|
||||
ivm.addValue(1000, "one");
|
||||
ivm.addValue(2000, "two");
|
||||
ivm.addValue(3000, "three");
|
||||
const CPropertyIndexVariantMap ivmPing = testServiceInterface.pingIndexVariantMap(ivm);
|
||||
ok = pingCompare(ivm, ivmPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged variant map via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CSimulatorPluginInfo pluginInfo("fsx", "FSX Simulator", "FSX", "Flight Simulator X", true);
|
||||
const CSimulatorPluginInfo pluginInfoPing = testServiceInterface.pingPluginInfo(pluginInfo);
|
||||
ok = pingCompare(pluginInfo, pluginInfoPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged info via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CSpeed speedNotNull(22, CSpeedUnit::m_s());
|
||||
const CSpeed speedNull = CSpeed(0, CSpeedUnit::nullUnit());
|
||||
|
||||
const CSpeed speedNotNullPing = testServiceInterface.pingSpeed(speedNotNull);
|
||||
ok = pingCompare(speedNotNull, speedNotNullPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged not null speed via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CSpeed speedNullPing = testServiceInterface.pingSpeed(speedNull);
|
||||
ok = pingCompare(speedNull, speedNullPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged null speed via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CAtcStation station = CTestData::getAtcStation();
|
||||
const CAtcStation stationPing = testServiceInterface.pingAtcStation(station);
|
||||
ok = pingCompare(station, stationPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged ATC station via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CAircraftIcaoCode icaoData("B737", "L2J");
|
||||
const CAircraftIcaoCode icaoDataPing = testServiceInterface.pingAircraftIcaoData(icaoData);
|
||||
ok = pingCompare(icaoData, icaoDataPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged ICAO data via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CUser user("223344", "Ping Me User");
|
||||
const CUser userPing = testServiceInterface.pingUser(user);
|
||||
ok = pingCompare(user, userPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged user via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
// EDDF: 50° 2′ 0″ N, 8° 34′ 14″ E, 2000m MSL
|
||||
const CCoordinateGeodetic coordinate = CCoordinateGeodetic::fromWgs84("50° 2′ 1″ 23 N", "8° 34′ 14″ E", { 2000, CLengthUnit::m() });
|
||||
const CAircraftSituation situation = CAircraftSituation("DAMBZ", coordinate);
|
||||
const CAircraftSituation situationPing = testServiceInterface.pingSituation(situation);
|
||||
ok = pingCompare(situation, situationPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged situation via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CTransponder transponder(1234, "C");
|
||||
const CTransponder transponderPing = testServiceInterface.pingTransponder(transponder);
|
||||
ok = pingCompare(transponder, transponderPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged transponder via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CAircraftLights lights(true, false, true, false, true, false);
|
||||
const CAircraftLights lightsPing = testServiceInterface.pingAircraftLights(lights);
|
||||
ok = pingCompare(lights, lightsPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged lights via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CAircraftEngine engine(2, false);
|
||||
const CAircraftEngine enginePing = testServiceInterface.pingAircraftEngine(engine);
|
||||
ok = pingCompare(engine, enginePing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged engine via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CAircraftEngineList engines({engine});
|
||||
const CAircraftParts parts(lights, true, 11, true, engines, true);
|
||||
const CAircraftParts partsPing = testServiceInterface.pingAircraftParts(parts);
|
||||
ok = pingCompare(parts, partsPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged engine via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CAircraftModel model("foobar", CAircraftModel::TypeManuallySet);
|
||||
const CAircraftModel modelPing = testServiceInterface.pingAircraftModel(model);
|
||||
ok = pingCompare(model, modelPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged model via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CAircraftModel model2("mymodel", CAircraftModel::TypeFSInnData);
|
||||
const CAircraftModelList models({ model, model2});
|
||||
const CAircraftModelList modelsPing = testServiceInterface.pingAircraftModelList(models);
|
||||
ok = pingCompare(models, modelsPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged model list via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CCallsign callsign("DEMBZ");
|
||||
CSimulatedAircraft aircraft(callsign, CUser("123456", "Joe Pilot"), situation);
|
||||
aircraft.setTransponder(transponder);
|
||||
aircraft.setModel(model);
|
||||
aircraft.setNetworkModel(model2);
|
||||
const CSimulatedAircraft aircraftPing = testServiceInterface.pingSimulatedAircraft(aircraft);
|
||||
ok = pingCompare(aircraft, aircraftPing, out, verbose, errors);
|
||||
pingCompare(aircraft.getModel(), aircraftPing.getModel(), out, verbose, errors);
|
||||
pingCompare(aircraft.getNetworkModel(), aircraftPing.getNetworkModel(), out, verbose, errors);
|
||||
if (verbose) { out << "Pinged simulated aircraft via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
CAtcStationList atcStationList;
|
||||
atcStationList.push_back(station);
|
||||
atcStationList.push_back(station);
|
||||
atcStationList.push_back(station);
|
||||
CAtcStationList atcStationListPing = testServiceInterface.pingAtcStationList(atcStationList);
|
||||
ok = pingCompare(atcStationList, atcStationListPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged ATC station list via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CAirportList airportList = CTestUtils::getAirports(10);
|
||||
const CAirportList airportListPing = testServiceInterface.pingAirportList(airportList);
|
||||
ok = pingCompare(airportList, airportListPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged airports list via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CClientList clients = CTestUtils::getClients(10);
|
||||
const CClient client = clients.front();
|
||||
const CClient clientPing = testServiceInterface.pingClient(client);
|
||||
ok = pingCompare(client, clientPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged client list via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CClientList clientsPing = testServiceInterface.pingClientList(clients);
|
||||
ok = pingCompare(clients, clientsPing, out, verbose, errors);
|
||||
if (verbose) { out << "Pinged client list via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CVariant cv = CVariant::fromValue(clients);
|
||||
const CVariant cvPing = testServiceInterface.pingCVariant(cv);
|
||||
ok = pingCompare(cv.value<CClientList>(), cvPing.value<CClientList>(), out, verbose, errors);
|
||||
if (verbose) { out << "Pinged CVariant(clients) list via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
const CVariant cv2 = CVariant::fromValue(aircraft);
|
||||
const CVariant cvPing2 = testServiceInterface.pingCVariant(cv2);
|
||||
ok = pingCompare(cv2.value<CSimulatedAircraft>(), cvPing2.value<CSimulatedAircraft>(), out, verbose, errors);
|
||||
if (verbose) { out << "Pinged CVariant(aircraft) list via interface" << errorInfo(ok) << endl; }
|
||||
|
||||
// end
|
||||
return errors;
|
||||
}
|
||||
|
||||
const char *ITestServiceInterface::InterfaceName()
|
||||
{
|
||||
static const QByteArray in(CTestService::InterfaceName().toLatin1());
|
||||
return in.constData();
|
||||
}
|
||||
|
||||
const QString &ITestServiceInterface::errorInfo(bool ok)
|
||||
{
|
||||
static const QString sOk(": ok");
|
||||
static const QString sError(": !! ERROR !!");
|
||||
return ok ? sOk : sError;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
405
src/blackmisc/test/testserviceinterface.h
Normal file
405
src/blackmisc/test/testserviceinterface.h
Normal file
@@ -0,0 +1,405 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_TEST_TESTSERVICEINTERFACE_H
|
||||
#define BLACKMISC_TEST_TESTSERVICEINTERFACE_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/aviation/aircrafticaocode.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
#include "blackmisc/aviation/altitude.h"
|
||||
#include "blackmisc/aviation/atcstation.h"
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
#include "blackmisc/aviation/comsystem.h"
|
||||
#include "blackmisc/aviation/track.h"
|
||||
#include "blackmisc/aviation/transponder.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/network/client.h"
|
||||
#include "blackmisc/network/clientlist.h"
|
||||
#include "blackmisc/network/user.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/pq/speed.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/propertyindexvariantmap.h"
|
||||
#include "blackmisc/simulation/fscommon/aircraftcfgentrieslist.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/variantlist.h"
|
||||
|
||||
#include <QDBusAbstractInterface>
|
||||
#include <QDBusPendingCall>
|
||||
#include <QDBusPendingReply>
|
||||
#include <QLatin1Literal>
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
#include <QTextStream>
|
||||
|
||||
class QDBusConnection;
|
||||
class QDBusObjectPath;
|
||||
class QDBusVariant;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
class CVariant;
|
||||
namespace Simulation { namespace FsCommon { class CAircraftCfgEntriesList; } }
|
||||
}
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Test
|
||||
{
|
||||
//! Proxy class for BlackMisc::Test::CTestService. This part is the caller.
|
||||
class BLACKMISC_EXPORT ITestServiceInterface: public QDBusAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
ITestServiceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~ITestServiceInterface();
|
||||
|
||||
//! Ping via DBus, tests object marshalling/unmarshalling
|
||||
static int pingTests(ITestServiceInterface &testServiceInterface, bool verbose);
|
||||
|
||||
//! DBus calls
|
||||
//! @{
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAtcStation> getAtcStation()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QLatin1Literal("getAtcStation"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Simulation::FsCommon::CAircraftCfgEntriesList> getAircraftCfgEntriesList(int number)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(number);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("getAircraftCfgEntriesList"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAtcStationList> getAtcStationList(int number)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(number);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("getAtcStationList"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<QList<QDBusObjectPath>> getObjectPaths(int number)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(number);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("getObjectPaths"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::PhysicalQuantities::CSpeed> getSpeed()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QLatin1Literal("getSpeed"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAltitude> pingAltitude(const BlackMisc::Aviation::CAltitude &altitude)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(altitude);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAltitude"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAircraftSituation> pingSituation(const BlackMisc::Aviation::CAircraftSituation &situation)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(situation);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingSituation"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Network::CUser> pingUser(const BlackMisc::Network::CUser &user)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(user);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingUser"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CTransponder> pingTransponder(const BlackMisc::Aviation::CTransponder &transponder)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(transponder);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingTransponder"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAtcStation> pingAtcStation(const BlackMisc::Aviation::CAtcStation &station)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(station);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAtcStation"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAircraftIcaoCode> pingAircraftIcaoData(const BlackMisc::Aviation::CAircraftIcaoCode &icaoData)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(icaoData);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAircraftIcaoData"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAircraftLights> pingAircraftLights(const BlackMisc::Aviation::CAircraftLights &lights)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(lights);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAircraftLights"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAircraftParts> pingAircraftParts(const BlackMisc::Aviation::CAircraftParts &parts)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(parts);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAircraftParts"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAircraftEngine> pingAircraftEngine(const BlackMisc::Aviation::CAircraftEngine &engine)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(engine);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAircraftEngine"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Simulation::CAircraftModel> pingAircraftModel(const BlackMisc::Simulation::CAircraftModel &model)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(model);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAircraftModel"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Simulation::CAircraftModelList> pingAircraftModelList(const BlackMisc::Simulation::CAircraftModelList &model)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(model);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAircraftModelList"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Simulation::CSimulatedAircraft> pingSimulatedAircraft(BlackMisc::Simulation::CSimulatedAircraft aircraft)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(aircraft);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingSimulatedAircraft"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Simulation::CSimulatorPluginInfo> pingPluginInfo(BlackMisc::Simulation::CSimulatorPluginInfo info)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(info);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingPluginInfo"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAtcStationList> pingAtcStationList(BlackMisc::Aviation::CAtcStationList atcStationList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(atcStationList);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAtcStationList"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::PhysicalQuantities::CSpeed> pingSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(speed);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingSpeed"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Simulation::CSimulatedAircraftList> pingAircraftList(const BlackMisc::Simulation::CSimulatedAircraftList &aircraftList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(aircraftList);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAircraftList"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAirportList> pingAirportList(const BlackMisc::Aviation::CAirportList &airportList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(airportList);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingAirportList"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Network::CClientList> pingClientList(const BlackMisc::Network::CClientList &clientList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(clientList);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingClientList"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Network::CClient> pingClient(const BlackMisc::Network::CClient &client)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(client);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingClient"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::CVariant> pingCVariant(const BlackMisc::CVariant &variant)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(variant);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingCVariant"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::CPropertyIndex> pingPropertyIndex(const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingPropertyIndex"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::CPropertyIndexVariantMap> pingIndexVariantMap(BlackMisc::CPropertyIndexVariantMap indexVariantMap)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(indexVariantMap);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("pingIndexVariantMap"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<BlackMisc::Aviation::CAltitude> receiveAltitude(const BlackMisc::Aviation::CAltitude &altitude)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(altitude);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveAltitude"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveAtcStation(const BlackMisc::Aviation::CAtcStation &station)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(station);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveAtcStation"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveAtcStationList(const BlackMisc::Aviation::CAtcStationList &atcStationList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(atcStationList);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveAtcStationList"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveCallsign(const BlackMisc::Aviation::CCallsign &callsign)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(callsign);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveCallsign"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveComUnit(const BlackMisc::Aviation::CComSystem &comUnit)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(comUnit);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveComUnit"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveGeoPosition(const BlackMisc::Geo::CCoordinateGeodetic &geo)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(geo);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveGeoPosition"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveLength(const BlackMisc::PhysicalQuantities::CLength &length)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(length);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveLength"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveLengthsQl(const BlackMisc::CVariantList &lengthsList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(lengthsList);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveLengthsQl"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveLengthsQvl(const BlackMisc::CVariantList &lengthsVariantList)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(lengthsVariantList);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveLengthsQvl"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveList(const QList<double> &list)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(list);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveList"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(speed);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveSpeed"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveStringMessage(const QString &message)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(message);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveStringMessage"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveTrack(BlackMisc::Aviation::CTrack track)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(track);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveTrack"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveTransponder(const BlackMisc::Aviation::CTransponder &transponder)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(transponder);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveTransponder"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveValueMap(const BlackMisc::CPropertyIndexVariantMap &valueMap)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(valueMap);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveValueMap"), argumentList);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> receiveVariant(const QDBusVariant &variant, int localMetyType)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(variant) << QVariant::fromValue(localMetyType);
|
||||
return asyncCallWithArgumentList(QLatin1Literal("receiveVariant"), argumentList);
|
||||
}
|
||||
//! @}
|
||||
|
||||
signals:
|
||||
//! send message
|
||||
void sendStringMessage(const QString &message);
|
||||
|
||||
private:
|
||||
//! Interface name
|
||||
static const char *InterfaceName();
|
||||
|
||||
//! Compare objects and output info
|
||||
template<class ValueObject>
|
||||
static bool pingCompare(const ValueObject &in, const ValueObject &out, QTextStream &ts, bool verbose, int &errors)
|
||||
{
|
||||
const bool equal = (in == out);
|
||||
if (!equal) { errors++; }
|
||||
if (equal && !verbose) { return true; }
|
||||
ts << "I: " << in.toQString() << endl << "O: " << out.toQString() << endl;
|
||||
return equal;
|
||||
}
|
||||
|
||||
//! Error info string
|
||||
static const QString &errorInfo(bool ok);
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
#endif
|
||||
175
src/blackmisc/test/testutils.cpp
Normal file
175
src/blackmisc/test/testutils.cpp
Normal file
@@ -0,0 +1,175 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "testutils.h"
|
||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||
#include <QString>
|
||||
#include <QStringBuilder>
|
||||
#include <QVariant>
|
||||
#include <typeinfo>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Test
|
||||
{
|
||||
QString CTestUtils::getQDBusArgumentSignature(const QDBusArgument &arg, int level)
|
||||
{
|
||||
arg.beginArray();
|
||||
QVariant qv;
|
||||
const QString indent(level * 2, ' ');
|
||||
QString out;
|
||||
|
||||
while (!arg.atEnd())
|
||||
{
|
||||
const QString type = CTestUtils::dbusTypeAsString(arg.currentType());
|
||||
const QString signature = arg.currentSignature();
|
||||
qv = arg.asVariant(); // this advances in the stream
|
||||
if (qv.canConvert<QDBusArgument>())
|
||||
{
|
||||
out += indent % type % QLatin1Literal("signature ") % signature % QLatin1Char('\n');
|
||||
out += CTestUtils::getQDBusArgumentSignature(qv.value<QDBusArgument>(), level + 1) % QLatin1Char('\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
out += indent % QLatin1Literal("type: ") % type % QLatin1Literal("signature ") % signature % QLatin1Literal(" value ") % qv.toString() % QLatin1Char('\n');
|
||||
}
|
||||
}
|
||||
arg.endArray();
|
||||
return out;
|
||||
}
|
||||
|
||||
QString CTestUtils::dbusTypeAsString(QDBusArgument::ElementType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case QDBusArgument::BasicType: return QLatin1Literal("BasicType");
|
||||
case QDBusArgument::VariantType: return QLatin1Literal("VariantType");
|
||||
case QDBusArgument::ArrayType: return QLatin1Literal("ArrayType");
|
||||
case QDBusArgument::StructureType: return QLatin1Literal("StructureType");
|
||||
case QDBusArgument::MapType: return QLatin1Literal("MapType");
|
||||
case QDBusArgument::MapEntryType: return QLatin1Literal("MapEntryType");
|
||||
case QDBusArgument::UnknownType:
|
||||
default:
|
||||
return QLatin1Literal("Unknown type");
|
||||
}
|
||||
}
|
||||
|
||||
void CTestUtils::showDBusSignatures(QTextStream &out)
|
||||
{
|
||||
const CCallsign cs;
|
||||
const CLength l;
|
||||
const CAircraftIcaoCode icao;
|
||||
const CAircraftModel model;
|
||||
const CCountry country;
|
||||
const CAirportIcaoCode airportIcao;
|
||||
const CLivery livery;
|
||||
const CAirport airport;
|
||||
const CSimulatedAircraft aircraft;
|
||||
const CSimulatedAircraftList aircraftList;
|
||||
const CVariant var;
|
||||
QString s;
|
||||
s = CTestUtils::dBusSignature(cs);
|
||||
out << "CCallsign" << " size: " << s.size() << " sig: " << s << endl;
|
||||
s = CTestUtils::dBusSignature(l);
|
||||
out << "CLength" << " size: " << s.size() << " sig: " << s << endl;
|
||||
s = CTestUtils::dBusSignature(icao);
|
||||
out << "CAircraftIcaoCode" << " size: " << s.size() << " sig: " << s << endl;
|
||||
s = CTestUtils::dBusSignature(airportIcao);
|
||||
out << "CAirportIcaoCode" << " size: " << s.size() << " sig: " << s << endl;
|
||||
s = CTestUtils::dBusSignature(livery);
|
||||
out << "CLivery" << " size: " << s.size() << " sig: " << s << endl;
|
||||
s = CTestUtils::dBusSignature(country);
|
||||
out << "CCountry" << " size: " << s.size() << " sig: " << s << endl;
|
||||
s = CTestUtils::dBusSignature(airport);
|
||||
out << "CAirport" << " size: " << s.size() << " sig: " << s << endl;
|
||||
s = CTestUtils::dBusSignature(model);
|
||||
out << "CAircraftModel" << " size: " << s.size() << " sig: " << s << endl;
|
||||
s = CTestUtils::dBusSignature(aircraft);
|
||||
out << "CSimulatedAircraft" << " size: " << s.size() << " sig: " << s << endl;
|
||||
s = CTestUtils::dBusSignature(aircraftList);
|
||||
out << "CSimulatedAircraftList" << " size: " << s.size() << " sig: " << s << endl;
|
||||
s = CTestUtils::dBusSignature(var);
|
||||
out << "CVariant" << " size: " << s.size() << " sig: " << s << endl;
|
||||
}
|
||||
|
||||
CAtcStationList CTestUtils::getStations(int number)
|
||||
{
|
||||
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);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
CAircraftCfgEntriesList CTestUtils::getAircraftCfgEntries(int number)
|
||||
{
|
||||
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);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
CAirportList CTestUtils::getAirports(int number)
|
||||
{
|
||||
BlackMisc::Aviation::CAirportList list;
|
||||
for (int i = 0; i < number; i++)
|
||||
{
|
||||
const 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 CTestUtils::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;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
64
src/blackmisc/test/testutils.h
Normal file
64
src/blackmisc/test/testutils.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_TEST_TESTUTILS_H
|
||||
#define BLACKMISC_TEST_TESTUTILS_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/simulation/fscommon/aircraftcfgentrieslist.h"
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
#include "blackmisc/network/clientlist.h"
|
||||
#include <QDBusArgument>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Test
|
||||
{
|
||||
//! Utils for UNIT tests / samples
|
||||
class BLACKMISC_EXPORT CTestUtils
|
||||
{
|
||||
public:
|
||||
//! Get QDBusArgument signature (formatted)
|
||||
static QString getQDBusArgumentSignature(const QDBusArgument &arg, int level = 0);
|
||||
|
||||
//! Signature for BlackMisc::CValueObject
|
||||
template<typename ValueObj>
|
||||
static QString dBusSignature(const ValueObj &obj)
|
||||
{
|
||||
QDBusArgument arg;
|
||||
obj.marshallToDbus(arg);
|
||||
return arg.currentSignature();
|
||||
}
|
||||
|
||||
//! Type as string
|
||||
static QString dbusTypeAsString(QDBusArgument::ElementType type);
|
||||
|
||||
//! Show some (important) DBus signatures
|
||||
static void showDBusSignatures(QTextStream &out);
|
||||
|
||||
// ----------------- some test data --------------------
|
||||
//! Get ATC 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);
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user