Ref T297, style and remarks for T297

This commit is contained in:
Klaus Basan
2018-10-11 03:19:21 +02:00
parent 5d4bab4be0
commit 00d859d5b3
5 changed files with 10 additions and 8 deletions

View File

@@ -1061,7 +1061,7 @@ namespace BlackCore
}
else
{
// values before updating (i.e. "storing") so the new situation is noty yet considered
// values before updating (i.e. "storing") so the new situation is not yet considered
const CAircraftSituationList oldSituations = this->remoteAircraftSituations(callsign);
const CAircraftSituationChangeList oldChanges = this->remoteAircraftSituationChanges(callsign);
if (oldSituations.size() > 1)

View File

@@ -56,9 +56,10 @@ namespace BlackMisc
Q_DECLARE_FLAGS(SendReceiveDetails, SendReceiveDetailsFlag)
//! Offset times basically telling when to expect the next value from network plus some reserve
//! \remark copies of CNetworkVatlib::c_updatePostionIntervalMsec / c_updateInterimPostionIntervalMsec
//! @{
static qint64 constexpr c_positionTimeOffsetMsec = 6000; //!< offset time for received position updates
static qint64 constexpr c_interimPositionTimeOffsetMsec = 2000; //!< offset time for received interim position updates
static qint64 constexpr c_positionTimeOffsetMsec = 6000; //!< offset time for received position updates Ref T297
static qint64 constexpr c_interimPositionTimeOffsetMsec = 2000; //!< offset time for received interim position updates Ref T297
//! @}
//! Default constructor.
@@ -105,7 +106,7 @@ namespace BlackMisc
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
//! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex
int comparePropertyByIndex(const CPropertyIndex &index, const CFsdSetup &compareValue) const;
//! \copydoc BlackMisc::Mixin::String::toQString()

View File

@@ -184,9 +184,10 @@ namespace BlackMisc
const double distanceToSplitTimeMs = newSituation.getAdjustedMSecsSinceEpoch() - m_currentTimeMsSinceEpoch;
const double simulationTimeFraction = qMax(1.0 - (distanceToSplitTimeMs / sampleDeltaTimeMs), 0.0);
const double deltaTimeFractionMs = sampleDeltaTimeMs * simulationTimeFraction;
const qint64 interpolatedTime = oldSituation.getMSecsSinceEpoch() + deltaTimeFractionMs;
const qint64 interpolatedTime = oldSituation.getMSecsSinceEpoch() + qRound(deltaTimeFractionMs);
currentSituation.setTimeOffsetMs(oldSituation.getTimeOffsetMs() + (newSituation.getTimeOffsetMs() - oldSituation.getTimeOffsetMs()) * simulationTimeFraction);
// Ref T297 adjust offset time, but this already the interpolated situation
currentSituation.setTimeOffsetMs(oldSituation.getTimeOffsetMs() + qRound((newSituation.getTimeOffsetMs() - oldSituation.getTimeOffsetMs()) * simulationTimeFraction));
currentSituation.setMSecsSinceEpoch(interpolatedTime);
m_currentInterpolationStatus.setInterpolatedAndCheckSituation(true, currentSituation);

View File

@@ -49,7 +49,7 @@ namespace BlackMisc
static constexpr int MaxSituationsPerCallsign = 6; //!< How many situations we keep per callsign
static constexpr int MaxPartsPerCallsign = 20; //!< How many parts we keep per callsign (we keep more parts than situations as parts can just come in)
static constexpr int MaxPartsAgePerCallsignSecs = 60; //!< How many seconds to keep parts for interpolation
static constexpr int DefaultOffsetTimeMs = 6000; //!< \fixme copied from CNetworkVatlib::c_positionTimeOffsetMsec
// static constexpr int DefaultOffsetTimeMs = 6000; //!< \fixme copied from CNetworkVatlib::c_positionTimeOffsetMsec
//! Destructor
virtual ~IRemoteAircraftProvider();

View File

@@ -231,7 +231,7 @@ namespace BlackMisc
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
//! Compare for index
//! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex
int comparePropertyByIndex(const CPropertyIndex &index, const ITimestampWithOffsetBased &compareValue) const;
qint64 m_timeOffsetMs = 0; //!< offset time in ms