mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Ref T270, improved setup/logger handling
* utility functions to enable logging * logger access and access to log messages
This commit is contained in:
@@ -64,6 +64,13 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
bool CInterpolationAndRenderingSetupBase::setLogInterpolation(bool log)
|
||||
{
|
||||
if (m_logInterpolation == log) { return false; }
|
||||
m_logInterpolation = log;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CInterpolationAndRenderingSetupBase::setEnabledAircraftParts(bool enabled)
|
||||
{
|
||||
if (m_enabledAircraftParts == enabled) { return false; }
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace BlackMisc
|
||||
bool logInterpolation() const { return m_logInterpolation; }
|
||||
|
||||
//! Log.interpolation
|
||||
void setLogInterpolation(bool log) { m_logInterpolation = log; }
|
||||
bool setLogInterpolation(bool log);
|
||||
|
||||
//! Full interpolation (skip optimizations like checking if aircraft moves etc.)
|
||||
bool isForcingVtolInterpolation() const { return m_forceVtolInterpolation; }
|
||||
|
||||
@@ -57,6 +57,24 @@ namespace BlackMisc
|
||||
return callsigns;
|
||||
}
|
||||
|
||||
bool IInterpolationSetupProvider::setInterpolationMode(const QString &modeAsString, const CCallsign &callsign)
|
||||
{
|
||||
CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign);
|
||||
if (!setup.setInterpolatorMode(modeAsString)) { return false; }
|
||||
|
||||
// changed value
|
||||
return this->setInterpolationSetupPerCallsign(setup, callsign, true);
|
||||
}
|
||||
|
||||
bool IInterpolationSetupProvider::setLogInterpolation(bool log, const CCallsign &callsign)
|
||||
{
|
||||
CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign);
|
||||
if (!setup.setLogInterpolation(log)) { return false; }
|
||||
|
||||
// changed value
|
||||
return this->setInterpolationSetupPerCallsign(setup, callsign, true);
|
||||
}
|
||||
|
||||
bool IInterpolationSetupProvider::setInterpolationSetupGlobal(const CInterpolationAndRenderingSetupGlobal &setup)
|
||||
{
|
||||
{
|
||||
|
||||
@@ -50,6 +50,14 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
Aviation::CCallsignSet getLogCallsigns() const;
|
||||
|
||||
//! Set mode as string
|
||||
//! \threadsafe
|
||||
bool setInterpolationMode(const QString &modeAsString, const Aviation::CCallsign &callsign);
|
||||
|
||||
//! Enable/disable logging
|
||||
//! \threadsafe
|
||||
bool setLogInterpolation(bool log, const Aviation::CCallsign &callsign);
|
||||
|
||||
protected:
|
||||
//! Set the global setup
|
||||
//! \threadsafe
|
||||
|
||||
Reference in New Issue
Block a user