mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 18:55:38 +08:00
Ref T231, Ref T236, Ref T238 made command parsing function mandatory for contexts
* we can send commands to any context * to send to all contexts use the facade * application relays to facade
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <QStringBuilder>
|
||||||
|
|
||||||
namespace BlackMisc { class CLogCategoryList; }
|
namespace BlackMisc { class CLogCategoryList; }
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
@@ -125,9 +126,16 @@ namespace BlackCore
|
|||||||
//! Debug enabled?
|
//! Debug enabled?
|
||||||
bool isDebugEnabled() const;
|
bool isDebugEnabled() const;
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
// All context must implement those functions
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
|
||||||
//! Id and path name for round trip protection
|
//! Id and path name for round trip protection
|
||||||
virtual QString getPathAndContextId() const = 0;
|
virtual QString getPathAndContextId() const = 0;
|
||||||
|
|
||||||
|
//! Parse a given command line
|
||||||
|
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) = 0;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Log or debug values changed
|
//! Log or debug values changed
|
||||||
void changedLogOrDebugSettings();
|
void changedLogOrDebugSettings();
|
||||||
@@ -145,7 +153,7 @@ namespace BlackCore
|
|||||||
//! Path and context id
|
//! Path and context id
|
||||||
QString buildPathAndContextId(const QString &path) const
|
QString buildPathAndContextId(const QString &path) const
|
||||||
{
|
{
|
||||||
return QString(path) + ":" + QString::number(this->getUniqueId());
|
return path % QStringLiteral(":") % QString::number(this->getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Relay signals from this class
|
//! Relay signals from this class
|
||||||
|
|||||||
@@ -149,6 +149,12 @@ namespace BlackCore
|
|||||||
Q_UNUSED(argument);
|
Q_UNUSED(argument);
|
||||||
Q_UNUSED(origin);
|
Q_UNUSED(origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IContextApplication::parseCommandLine(const QString &commandLine, const CIdentifier &originator)
|
||||||
|
{
|
||||||
|
if (!this->getRuntime()) { return false; }
|
||||||
|
return this->getRuntime()->parseCommandLine(commandLine, originator);
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|
||||||
|
|||||||
@@ -205,6 +205,9 @@ namespace BlackCore
|
|||||||
//! Remote enabled version of file exists
|
//! Remote enabled version of file exists
|
||||||
virtual bool existsFile(const QString &fileName) const = 0;
|
virtual bool existsFile(const QString &fileName) const = 0;
|
||||||
|
|
||||||
|
//! Forward to facade
|
||||||
|
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
|
||||||
|
|
||||||
//! The HTML help for dot commands
|
//! The HTML help for dot commands
|
||||||
virtual QString dotCommandsHtmlHelp() const = 0;
|
virtual QString dotCommandsHtmlHelp() const = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -173,9 +173,6 @@ namespace BlackCore
|
|||||||
|
|
||||||
//! Is loobback enabled?
|
//! Is loobback enabled?
|
||||||
virtual bool isAudioLoopbackEnabled() const = 0;
|
virtual bool isAudioLoopbackEnabled() const = 0;
|
||||||
|
|
||||||
//! Command line was entered
|
|
||||||
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) = 0;
|
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -245,9 +245,6 @@ namespace BlackCore
|
|||||||
//! Load flight plan (from network)
|
//! Load flight plan (from network)
|
||||||
virtual BlackMisc::Aviation::CFlightPlan loadFlightPlanFromNetwork(const BlackMisc::Aviation::CCallsign &callsign) const = 0;
|
virtual BlackMisc::Aviation::CFlightPlan loadFlightPlanFromNetwork(const BlackMisc::Aviation::CCallsign &callsign) const = 0;
|
||||||
|
|
||||||
//! Command line was entered
|
|
||||||
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) = 0;
|
|
||||||
|
|
||||||
//! Use the selected COM1/2 frequencies, and get the corresponding voice room for it
|
//! Use the selected COM1/2 frequencies, and get the corresponding voice room for it
|
||||||
virtual BlackMisc::Audio::CVoiceRoomList getSelectedVoiceRooms() const = 0;
|
virtual BlackMisc::Audio::CVoiceRoomList getSelectedVoiceRooms() const = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -139,9 +139,6 @@ namespace BlackCore
|
|||||||
//! Automatic voice room resolution for frequencies
|
//! Automatic voice room resolution for frequencies
|
||||||
virtual void enableAutomaticVoiceRoomResolution(bool enable) = 0;
|
virtual void enableAutomaticVoiceRoomResolution(bool enable) = 0;
|
||||||
|
|
||||||
//! Parse command line
|
|
||||||
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) = 0;
|
|
||||||
|
|
||||||
//! Default situation
|
//! Default situation
|
||||||
//! \remark normally used when no driver is attached
|
//! \remark normally used when no driver is attached
|
||||||
static const BlackMisc::Aviation::CAircraftSituation &getDefaultSituation();
|
static const BlackMisc::Aviation::CAircraftSituation &getDefaultSituation();
|
||||||
|
|||||||
@@ -209,9 +209,6 @@ namespace BlackCore
|
|||||||
//! Request weather grid. Argument identifier is past in the signal to identify the requestor
|
//! Request weather grid. Argument identifier is past in the signal to identify the requestor
|
||||||
virtual void requestWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid, const BlackMisc::CIdentifier &identifier) = 0;
|
virtual void requestWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid, const BlackMisc::CIdentifier &identifier) = 0;
|
||||||
|
|
||||||
//! Parse a given command line
|
|
||||||
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) = 0;
|
|
||||||
|
|
||||||
//! Current matching statistics
|
//! Current matching statistics
|
||||||
virtual BlackMisc::Simulation::CMatchingStatistics getCurrentMatchingStatistics(bool missingOnly) const = 0;
|
virtual BlackMisc::Simulation::CMatchingStatistics getCurrentMatchingStatistics(bool missingOnly) const = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user