mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
Ref T297, style and remarks for T297
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user