From c6c22a6e5ccc77f0568d3ba750b27786406acefa Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 18 Jul 2018 01:46:58 +0200 Subject: [PATCH] Ref T268, utilty functions for logging setup --- .../simulation/interpolationsetupprovider.cpp | 13 +++++++++++++ .../simulation/interpolationsetupprovider.h | 12 ++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/blackmisc/simulation/interpolationsetupprovider.cpp b/src/blackmisc/simulation/interpolationsetupprovider.cpp index 017f8e6d3..95e508219 100644 --- a/src/blackmisc/simulation/interpolationsetupprovider.cpp +++ b/src/blackmisc/simulation/interpolationsetupprovider.cpp @@ -28,6 +28,12 @@ namespace BlackMisc return CInterpolationSetupList(setups.values()); } + bool IInterpolationSetupProvider::hasSetupsPerCallsign() const + { + QReadLocker l(&m_lockSetup); + return !m_setups.isEmpty(); + } + bool IInterpolationSetupProvider::setInterpolationSetupsPerCallsign(const CInterpolationSetupList &setups, bool ignoreSameAsGlobal) { const CInterpolationAndRenderingSetupGlobal gs = this->getInterpolationSetupGlobal(); @@ -63,6 +69,13 @@ namespace BlackMisc return callsigns; } + bool IInterpolationSetupProvider::isLogCallsign(const CCallsign &callsign) const + { + QReadLocker l(&m_lockSetup); + if (!m_setups.contains(callsign)) { return false; } + return m_setups[callsign].logInterpolation(); + } + bool IInterpolationSetupProvider::setInterpolationMode(const QString &modeAsString, const CCallsign &callsign) { CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign); diff --git a/src/blackmisc/simulation/interpolationsetupprovider.h b/src/blackmisc/simulation/interpolationsetupprovider.h index 542e6f6a3..6cccb35a9 100644 --- a/src/blackmisc/simulation/interpolationsetupprovider.h +++ b/src/blackmisc/simulation/interpolationsetupprovider.h @@ -36,11 +36,15 @@ namespace BlackMisc //! Get all setups per callsign //! \threadsafe - virtual CInterpolationSetupList getInterpolationSetupsPerCallsign() const; + CInterpolationSetupList getInterpolationSetupsPerCallsign() const; + + //! Get all setups per callsign + //! \threadsafe + bool hasSetupsPerCallsign() const; //! Set all setups per callsign //! \threadsafe - virtual bool setInterpolationSetupsPerCallsign(const CInterpolationSetupList &setups, bool ignoreSameAsGlobal = true); + bool setInterpolationSetupsPerCallsign(const CInterpolationSetupList &setups, bool ignoreSameAsGlobal = true); //! The global setup //! \threadsafe @@ -50,6 +54,10 @@ namespace BlackMisc //! \threadsafe Aviation::CCallsignSet getLogCallsigns() const; + //! Is callsign marked for logging + //! \threadsafe + bool isLogCallsign(const Aviation::CCallsign &callsign) const; + //! Set mode as string //! \threadsafe bool setInterpolationMode(const QString &modeAsString, const Aviation::CCallsign &callsign);