mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refactor: Remove unused methods
This commit is contained in:
@@ -29,12 +29,6 @@ namespace BlackCore::Context
|
||||
return s;
|
||||
}
|
||||
|
||||
const PhysicalQuantities::CTime &IContextSimulator::HighlightTime()
|
||||
{
|
||||
static const CTime t(10.0, CTimeUnit::s());
|
||||
return t;
|
||||
}
|
||||
|
||||
IContextSimulator *IContextSimulator::create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &connection)
|
||||
{
|
||||
switch (mode)
|
||||
|
||||
@@ -68,9 +68,6 @@ namespace BlackCore::Context
|
||||
//! Service path
|
||||
static const QString &ObjectPath();
|
||||
|
||||
//! Highlight time
|
||||
static const BlackMisc::PhysicalQuantities::CTime &HighlightTime();
|
||||
|
||||
//! \copydoc IContext::getPathAndContextId()
|
||||
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
||||
|
||||
|
||||
@@ -23,15 +23,11 @@
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/registermetadata.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
#include "blackmisc/verify.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <QByteArray>
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusError>
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
#include <QStringBuilder>
|
||||
@@ -173,12 +169,6 @@ namespace BlackCore
|
||||
m_initalized = true;
|
||||
}
|
||||
|
||||
bool CCoreFacade::hasRemoteApplicationContext() const
|
||||
{
|
||||
Q_ASSERT(m_contextApplication);
|
||||
return !m_contextApplication->isUsingImplementingObject();
|
||||
}
|
||||
|
||||
void CCoreFacade::registerMetadata()
|
||||
{
|
||||
BlackMisc::registerMetadata();
|
||||
@@ -494,11 +484,6 @@ namespace BlackCore
|
||||
return static_cast<CContextAudio *>(m_contextAudio);
|
||||
}
|
||||
|
||||
bool CCoreFacade::hasLocalAudio() const
|
||||
{
|
||||
return m_contextAudio && m_contextAudio->isUsingImplementingObject();
|
||||
}
|
||||
|
||||
const CContextAudio *CCoreFacade::getCContextAudio() const
|
||||
{
|
||||
Q_ASSERT_X(m_contextAudio && m_contextAudio->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object");
|
||||
|
||||
@@ -68,15 +68,9 @@ namespace BlackCore
|
||||
//! Transport mechanism for sharing state between applications
|
||||
BlackMisc::SharedState::CDataLinkDBus *getDataLinkDBus() { return this->m_dataLinkDBus; }
|
||||
|
||||
//! DBus server (if applicable)
|
||||
const BlackMisc::CDBusServer *getDBusServer() const { return this->m_dbusServer; }
|
||||
|
||||
//! In case connection between DBus parties is lost, try to reconnect
|
||||
BlackMisc::CStatusMessage tryToReconnectWithDBus();
|
||||
|
||||
//! DBus connection (if applicable)
|
||||
const QDBusConnection &getDBusConnection() const { return this->m_dbusConnection; }
|
||||
|
||||
//! Clean up (will be connected to signal QCoreApplication::aboutToQuit)
|
||||
void gracefulShutdown();
|
||||
|
||||
@@ -138,9 +132,6 @@ namespace BlackCore
|
||||
//! \remarks only applicable for local object
|
||||
Context::CContextAudio *getCContextAudio();
|
||||
|
||||
//! Local audio context, means audio really runs here
|
||||
bool hasLocalAudio() const;
|
||||
|
||||
//! Context for audio
|
||||
//! \remarks only applicable for local object
|
||||
const Context::CContextAudio *getCContextAudio() const;
|
||||
@@ -172,9 +163,6 @@ namespace BlackCore
|
||||
//! DBus address if any
|
||||
QString getDBusAddress() const;
|
||||
|
||||
//! Remote application context, indicates distributed environment
|
||||
bool hasRemoteApplicationContext() const;
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
|
||||
@@ -30,19 +30,18 @@ namespace BlackCore
|
||||
ContextMode m_audio;
|
||||
ContextMode m_network;
|
||||
ContextMode m_ownAircraft;
|
||||
ContextMode m_settings;
|
||||
ContextMode m_simulator;
|
||||
QString m_dbusAddress; //!< for boot strapping
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
CCoreFacadeConfig(ContextMode allTheSame = NotUsed, const QString &dbusBootstrapAddress = "") : m_application(allTheSame), m_audio(allTheSame), m_network(allTheSame), m_ownAircraft(allTheSame), m_settings(allTheSame), m_simulator(allTheSame),
|
||||
CCoreFacadeConfig(ContextMode allTheSame = NotUsed, const QString &dbusBootstrapAddress = "") : m_application(allTheSame), m_audio(allTheSame), m_network(allTheSame), m_ownAircraft(allTheSame), m_simulator(allTheSame),
|
||||
m_dbusAddress(dbusBootstrapAddress)
|
||||
{}
|
||||
|
||||
//! Constructor
|
||||
CCoreFacadeConfig(ContextMode application, ContextMode audio, ContextMode network, ContextMode ownAircraft, ContextMode settings, ContextMode simulator, const QString &dbusBootstrapAddress = "") : m_application(application), m_audio(audio), m_network(network), m_ownAircraft(ownAircraft), m_settings(settings), m_simulator(simulator),
|
||||
m_dbusAddress(dbusBootstrapAddress)
|
||||
CCoreFacadeConfig(ContextMode application, ContextMode audio, ContextMode network, ContextMode ownAircraft, ContextMode simulator, const QString &dbusBootstrapAddress = "") : m_application(application), m_audio(audio), m_network(network), m_ownAircraft(ownAircraft), m_simulator(simulator),
|
||||
m_dbusAddress(dbusBootstrapAddress)
|
||||
{}
|
||||
|
||||
//! Application mode
|
||||
@@ -57,15 +56,9 @@ namespace BlackCore
|
||||
//! Own aircraft
|
||||
ContextMode getModeOwnAircraft() const { return m_ownAircraft; }
|
||||
|
||||
//! Settings mode
|
||||
ContextMode getModeSettings() const { return m_settings; }
|
||||
|
||||
//! Simulator mode
|
||||
ContextMode getModeSimulator() const { return m_simulator; }
|
||||
|
||||
//! Local settings?
|
||||
bool hasLocalSettings() const { return m_settings == Local || m_settings == LocalInDBusServer; }
|
||||
|
||||
//! Local core?
|
||||
bool hasLocalCore() const { return m_application == Local || m_application == LocalInDBusServer; }
|
||||
|
||||
|
||||
@@ -490,21 +490,6 @@ namespace BlackMisc::Aviation
|
||||
return CFlightPlan::fromJson(data);
|
||||
}
|
||||
|
||||
CFlightPlan CFlightPlan::fromMultipleFormatsNoThrow(const QString &data, const QString &fileSuffix)
|
||||
{
|
||||
CFlightPlan fp;
|
||||
try
|
||||
{
|
||||
fp = CFlightPlan::fromMultipleFormats(data, fileSuffix);
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage::fromJsonException(ex, &fp, QString("Parsing flight plan from failed."));
|
||||
Q_UNUSED(m)
|
||||
}
|
||||
return fp;
|
||||
}
|
||||
|
||||
CFlightPlan CFlightPlan::loadFromMultipleFormats(const QString &fileName, CStatusMessageList *msgs)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -381,9 +381,6 @@ namespace BlackMisc::Aviation
|
||||
//! From multiple formats
|
||||
static CFlightPlan fromMultipleFormats(const QString &data, const QString &fileSuffix);
|
||||
|
||||
//! From multiple formats
|
||||
static CFlightPlan fromMultipleFormatsNoThrow(const QString &data, const QString &fileSuffix);
|
||||
|
||||
//! Load from multiple formats
|
||||
static CFlightPlan loadFromMultipleFormats(const QString &fileName, CStatusMessageList *msgs = nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user