mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Ref T739, renamed CContext -> IContext
This reflects the purpose better, it is a base class for all context interfaces
This commit is contained in:
committed by
Mat Sutcliffe
parent
4c170e0ac4
commit
09e65a2525
@@ -15,83 +15,83 @@ namespace BlackCore
|
||||
{
|
||||
namespace Context
|
||||
{
|
||||
const CLogCategoryList &CContext::getLogCategories()
|
||||
const CLogCategoryList &IContext::getLogCategories()
|
||||
{
|
||||
static const BlackMisc::CLogCategoryList cats { BlackMisc::CLogCategory::context() };
|
||||
return cats;
|
||||
}
|
||||
|
||||
IContextNetwork *CContext::getIContextNetwork()
|
||||
IContextNetwork *IContext::getIContextNetwork()
|
||||
{
|
||||
return this->getRuntime()->getIContextNetwork();
|
||||
}
|
||||
|
||||
const IContextNetwork *CContext::getIContextNetwork() const
|
||||
const IContextNetwork *IContext::getIContextNetwork() const
|
||||
{
|
||||
return this->getRuntime()->getIContextNetwork();
|
||||
}
|
||||
|
||||
IContextAudio *CContext::getIContextAudio()
|
||||
IContextAudio *IContext::getIContextAudio()
|
||||
{
|
||||
return this->getRuntime()->getIContextAudio();
|
||||
}
|
||||
|
||||
const IContextAudio *CContext::getIContextAudio() const
|
||||
const IContextAudio *IContext::getIContextAudio() const
|
||||
{
|
||||
return this->getRuntime()->getIContextAudio();
|
||||
}
|
||||
|
||||
IContextApplication *CContext::getIContextApplication()
|
||||
IContextApplication *IContext::getIContextApplication()
|
||||
{
|
||||
return this->getRuntime()->getIContextApplication();
|
||||
}
|
||||
|
||||
const IContextApplication *CContext::getIContextApplication() const
|
||||
const IContextApplication *IContext::getIContextApplication() const
|
||||
{
|
||||
return this->getRuntime()->getIContextApplication();
|
||||
}
|
||||
|
||||
IContextOwnAircraft *CContext::getIContextOwnAircraft()
|
||||
IContextOwnAircraft *IContext::getIContextOwnAircraft()
|
||||
{
|
||||
return this->getRuntime()->getIContextOwnAircraft();
|
||||
}
|
||||
|
||||
const IContextOwnAircraft *CContext::getIContextOwnAircraft() const
|
||||
const IContextOwnAircraft *IContext::getIContextOwnAircraft() const
|
||||
{
|
||||
return this->getRuntime()->getIContextOwnAircraft();
|
||||
}
|
||||
|
||||
IContextSimulator *CContext::getIContextSimulator()
|
||||
IContextSimulator *IContext::getIContextSimulator()
|
||||
{
|
||||
return this->getRuntime()->getIContextSimulator();
|
||||
}
|
||||
|
||||
void CContext::setDebugEnabled(bool debug)
|
||||
void IContext::setDebugEnabled(bool debug)
|
||||
{
|
||||
if (this->m_debugEnabled == debug) { return; }
|
||||
emit this->changedLogOrDebugSettings();
|
||||
}
|
||||
|
||||
bool CContext::isDebugEnabled() const
|
||||
bool IContext::isDebugEnabled() const
|
||||
{
|
||||
return this->m_debugEnabled;
|
||||
}
|
||||
|
||||
void CContext::relayBaseClassSignals(const QString &serviceName, QDBusConnection &connection, const QString &objectPath, const QString &interfaceName)
|
||||
void IContext::relayBaseClassSignals(const QString &serviceName, QDBusConnection &connection, const QString &objectPath, const QString &interfaceName)
|
||||
{
|
||||
bool s = connection.connect(serviceName, objectPath, interfaceName,
|
||||
"changedLogOrDebugSettings", this, SIGNAL(changedLogOrDebugSettings()));
|
||||
Q_ASSERT(s);
|
||||
}
|
||||
|
||||
const IContextSimulator *CContext::getIContextSimulator() const
|
||||
const IContextSimulator *IContext::getIContextSimulator() const
|
||||
{
|
||||
return this->getRuntime()->getIContextSimulator();
|
||||
}
|
||||
|
||||
const CStatusMessage &CContext::statusMessageEmptyContext()
|
||||
const CStatusMessage &IContext::statusMessageEmptyContext()
|
||||
{
|
||||
static const CStatusMessage m(static_cast<CContext *>(nullptr), CStatusMessage::SeverityWarning, u"empty context");
|
||||
static const CStatusMessage m(static_cast<IContext *>(nullptr), CStatusMessage::SeverityWarning, u"empty context");
|
||||
return m;
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#ifndef BLACKCORE_CONTEXT_CONTEXT_H
|
||||
#define BLACKCORE_CONTEXT_CONTEXT_H
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/corefacade.h"
|
||||
#include "blackcore/corefacadeconfig.h"
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackmisc/logcategory.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
@@ -36,13 +36,13 @@ namespace BlackCore
|
||||
class IContextSimulator;
|
||||
|
||||
//! Base for all context classes
|
||||
class BLACKCORE_EXPORT CContext : public QObject
|
||||
class BLACKCORE_EXPORT IContext : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Destructor
|
||||
virtual ~CContext() {}
|
||||
virtual ~IContext() {}
|
||||
|
||||
//! Log categories
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
@@ -145,7 +145,7 @@ namespace BlackCore
|
||||
bool m_debugEnabled = false; //!< debug messages enabled
|
||||
|
||||
//! Constructor
|
||||
CContext(CCoreFacadeConfig::ContextMode mode, QObject *parent) :
|
||||
IContext(CCoreFacadeConfig::ContextMode mode, QObject *parent) :
|
||||
QObject(parent), m_mode(mode), m_contextId(QDateTime::currentMSecsSinceEpoch())
|
||||
{}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
IContextApplication::IContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) :
|
||||
CContext(mode, runtime)
|
||||
IContext(mode, runtime)
|
||||
{
|
||||
if (mode == CCoreFacadeConfig::NotUsed) { return; }
|
||||
QPointer<IContextApplication> myself(this);
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace BlackCore
|
||||
using CSettingsDictionary = BlackMisc::CDictionary<QString, QString, QMap>;
|
||||
|
||||
//! Application context interface
|
||||
class BLACKCORE_EXPORT IContextApplication : public CContext
|
||||
class BLACKCORE_EXPORT IContextApplication : public IContext
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAPPLICATION_INTERFACENAME)
|
||||
|
||||
@@ -58,14 +58,14 @@ namespace BlackCore
|
||||
namespace Context
|
||||
{
|
||||
//! Audio context interface
|
||||
class BLACKCORE_EXPORT IContextAudio : public CContext
|
||||
class BLACKCORE_EXPORT IContextAudio : public IContext
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAUDIO_INTERFACENAME)
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
IContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContext(mode, runtime) {}
|
||||
IContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContext(mode, runtime) {}
|
||||
|
||||
public:
|
||||
//! Interface name
|
||||
|
||||
@@ -12,11 +12,13 @@
|
||||
#define BLACKCORE_CONTEXT_CONTEXTAUDIO_IMPL_H
|
||||
|
||||
#include "blackcore/context/contextaudio.h"
|
||||
#include "blackcore/afv/clients/afvclient.h"
|
||||
#include "blackcore/audio/audiosettings.h"
|
||||
#include "blackcore/actionbind.h"
|
||||
#include "blackcore/corefacadeconfig.h"
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/afv/clients/afvclient.h"
|
||||
#include "blacksound/selcalplayer.h"
|
||||
#include "blacksound/notificationplayer.h"
|
||||
#include "blackmisc/audio/audiosettings.h"
|
||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||
#include "blackmisc/audio/notificationsounds.h"
|
||||
@@ -33,8 +35,6 @@
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/icons.h"
|
||||
#include "blackmisc/network/connectionstatus.h"
|
||||
#include "blacksound/selcalplayer.h"
|
||||
#include "blacksound/notificationplayer.h"
|
||||
|
||||
#include <QHash>
|
||||
#include <QList>
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace BlackCore
|
||||
namespace Context
|
||||
{
|
||||
//! Network context proxy
|
||||
class BLACKCORE_EXPORT IContextNetwork : public CContext
|
||||
class BLACKCORE_EXPORT IContextNetwork : public IContext
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTNETWORK_INTERFACENAME)
|
||||
@@ -374,7 +374,7 @@ namespace BlackCore
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
IContextNetwork(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContext(mode, runtime) {}
|
||||
IContextNetwork(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContext(mode, runtime) {}
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -796,7 +796,7 @@ namespace BlackCore
|
||||
const ReverseLookupLogging revEnabled = m_airspace->isReverseLookupMessagesEnabled();
|
||||
if (revEnabled == enable) { return; }
|
||||
m_airspace->enableReverseLookupMessages(enable);
|
||||
emit CContext::changedLogOrDebugSettings();
|
||||
emit IContext::changedLogOrDebugSettings();
|
||||
}
|
||||
|
||||
CStatusMessageList CContextNetwork::getAircraftPartsHistory(const CCallsign &callsign) const
|
||||
@@ -827,7 +827,7 @@ namespace BlackCore
|
||||
{
|
||||
if (this->isDebugEnabled()) { CLogMessage(this, CLogCategory::contextSlot()).debug() << enabled; }
|
||||
m_airspace->enableAircraftPartsHistory(enabled);
|
||||
emit CContext::changedLogOrDebugSettings();
|
||||
emit IContext::changedLogOrDebugSettings();
|
||||
}
|
||||
|
||||
int CContextNetwork::aircraftSituationsAdded() const
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace BlackCore
|
||||
{
|
||||
//! Own context proxy
|
||||
//! \ingroup dbus
|
||||
class BLACKCORE_EXPORT IContextOwnAircraft : public CContext
|
||||
class BLACKCORE_EXPORT IContextOwnAircraft : public IContext
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTOWNAIRCRAFT_INTERFACENAME)
|
||||
@@ -177,7 +177,7 @@ namespace BlackCore
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
IContextOwnAircraft(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContext(mode, runtime) {}
|
||||
IContextOwnAircraft(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContext(mode, runtime) {}
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace BlackCore
|
||||
namespace Context
|
||||
{
|
||||
//! Network context
|
||||
class BLACKCORE_EXPORT IContextSimulator : public CContext
|
||||
class BLACKCORE_EXPORT IContextSimulator : public IContext
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTSIMULATOR_INTERFACENAME)
|
||||
@@ -334,7 +334,7 @@ namespace BlackCore
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
IContextSimulator(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContext(mode, runtime) {}
|
||||
IContextSimulator(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContext(mode, runtime) {}
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -948,7 +948,7 @@ namespace BlackCore
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << matchingLogToString(enabled); }
|
||||
if (m_logMatchingMessages == enabled) { return; }
|
||||
m_logMatchingMessages = enabled;
|
||||
emit CContext::changedLogOrDebugSettings();
|
||||
emit IContext::changedLogOrDebugSettings();
|
||||
}
|
||||
|
||||
CMatchingStatistics CContextSimulator::getCurrentMatchingStatistics(bool missingOnly) const
|
||||
|
||||
Reference in New Issue
Block a user