Ref T270, improved setup/logger handling

* utility functions to enable logging
* logger access and access to log messages
This commit is contained in:
Klaus Basan
2018-05-18 00:06:42 +02:00
parent e3465f432c
commit a3a62919fc
6 changed files with 59 additions and 16 deletions

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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)
{
{

View File

@@ -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