mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-04 08:06:29 +08:00
@@ -19,7 +19,7 @@
|
||||
#include "blackmisc/pq/pq.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMiscTest;
|
||||
using namespace BlackSample;
|
||||
|
||||
//! Sample tests
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <QString>
|
||||
#include <numeric>
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_SAMPLESALGORITHM_H
|
||||
#define BLACKMISCTEST_SAMPLESALGORITHM_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESALGORITHM_H
|
||||
#define BLACKSAMPLE_SAMPLESALGORITHM_H
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
//! Samples for our algorithms
|
||||
class CSamplesAlgorithm
|
||||
|
||||
@@ -25,7 +25,7 @@ using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_SAMPLESCHANGEDATA_H
|
||||
#define BLACKMISCTEST_SAMPLESCHANGEDATA_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESCHANGEDATA_H
|
||||
#define BLACKSAMPLE_SAMPLESCHANGEDATA_H
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
//! Samples for metadata
|
||||
class CSamplesChangeObject
|
||||
|
||||
@@ -20,7 +20,7 @@ using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_SAMPLESCONTAINER_H
|
||||
#define BLACKMISCTEST_SAMPLESCONTAINER_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESCONTAINER_H
|
||||
#define BLACKSAMPLE_SAMPLESCONTAINER_H
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
//! Samples for our containers
|
||||
class CSamplesContainer
|
||||
|
||||
@@ -20,7 +20,7 @@ using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_SAMPLESJSON_H
|
||||
#define BLACKMISCTEST_SAMPLESJSON_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESJSON_H
|
||||
#define BLACKSAMPLE_SAMPLESJSON_H
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
//! Samples for metadata
|
||||
|
||||
@@ -19,7 +19,7 @@ using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
int CSamplesMetadata::samples()
|
||||
{
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_SAMPLESMETADATA_H
|
||||
#define BLACKMISCTEST_SAMPLESMETADATA_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESMETADATA_H
|
||||
#define BLACKSAMPLE_SAMPLESMETADATA_H
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
//! Samples for metadata
|
||||
|
||||
@@ -19,7 +19,7 @@ using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
#include <QRegularExpression>
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_SAMPLESPERFORMANCEINDEX_H
|
||||
#define BLACKMISCTEST_SAMPLESPERFORMANCEINDEX_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESPERFORMANCE_H
|
||||
#define BLACKSAMPLE_SAMPLESPERFORMANCE_H
|
||||
|
||||
#include "blackmisc/aviation/aircraftsituationlist.h"
|
||||
#include <QTextStream>
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
//! Samples for our containers
|
||||
class CSamplesPerformance
|
||||
|
||||
@@ -140,12 +140,12 @@ int main(int argc, char *argv[])
|
||||
args << ip;
|
||||
args << port;
|
||||
}
|
||||
BlackMiscTest::ServiceTool::startNewProcess(executable, args, &a);
|
||||
BlackSample::ServiceTool::startNewProcess(executable, args, &a);
|
||||
|
||||
// run tests
|
||||
if (mode == "testservice")
|
||||
{
|
||||
BlackMiscTest::ServiceTool::dataTransferTestServer(dBusServer);
|
||||
BlackSample::ServiceTool::dataTransferTestServer(dBusServer);
|
||||
}
|
||||
|
||||
// loop
|
||||
@@ -159,7 +159,7 @@ int main(int argc, char *argv[])
|
||||
// run tests
|
||||
if (cmdlineArgs.contains("testservice", Qt::CaseInsensitive))
|
||||
{
|
||||
BlackMiscTest::ServiceTool::dataTransferTestClient(address);
|
||||
BlackSample::ServiceTool::dataTransferTestClient(address);
|
||||
}
|
||||
|
||||
// loop
|
||||
|
||||
@@ -24,9 +24,8 @@ using namespace BlackMisc::Math;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
using namespace BlackMiscTest;
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
QProcess *ServiceTool::startNewProcess(const QString &executable, const QStringList &arguments, QObject *parent)
|
||||
{
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_SERVICETOOL_H
|
||||
#define BLACKMISCTEST_SERVICETOOL_H
|
||||
#ifndef BLACKSAMPLE_SERVICETOOL_H
|
||||
#define BLACKSAMPLE_SERVICETOOL_H
|
||||
|
||||
#include "blackmisc/dbusserver.h"
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <QProcess>
|
||||
#include <QDBusConnection>
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
class Testservice; // forward declaration
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
const QString Testservice::InterfaceName = QString(BLACKSAMPLE_TESTSERVICE_INTERFACENAME);
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCKTEST_TESTSERVICE_H
|
||||
#define BLACKMISCKTEST_TESTSERVICE_H
|
||||
#ifndef BLACKSAMPLE_TESTSERVICE_H
|
||||
#define BLACKSAMPLE_TESTSERVICE_H
|
||||
|
||||
// clash with struct interface in objbase.h used to happen
|
||||
#pragma push_macro("interface")
|
||||
@@ -33,7 +33,7 @@
|
||||
#define BLACKSAMPLE_TESTSERVICE_INTERFACENAME "blackmisctest.testservice"
|
||||
#define BLACKSAMPLE_TESTSERVICE_OBJECTPATH "/ts"
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
//! Testservice for PQ / CValueObject DBus tests
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "testserviceinterface.h"
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
TestServiceInterface::TestServiceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_TESTSERVICE_INTERFACE_H
|
||||
#define BLACKMISCTEST_TESTSERVICE_INTERFACE_H
|
||||
#ifndef BLACKSAMPLE_TESTSERVICE_INTERFACE_H
|
||||
#define BLACKSAMPLE_TESTSERVICE_INTERFACE_H
|
||||
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
//! Proxy class for interface blackmisctest.testservice
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <QTextStream>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMiscTest;
|
||||
using namespace BlackSample;
|
||||
|
||||
//! Samples
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
@@ -26,7 +26,7 @@ using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
int CSamplesAviation::samples(QTextStream &out)
|
||||
{
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_SAMPLESAVIATION_H
|
||||
#define BLACKMISCTEST_SAMPLESAVIATION_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESAVIATION_H
|
||||
#define BLACKSAMPLE_SAMPLESAVIATION_H
|
||||
|
||||
#include <QTextStream>
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
//! Samples for aviation
|
||||
|
||||
@@ -17,7 +17,7 @@ using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
int CSamplesGeo::samples(QTextStream &out)
|
||||
{
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_SAMPLESGEO_H
|
||||
#define BLACKMISCTEST_SAMPLESGEO_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESGEO_H
|
||||
#define BLACKSAMPLE_SAMPLESGEO_H
|
||||
|
||||
#include "blackmisc/pq/constants.h"
|
||||
#include <QTextStream>
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
//! Samples for physical quantities
|
||||
class CSamplesGeo
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
int CSamplesPhysicalQuantities::samples(QTextStream &out)
|
||||
{
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISCTEST_SAMPLESPHYSICALQUANTITIES_H
|
||||
#define BLACKMISCTEST_SAMPLESPHYSICALQUANTITIES_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESPHYSICALQUANTITIES_H
|
||||
#define BLACKSAMPLE_SAMPLESPHYSICALQUANTITIES_H
|
||||
|
||||
#include "blackmisc/pq/constants.h"
|
||||
#include <QTextStream>
|
||||
|
||||
namespace BlackMiscTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
//! Samples for physical quantities
|
||||
|
||||
@@ -42,19 +42,19 @@ int main(int argc, char *argv[])
|
||||
t.start();
|
||||
if (i.startsWith("1"))
|
||||
{
|
||||
BlackSimTest::CSamplesFsCommon::samples(streamOut, streamIn);
|
||||
BlackSample::CSamplesFsCommon::samples(streamOut, streamIn);
|
||||
}
|
||||
else if (i.startsWith("2"))
|
||||
{
|
||||
BlackSimTest::CSamplesFsx::samplesMisc(streamOut);
|
||||
BlackSample::CSamplesFsx::samplesMisc(streamOut);
|
||||
}
|
||||
else if (i.startsWith("3"))
|
||||
{
|
||||
BlackSimTest::CSamplesModelMapping::samples(streamOut, streamIn);
|
||||
BlackSample::CSamplesModelMapping::samples(streamOut, streamIn);
|
||||
}
|
||||
else if (i.startsWith("4"))
|
||||
{
|
||||
BlackSimTest::CSamplesVPilotRules::samples(streamOut, streamIn);
|
||||
BlackSample::CSamplesVPilotRules::samples(streamOut, streamIn);
|
||||
}
|
||||
else if (i.startsWith("x"))
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
|
||||
namespace BlackSimTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSIMTEST_SAMPLESFSCOMMON_H
|
||||
#define BLACKSIMTEST_SAMPLESFSCOMMON_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESFSCOMMON_H
|
||||
#define BLACKSAMPLE_SAMPLESFSCOMMON_H
|
||||
|
||||
#include <QTextStream>
|
||||
|
||||
namespace BlackSimTest
|
||||
namespace BlackSample
|
||||
{
|
||||
//! Samples for FsCommon classes
|
||||
class CSamplesFsCommon
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
using namespace BlackMisc::Simulation::Fsx;
|
||||
|
||||
namespace BlackSimTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSIMTEST_SAMPLESFSX_H
|
||||
#define BLACKSIMTEST_SAMPLESFSX_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESFSX_H
|
||||
#define BLACKSAMPLE_SAMPLESFSX_H
|
||||
|
||||
#include <QTextStream>
|
||||
|
||||
namespace BlackSimTest
|
||||
namespace BlackSample
|
||||
{
|
||||
//! Samples for FSX classes
|
||||
class CSamplesFsx
|
||||
|
||||
@@ -24,7 +24,7 @@ using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackSimTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSIMTEST_SAMPLESMODELMAPPING_H
|
||||
#define BLACKSIMTEST_SAMPLESMODELMAPPING_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESMODELMAPPING_H
|
||||
#define BLACKSAMPLE_SAMPLESMODELMAPPING_H
|
||||
|
||||
#include <QTextStream>
|
||||
|
||||
namespace BlackSimTest
|
||||
namespace BlackSample
|
||||
{
|
||||
//! Samples for model mapping classes
|
||||
class CSamplesModelMapping
|
||||
|
||||
@@ -21,7 +21,7 @@ using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
|
||||
namespace BlackSimTest
|
||||
namespace BlackSample
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSIMTEST_SAMPLESVPILOTRULES_H
|
||||
#define BLACKSIMTEST_SAMPLESVPILOTRULES_H
|
||||
#ifndef BLACKSAMPLE_SAMPLESVPILOTRULES_H
|
||||
#define BLACKSAMPLE_SAMPLESVPILOTRULES_H
|
||||
|
||||
#include <QTextStream>
|
||||
|
||||
namespace BlackSimTest
|
||||
namespace BlackSample
|
||||
{
|
||||
//! Samples for vPilot rules
|
||||
class CSamplesVPilotRules
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSAMPLE_CLI_CLIENT_H
|
||||
#define BLACKSAMPLE_CLI_CLIENT_H
|
||||
#ifndef BLACKSAMPLE_CLICLIENT_CLIENT_H
|
||||
#define BLACKSAMPLE_CLICLIENT_CLIENT_H
|
||||
|
||||
#include "blackcore/network.h"
|
||||
#include "blackmisc/simulation/ownaircraftproviderdummy.h"
|
||||
@@ -20,104 +20,109 @@
|
||||
#include <QMap>
|
||||
#include <functional>
|
||||
|
||||
class Client :
|
||||
public QObject,
|
||||
public BlackMisc::Simulation::COwnAircraftAware,
|
||||
public BlackMisc::CIdentifiable
|
||||
namespace BlackSample
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Client(QObject *parent = nullptr);
|
||||
class Client :
|
||||
public QObject,
|
||||
public BlackMisc::Simulation::COwnAircraftAware,
|
||||
public BlackMisc::CIdentifiable
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
//! Terminated
|
||||
void quit();
|
||||
public:
|
||||
Client(QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
//! Handle command
|
||||
void command(QString line);
|
||||
signals:
|
||||
//! Terminated
|
||||
void quit();
|
||||
|
||||
private: //commands
|
||||
void help(QTextStream &args);
|
||||
void echo(QTextStream &args);
|
||||
void exit(QTextStream &args);
|
||||
void presetServerCmd(QTextStream &args);
|
||||
void presetCallsignCmd(QTextStream &args);
|
||||
void presetIcaoCodesCmd(QTextStream &args);
|
||||
void presetLoginModeCmd(QTextStream &args);
|
||||
void initiateConnectionCmd(QTextStream &args);
|
||||
void terminateConnectionCmd(QTextStream &args);
|
||||
void sendPrivateTextMessageCmd(QTextStream &args);
|
||||
void sendRadioTextMessageCmd(QTextStream &args);
|
||||
void sendIpQueryCmd(QTextStream &args);
|
||||
void sendFreqQueryCmd(QTextStream &args);
|
||||
void sendServerQueryCmd(QTextStream &args);
|
||||
void sendAtcQueryCmd(QTextStream &args);
|
||||
void sendAtisQueryCmd(QTextStream &args);
|
||||
void sendFlightPlanCmd(QTextStream &args);
|
||||
void sendFlightPlanQueryCmd(QTextStream &args);
|
||||
void sendRealNameQueryCmd(QTextStream &args);
|
||||
void sendCapabilitiesQueryCmd(QTextStream &args);
|
||||
void sendIcaoCodesQueryCmd(QTextStream &args);
|
||||
void setOwnAircraftCmd(QTextStream &args);
|
||||
void setOwnAircraftPositionCmd(QTextStream &args);
|
||||
void setOwnAircraftSituationCmd(QTextStream &args);
|
||||
void setOwnAircraftCockpitCmd(QTextStream &args);
|
||||
void sendPingCmd(QTextStream &args);
|
||||
void sendMetarQueryCmd(QTextStream &args);
|
||||
void sendCustomPacketCmd(QTextStream &args);
|
||||
public slots:
|
||||
//! Handle command
|
||||
void command(QString line);
|
||||
|
||||
signals: //to send to INetwork
|
||||
void presetServer(const BlackMisc::Network::CServer &server);
|
||||
void presetCallsign(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void presetRealName(const QString &name);
|
||||
void presetIcaoCodes(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
void presetLoginMode(BlackCore::INetwork::LoginMode mode);
|
||||
void initiateConnection();
|
||||
void terminateConnection();
|
||||
void sendTextMessages(const BlackMisc::Network::CTextMessageList &textMessages);
|
||||
void sendRadioTextMessage(const QVector<BlackMisc::PhysicalQuantities::CFrequency> &freqs, const QString &msg);
|
||||
void sendIpQuery();
|
||||
void sendFreqQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendServerQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendAtcQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendAtisQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendFlightPlan(const BlackMisc::Aviation::CFlightPlan &fp);
|
||||
void sendFlightPlanQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendRealNameQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendCapabilitiesQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendIcaoCodesQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void setOwnAircraftCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2,
|
||||
const BlackMisc::Aviation::CTransponder &xpdr, const QString &originator);
|
||||
void sendPing(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendMetarQuery(const QString &airportICAO);
|
||||
void sendCustomPacket(const BlackMisc::Aviation::CCallsign &callsign, const QString &packetId, const QStringList &data);
|
||||
private: //commands
|
||||
void help(QTextStream &args);
|
||||
void echo(QTextStream &args);
|
||||
void exit(QTextStream &args);
|
||||
void presetServerCmd(QTextStream &args);
|
||||
void presetCallsignCmd(QTextStream &args);
|
||||
void presetIcaoCodesCmd(QTextStream &args);
|
||||
void presetLoginModeCmd(QTextStream &args);
|
||||
void initiateConnectionCmd(QTextStream &args);
|
||||
void terminateConnectionCmd(QTextStream &args);
|
||||
void sendPrivateTextMessageCmd(QTextStream &args);
|
||||
void sendRadioTextMessageCmd(QTextStream &args);
|
||||
void sendIpQueryCmd(QTextStream &args);
|
||||
void sendFreqQueryCmd(QTextStream &args);
|
||||
void sendServerQueryCmd(QTextStream &args);
|
||||
void sendAtcQueryCmd(QTextStream &args);
|
||||
void sendAtisQueryCmd(QTextStream &args);
|
||||
void sendFlightPlanCmd(QTextStream &args);
|
||||
void sendFlightPlanQueryCmd(QTextStream &args);
|
||||
void sendRealNameQueryCmd(QTextStream &args);
|
||||
void sendCapabilitiesQueryCmd(QTextStream &args);
|
||||
void sendIcaoCodesQueryCmd(QTextStream &args);
|
||||
void setOwnAircraftCmd(QTextStream &args);
|
||||
void setOwnAircraftPositionCmd(QTextStream &args);
|
||||
void setOwnAircraftSituationCmd(QTextStream &args);
|
||||
void setOwnAircraftCockpitCmd(QTextStream &args);
|
||||
void sendPingCmd(QTextStream &args);
|
||||
void sendMetarQueryCmd(QTextStream &args);
|
||||
void sendCustomPacketCmd(QTextStream &args);
|
||||
|
||||
public slots: //to receive from INetwork
|
||||
void atcPositionUpdate(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &freq,
|
||||
const BlackMisc::Geo::CCoordinateGeodetic &pos, const BlackMisc::PhysicalQuantities::CLength &range);
|
||||
void atcDisconnected(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void connectionStatusChanged(BlackCore::INetwork::ConnectionStatus oldStatus, BlackCore::INetwork::ConnectionStatus newStatus);
|
||||
void ipReplyReceived(const QString &ip);
|
||||
void freqReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &freq);
|
||||
void serverReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &server);
|
||||
void atcReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, bool isATC);
|
||||
void atisReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CInformationMessage &atis);
|
||||
void realNameReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &realname);
|
||||
void capabilitiesReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, quint32 flags);
|
||||
void kicked(const QString &msg);
|
||||
void metarReplyReceived(const QString &data);
|
||||
void flightPlanReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CFlightPlan &flightPlan);
|
||||
void pilotDisconnected(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void icaoCodesReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &aircraftIcaoDesignator, const QString &airlineIcaoDesignator, const QString &livery);
|
||||
void pongReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CTime &elapsedTime);
|
||||
void textMessagesReceived(const BlackMisc::Network::CTextMessageList &messages);
|
||||
void customPacketReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &packetId, const QStringList &data);
|
||||
signals: //to send to INetwork
|
||||
void presetServer(const BlackMisc::Network::CServer &server);
|
||||
void presetCallsign(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void presetRealName(const QString &name);
|
||||
void presetIcaoCodes(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
void presetLoginMode(BlackCore::INetwork::LoginMode mode);
|
||||
void initiateConnection();
|
||||
void terminateConnection();
|
||||
void sendTextMessages(const BlackMisc::Network::CTextMessageList &textMessages);
|
||||
void sendRadioTextMessage(const QVector<BlackMisc::PhysicalQuantities::CFrequency> &freqs, const QString &msg);
|
||||
void sendIpQuery();
|
||||
void sendFreqQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendServerQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendAtcQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendAtisQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendFlightPlan(const BlackMisc::Aviation::CFlightPlan &fp);
|
||||
void sendFlightPlanQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendRealNameQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendCapabilitiesQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendIcaoCodesQuery(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void setOwnAircraftCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2,
|
||||
const BlackMisc::Aviation::CTransponder &xpdr, const QString &originator);
|
||||
void sendPing(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendMetarQuery(const QString &airportICAO);
|
||||
void sendCustomPacket(const BlackMisc::Aviation::CCallsign &callsign, const QString &packetId, const QStringList &data);
|
||||
|
||||
private:
|
||||
QMap<QString, std::function<void(QTextStream &)>> m_commands;
|
||||
BlackCore::INetwork *m_net;
|
||||
};
|
||||
public slots: //to receive from INetwork
|
||||
void atcPositionUpdate(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &freq,
|
||||
const BlackMisc::Geo::CCoordinateGeodetic &pos, const BlackMisc::PhysicalQuantities::CLength &range);
|
||||
void atcDisconnected(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void connectionStatusChanged(BlackCore::INetwork::ConnectionStatus oldStatus, BlackCore::INetwork::ConnectionStatus newStatus);
|
||||
void ipReplyReceived(const QString &ip);
|
||||
void freqReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &freq);
|
||||
void serverReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &server);
|
||||
void atcReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, bool isATC);
|
||||
void atisReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CInformationMessage &atis);
|
||||
void realNameReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &realname);
|
||||
void capabilitiesReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, quint32 flags);
|
||||
void kicked(const QString &msg);
|
||||
void metarReplyReceived(const QString &data);
|
||||
void flightPlanReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CFlightPlan &flightPlan);
|
||||
void pilotDisconnected(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void icaoCodesReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &aircraftIcaoDesignator, const QString &airlineIcaoDesignator, const QString &livery);
|
||||
void pongReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CTime &elapsedTime);
|
||||
void textMessagesReceived(const BlackMisc::Network::CTextMessageList &messages);
|
||||
void customPacketReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &packetId, const QStringList &data);
|
||||
|
||||
private:
|
||||
QMap<QString, std::function<void(QTextStream &)>> m_commands;
|
||||
BlackCore::INetwork *m_net;
|
||||
};
|
||||
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QTextCodec>
|
||||
|
||||
using namespace BlackSample;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app (argc, argv);
|
||||
|
||||
@@ -10,16 +10,19 @@
|
||||
#include "reader.h"
|
||||
#include <QFile>
|
||||
|
||||
void LineReader::run()
|
||||
namespace BlackSample
|
||||
{
|
||||
QFile file;
|
||||
file.open(stdin, QIODevice::ReadOnly | QIODevice::Text);
|
||||
forever
|
||||
void LineReader::run()
|
||||
{
|
||||
QString line = file.readLine().trimmed();
|
||||
if (! line.isEmpty())
|
||||
QFile file;
|
||||
file.open(stdin, QIODevice::ReadOnly | QIODevice::Text);
|
||||
forever
|
||||
{
|
||||
emit command(line);
|
||||
QString line = file.readLine().trimmed();
|
||||
if (! line.isEmpty())
|
||||
{
|
||||
emit command(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,24 +9,29 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef __BLACKSAMPLE_CLI_CLIENT_READER_H__
|
||||
#define __BLACKSAMPLE_CLI_CLIENT_READER_H__
|
||||
#ifndef BLACKSAMPLE_CLICLIENT_LINEREADER_H
|
||||
#define BLACKSAMPLE_CLICLIENT_LINEREADER_H
|
||||
|
||||
#include <QThread>
|
||||
#include <QString>
|
||||
|
||||
class LineReader : public QThread
|
||||
namespace BlackSample
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LineReader() {}
|
||||
class LineReader : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
void run();
|
||||
public:
|
||||
LineReader() {}
|
||||
|
||||
signals:
|
||||
void command(const QString &line);
|
||||
};
|
||||
protected:
|
||||
void run();
|
||||
|
||||
#endif //__BLACKSAMPLE_CLI_CLIENT_READER_H__
|
||||
signals:
|
||||
void command(const QString &line);
|
||||
};
|
||||
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSAMPLE_WEATERDATA_READER_H
|
||||
#define BLACKSAMPLE_WEATERDATA_READER_H
|
||||
#ifndef BLACKSAMPLE_WEATHERDATA_LINEREADER_H
|
||||
#define BLACKSAMPLE_WEATHERDATA_LINEREADER_H
|
||||
|
||||
#include "blackmisc/geo/latitude.h"
|
||||
#include "blackmisc/geo/longitude.h"
|
||||
@@ -40,4 +40,4 @@ signals:
|
||||
void quit();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user