Ref T229, adjusted CInterpolationStatus

* The `changed`flag in interpolation was faulty.
* It was able to determine if the value was really changed by interpolation, which was the same as indicating that the value was interpolated.
* But there were cases, when the value was interpolated and not changed.
* Also there were cases when the value was changed, but not interpolated.
This commit is contained in:
Klaus Basan
2018-01-19 03:03:23 +01:00
parent 67426b755f
commit 75c2eec3d1
2 changed files with 21 additions and 38 deletions

View File

@@ -147,31 +147,22 @@ namespace BlackMisc
{
public:
//! Did interpolation succeed?
bool didInterpolationSucceed() const { return m_interpolationSucceeded; }
bool isInterpolated() const { return m_isInterpolated; }
//! Set succeeded
void setInterpolationSucceeded(bool succeeded) { m_interpolationSucceeded = succeeded; }
void setInterpolated(bool interpolated) { m_isInterpolated = interpolated; }
//! Set succeeded
void setInterpolationSucceeded(bool succeeded, const Aviation::CAircraftSituation &situation);
//! Changed position?
bool hasChangedPosition() const { return m_changedPosition; }
void setInterpolatedAndCheckSituation(bool succeeded, const Aviation::CAircraftSituation &situation);
//! Is the corresponding position valid?
bool hasValidSituation() const { return m_validSituation; }
//! Is that a valid position?
void setValidSituation(const Aviation::CAircraftSituation &situation);
//! Set as changed
void setChangedPosition(bool changed) { m_changedPosition = changed; }
//! Valid interpolated situation which also changed
bool validAndChangedInterpolatedSituation() const;
bool hasValidSituation() const { return m_isValidSituation; }
//! Valid interpolated situation
bool validInterpolatedSituation() const;
bool hasValidInterpolatedSituation() const;
//! Is that a valid position?
void checkIfValidSituation(const Aviation::CAircraftSituation &situation);
//! Reset to default values
void reset();
@@ -180,9 +171,8 @@ namespace BlackMisc
QString toQString() const;
private:
bool m_changedPosition = false; //!< position was changed
bool m_interpolationSucceeded = false; //!< interpolation succeeded (means enough values, etc.)
bool m_validSituation = false; //!< is valid situation
bool m_isInterpolated = false; //!< position is interpolated (means enough values, etc.)
bool m_isValidSituation = false; //!< is valid situation
};
//! Status regarding parts