refs #894, register dot commands for help

(wherever dor commands are implemented)
This commit is contained in:
Klaus Basan
2017-03-03 05:00:04 +01:00
committed by Mathew Sutcliffe
parent b287d8d9d7
commit 38ea336cbb
12 changed files with 83 additions and 20 deletions

View File

@@ -62,6 +62,7 @@ namespace BlackCore
Q_ASSERT(this->getRuntime());
Q_ASSERT(this->getIContextOwnAircraft());
Q_ASSERT(this->getIContextOwnAircraft()->isUsingImplementingObject());
CContextNetwork::registerHelp();
// 1. Init by "network driver"
this->m_network = new CNetworkVatlib(this->getRuntime()->getCContextOwnAircraft(), this);

View File

@@ -48,6 +48,7 @@
#include "blackmisc/statusmessage.h"
#include "blackmisc/digestsignal.h"
#include "blackmisc/identifier.h"
#include "blackmisc/simplecommandparser.h"
class QTimer;
@@ -141,6 +142,15 @@ namespace BlackCore
//! \copydoc IContextNetwork::parseCommandLine
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
//! Register help
static void registerHelp()
{
if (BlackMisc::CSimpleCommandParser::registered("BlackCore::CContextNetwork")) { return; }
BlackMisc::CSimpleCommandParser::registerCommand({".m", "alias: .msg"});
BlackMisc::CSimpleCommandParser::registerCommand({".m message <text>", "send text message"});
BlackMisc::CSimpleCommandParser::registerCommand({".m callsign message <text>", "send text message"});
}
//! \publicsection
//! @{
virtual BlackMisc::Aviation::CAtcStationList getAtcStationsBooked() const override;

View File

@@ -58,6 +58,7 @@ namespace BlackCore
{
Q_ASSERT(this->getRuntime());
this->setObjectName("CContextOwnAircraft");
CContextOwnAircraft::registerHelp();
if (sApp && sApp->getWebDataServices())
{

View File

@@ -31,6 +31,7 @@
#include "blackmisc/settingscache.h"
#include "blackmisc/identifiable.h"
#include "blackmisc/identifier.h"
#include "blackmisc/simplecommandparser.h"
#include <QObject>
#include <QReadWriteLock>
@@ -141,6 +142,7 @@ namespace BlackCore
//! @{
//! <pre>
//! .x .xpdr code set transponder code BlackCore::Context::CContextOwnAircraft
//! .x .xpdr mode set transponder mode BlackCore::Context::CContextOwnAircraft
//! .com1 .com2 frequency set COM1/2 frequency BlackCore::Context::CContextOwnAircraft
//! .selcal code set SELCAL code BlackCore::Context::CContextOwnAircraft
//! </pre>
@@ -148,6 +150,18 @@ namespace BlackCore
//! \copydoc IContextOwnAircraft::parseCommandLine
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
//! Register help
static void registerHelp()
{
if (BlackMisc::CSimpleCommandParser::registered("BlackCore::Context::CContextOwnAircraft")) { return; }
BlackMisc::CSimpleCommandParser::registerCommand({".x", "alias: .xpdr"});
BlackMisc::CSimpleCommandParser::registerCommand({".x code|mode", "set XPDR code or mode"});
BlackMisc::CSimpleCommandParser::registerCommand({".selcal code", "set SELCAL code"});
BlackMisc::CSimpleCommandParser::registerCommand({".com1", "alias .c1"});
BlackMisc::CSimpleCommandParser::registerCommand({".com1 frequency", "set COM1 frequency"});
BlackMisc::CSimpleCommandParser::registerCommand({".com2 frequency", "set COM2 frequency"});
}
protected:
//! Constructor, with link to runtime
CContextOwnAircraft(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime);

View File

@@ -51,6 +51,13 @@ namespace BlackCore
return static_cast<SimulatorStatus>(status);
}
ISimulator::ISimulator(QObject *parent) :
QObject(parent),
BlackMisc::CIdentifiable(this)
{
ISimulator::registerHelp();
}
void ISimulator::emitSimulatorCombinedStatus(int oldStatus)
{
int newStatus = getSimulatorStatus();

View File

@@ -25,6 +25,7 @@
#include "blackmisc/identifiable.h"
#include "blackmisc/identifier.h"
#include "blackmisc/pixmap.h"
#include "blackmisc/simplecommandparser.h"
#include <QFlags>
#include <QObject>
@@ -159,6 +160,15 @@ namespace BlackCore
//! Parse command line
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) = 0;
//! Register help
static void registerHelp()
{
if (BlackMisc::CSimpleCommandParser::registered("BlackCore::ISimulator")) { return; }
BlackMisc::CSimpleCommandParser::registerCommand({".drv", "alias: .driver .plugin"});
BlackMisc::CSimpleCommandParser::registerCommand({".drv unload", "unload driver"});
BlackMisc::CSimpleCommandParser::registerCommand({".drv fsuipc on|off", "enable/disable FSUIPC (if applicable)"});
}
//! Status to string
static QString statusToString(int status);
@@ -188,10 +198,7 @@ namespace BlackCore
protected:
//! Default constructor
ISimulator(QObject *parent = nullptr) :
QObject(parent),
BlackMisc::CIdentifiable(this)
{}
ISimulator(QObject *parent = nullptr);
//! Are we connected to the simulator?
virtual bool isConnected() const = 0;

View File

@@ -53,6 +53,7 @@ namespace BlackCore
m_simulatorPluginInfo(info)
{
this->setObjectName("Simulator: " + info.getIdentifier());
CSimulatorCommon::registerHelp();
// provider signals, hook up with remote aircraft provider
m_remoteAircraftProviderConnections.append(

View File

@@ -88,15 +88,27 @@ namespace BlackCore
//! \addtogroup swiftdotcommands
//! @{
//! <pre>
//! .plugin unload unload plugin BlackCore::CSimulatorCommon
//! .plugin logint callsign log interpolator for callsign BlackCore::CSimulatorCommon
//! .plugin logint off no log information for interpolator BlackCore::CSimulatorCommon
//! .plugin logint write write interpolator log to file BlackCore::CSimulatorCommon
//! .plugin logint clear clear current log BlackCore::CSimulatorCommon
//! .drv unload unload plugin BlackCore::CSimulatorCommon
//! .drv logint callsign log interpolator for callsign BlackCore::CSimulatorCommon
//! .drv logint off no log information for interpolator BlackCore::CSimulatorCommon
//! .drv logint write write interpolator log to file BlackCore::CSimulatorCommon
//! .drv logint clear clear current log BlackCore::CSimulatorCommon
//! </pre>
//! @}
//! \copydoc ISimulator::parseCommandLine
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
//! Register help
static void registerHelp()
{
if (BlackMisc::CSimpleCommandParser::registered("BlackCore::CSimulatorCommon")) { return; }
BlackMisc::CSimpleCommandParser::registerCommand({".drv", "alias: .driver .plugin"});
BlackMisc::CSimpleCommandParser::registerCommand({".drv logint callsign", "log interpolator for callsign"});
BlackMisc::CSimpleCommandParser::registerCommand({".drv logint off", "no log information for interpolator"});
BlackMisc::CSimpleCommandParser::registerCommand({".drv logint write", "write interpolator log to file"});
BlackMisc::CSimpleCommandParser::registerCommand({".drv logint clear", "clear current log"});
}
// --------- ISimulator implementations ------------
protected slots: