Minor interpolator improvements, display 2nd invalid version instead of first

This commit is contained in:
Klaus Basan
2019-05-09 01:05:05 +02:00
parent 15d88b37e5
commit da2b3e05fd
3 changed files with 7 additions and 12 deletions

View File

@@ -11,10 +11,9 @@
#ifndef BLACKGUI_COMPONENTS_INTERPOLATIONCOMPONENT_H #ifndef BLACKGUI_COMPONENTS_INTERPOLATIONCOMPONENT_H
#define BLACKGUI_COMPONENTS_INTERPOLATIONCOMPONENT_H #define BLACKGUI_COMPONENTS_INTERPOLATIONCOMPONENT_H
#include "blackmisc/aviation/callsign.h" #include "blackgui/blackguiexport.h"
#include <QFrame> #include <QFrame>
#include <QScopedPointer> #include <QScopedPointer>
#include "blackgui/blackguiexport.h"
namespace Ui { class CInterpolationComponent; } namespace Ui { class CInterpolationComponent; }
namespace BlackGui namespace BlackGui
@@ -31,7 +30,7 @@ namespace BlackGui
explicit CInterpolationComponent(QWidget *parent = nullptr); explicit CInterpolationComponent(QWidget *parent = nullptr);
//! Destructor //! Destructor
virtual ~CInterpolationComponent(); virtual ~CInterpolationComponent() override;
signals: signals:
//! Request redering restrictions widget //! Request redering restrictions widget

View File

@@ -275,9 +275,11 @@ namespace BlackMisc
} }
if (!m.isEmpty()) 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); CLogMessage::preformatted(m);
} }
m_interpolationMessages.push_back(m); m_interpolationMessages.push_back(m);

View File

@@ -1914,6 +1914,7 @@ namespace BlackSimPlugin
const bool sendGround = setup.isSendingGndFlagToSimulator(); const bool sendGround = setup.isSendingGndFlagToSimulator();
// Interpolated situation // Interpolated situation
// simObjectNumber is passed to equally distributed steps like guessing parts
const CInterpolationResult result = simObject.getInterpolation(currentTimestamp, setup, simObjectNumber++); const CInterpolationResult result = simObject.getInterpolation(currentTimestamp, setup, simObjectNumber++);
if (result.getInterpolationStatus().hasValidSituation()) if (result.getInterpolationStatus().hasValidSituation())
{ {
@@ -1936,13 +1937,6 @@ namespace BlackSimPlugin
{ {
// already logged in interpolator // already logged in interpolator
continue; 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 // Interpolated parts