From 4fda69d78e4a2e3861acbc26d19b59a1bb387a1a Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Thu, 18 Feb 2021 00:14:22 +0000 Subject: [PATCH] Issue #93 Reduce update offset for 5 Hz updates and rename member --- src/blackcore/fsd/fsdclient.cpp | 4 ++-- src/blackmisc/network/fsdsetup.h | 2 +- src/blackmisc/simulation/interpolatorspline.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/blackcore/fsd/fsdclient.cpp b/src/blackcore/fsd/fsdclient.cpp index e5a4c7ebbd..6626094fe6 100644 --- a/src/blackcore/fsd/fsdclient.cpp +++ b/src/blackcore/fsd/fsdclient.cpp @@ -1665,13 +1665,13 @@ namespace BlackCore this->insertLatestOffsetTime(callsign, diff); int count = 0; - static const qint64 minOffsetTime = CFsdSetup::c_interimPositionTimeOffsetMsec; // no longer needed with C++17 + static const qint64 minOffsetTime = CFsdSetup::c_minimumPositionTimeOffsetMsec; // no longer needed with C++17 const qint64 avgTimeMs = this->averageOffsetTimeMs(callsign, count, 3); // latest average qint64 offsetTime = CFsdSetup::c_positionTimeOffsetMsec; if (avgTimeMs < minOffsetTime && count >= 3) { - offsetTime = CFsdSetup::c_interimPositionTimeOffsetMsec; + offsetTime = CFsdSetup::c_minimumPositionTimeOffsetMsec; } return m_additionalOffsetTime + offsetTime; diff --git a/src/blackmisc/network/fsdsetup.h b/src/blackmisc/network/fsdsetup.h index 3502002f44..2a7ee20c87 100644 --- a/src/blackmisc/network/fsdsetup.h +++ b/src/blackmisc/network/fsdsetup.h @@ -62,7 +62,7 @@ namespace BlackMisc //! \remark related to CNetworkVatlib::c_updatePostionIntervalMsec / c_updateInterimPostionIntervalMsec //! @{ static constexpr qint64 c_positionTimeOffsetMsec = 6000; //!< offset time for received position updates Ref T297 - static constexpr qint64 c_interimPositionTimeOffsetMsec = 1500; //!< offset time for received interim position updates Ref T297 + static constexpr qint64 c_minimumPositionTimeOffsetMsec = 700; //!< offset time for vatsim high frequency position updates //! @} //! Default constructor. diff --git a/src/blackmisc/simulation/interpolatorspline.cpp b/src/blackmisc/simulation/interpolatorspline.cpp index 4ab7517a5f..7e363e537f 100644 --- a/src/blackmisc/simulation/interpolatorspline.cpp +++ b/src/blackmisc/simulation/interpolatorspline.cpp @@ -134,7 +134,7 @@ namespace BlackMisc } // set some default values - const qint64 defaultValueMs = CFsdSetup::c_interimPositionTimeOffsetMsec; // CLANG cannot use reference in qMax + const qint64 defaultValueMs = CFsdSetup::c_minimumPositionTimeOffsetMsec; // CLANG cannot use reference in qMax const qint64 os = qMax(defaultValueMs, m_s[2].getTimeOffsetMs()); m_s[0].addMsecs(-os); // oldest, Ref T297 default offset time to fill data m_s[2].addMsecs(os); // latest, Ref T297 default offset time to fill data