mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Ref T297, style and remarks for T297
This commit is contained in:
@@ -1061,7 +1061,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
else
|
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 CAircraftSituationList oldSituations = this->remoteAircraftSituations(callsign);
|
||||||
const CAircraftSituationChangeList oldChanges = this->remoteAircraftSituationChanges(callsign);
|
const CAircraftSituationChangeList oldChanges = this->remoteAircraftSituationChanges(callsign);
|
||||||
if (oldSituations.size() > 1)
|
if (oldSituations.size() > 1)
|
||||||
|
|||||||
@@ -56,9 +56,10 @@ namespace BlackMisc
|
|||||||
Q_DECLARE_FLAGS(SendReceiveDetails, SendReceiveDetailsFlag)
|
Q_DECLARE_FLAGS(SendReceiveDetails, SendReceiveDetailsFlag)
|
||||||
|
|
||||||
//! Offset times basically telling when to expect the next value from network plus some reserve
|
//! 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_positionTimeOffsetMsec = 6000; //!< offset time for received position updates Ref T297
|
||||||
static qint64 constexpr c_interimPositionTimeOffsetMsec = 2000; //!< offset time for received interim position updates
|
static qint64 constexpr c_interimPositionTimeOffsetMsec = 2000; //!< offset time for received interim position updates Ref T297
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
//! Default constructor.
|
//! Default constructor.
|
||||||
@@ -105,7 +106,7 @@ namespace BlackMisc
|
|||||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
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;
|
int comparePropertyByIndex(const CPropertyIndex &index, const CFsdSetup &compareValue) const;
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::String::toQString()
|
//! \copydoc BlackMisc::Mixin::String::toQString()
|
||||||
|
|||||||
@@ -184,9 +184,10 @@ namespace BlackMisc
|
|||||||
const double distanceToSplitTimeMs = newSituation.getAdjustedMSecsSinceEpoch() - m_currentTimeMsSinceEpoch;
|
const double distanceToSplitTimeMs = newSituation.getAdjustedMSecsSinceEpoch() - m_currentTimeMsSinceEpoch;
|
||||||
const double simulationTimeFraction = qMax(1.0 - (distanceToSplitTimeMs / sampleDeltaTimeMs), 0.0);
|
const double simulationTimeFraction = qMax(1.0 - (distanceToSplitTimeMs / sampleDeltaTimeMs), 0.0);
|
||||||
const double deltaTimeFractionMs = sampleDeltaTimeMs * simulationTimeFraction;
|
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);
|
currentSituation.setMSecsSinceEpoch(interpolatedTime);
|
||||||
m_currentInterpolationStatus.setInterpolatedAndCheckSituation(true, currentSituation);
|
m_currentInterpolationStatus.setInterpolatedAndCheckSituation(true, currentSituation);
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace BlackMisc
|
|||||||
static constexpr int MaxSituationsPerCallsign = 6; //!< How many situations we keep per callsign
|
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 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 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
|
//! Destructor
|
||||||
virtual ~IRemoteAircraftProvider();
|
virtual ~IRemoteAircraftProvider();
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ namespace BlackMisc
|
|||||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
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;
|
int comparePropertyByIndex(const CPropertyIndex &index, const ITimestampWithOffsetBased &compareValue) const;
|
||||||
|
|
||||||
qint64 m_timeOffsetMs = 0; //!< offset time in ms
|
qint64 m_timeOffsetMs = 0; //!< offset time in ms
|
||||||
|
|||||||
Reference in New Issue
Block a user