From da2b3e05fd5822ed071108e1aecdeff5833edf83 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 9 May 2019 01:05:05 +0200 Subject: [PATCH] Minor interpolator improvements, display 2nd invalid version instead of first --- src/blackgui/components/interpolationcomponent.h | 5 ++--- src/blackmisc/simulation/interpolator.cpp | 6 ++++-- src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp | 8 +------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/blackgui/components/interpolationcomponent.h b/src/blackgui/components/interpolationcomponent.h index 2be84c070..65186b637 100644 --- a/src/blackgui/components/interpolationcomponent.h +++ b/src/blackgui/components/interpolationcomponent.h @@ -11,10 +11,9 @@ #ifndef BLACKGUI_COMPONENTS_INTERPOLATIONCOMPONENT_H #define BLACKGUI_COMPONENTS_INTERPOLATIONCOMPONENT_H -#include "blackmisc/aviation/callsign.h" +#include "blackgui/blackguiexport.h" #include #include -#include "blackgui/blackguiexport.h" namespace Ui { class CInterpolationComponent; } namespace BlackGui @@ -31,7 +30,7 @@ namespace BlackGui explicit CInterpolationComponent(QWidget *parent = nullptr); //! Destructor - virtual ~CInterpolationComponent(); + virtual ~CInterpolationComponent() override; signals: //! Request redering restrictions widget diff --git a/src/blackmisc/simulation/interpolator.cpp b/src/blackmisc/simulation/interpolator.cpp index 2f5f9b597..9da4500de 100644 --- a/src/blackmisc/simulation/interpolator.cpp +++ b/src/blackmisc/simulation/interpolator.cpp @@ -275,9 +275,11 @@ namespace BlackMisc } if (!m.isEmpty()) { - if (m_interpolationMessages.isEmpty()) + if (m_interpolationMessages.sizeInt() == 2) { - // display first message as a hint in the general log + // display second message as a hint in the general log + // we DO NOT display the first message, as this can happen due to pilot logging off + // if it happens twice we consider it worth displaying CLogMessage::preformatted(m); } m_interpolationMessages.push_back(m); diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index 58110c755..e77175079 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -1914,6 +1914,7 @@ namespace BlackSimPlugin const bool sendGround = setup.isSendingGndFlagToSimulator(); // Interpolated situation + // simObjectNumber is passed to equally distributed steps like guessing parts const CInterpolationResult result = simObject.getInterpolation(currentTimestamp, setup, simObjectNumber++); if (result.getInterpolationStatus().hasValidSituation()) { @@ -1936,13 +1937,6 @@ namespace BlackSimPlugin { // already logged in interpolator continue; - - /** KB removed 2018-11 as already logged in interpolator - static const QString so("SimObject id: %1"); - const QString msg = this->getInvalidSituationLogMessage(callsign, result.getInterpolationStatus(), so.arg(objectId)); - const CStatusMessage sm(this, CStatusMessage::SeverityWarning, msg); - this->clampedLog(callsign, sm); - **/ } // Interpolated parts