Skip to content

Commit

Permalink
Issue #93 Reduce update offset for 5 Hz updates and rename member
Browse files Browse the repository at this point in the history
  • Loading branch information
oktal3700 committed Dec 22, 2021
1 parent 5f90ec5 commit b8cdc28
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/blackcore/fsd/fsdclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1706,9 +1706,9 @@ namespace BlackCore::Fsd
const qint64 avgTimeMs = this->averageOffsetTimeMs(callsign, count, 3); // latest average
qint64 offsetTime = CFsdSetup::c_positionTimeOffsetMsec;

if (avgTimeMs < CFsdSetup::c_interimPositionTimeOffsetMsec && count >= 3)
if (avgTimeMs < CFsdSetup::c_minimumPositionTimeOffsetMsec && count >= 3)
{
offsetTime = CFsdSetup::c_interimPositionTimeOffsetMsec;
offsetTime = CFsdSetup::c_minimumPositionTimeOffsetMsec;
}

return m_additionalOffsetTime + offsetTime;
Expand Down
2 changes: 1 addition & 1 deletion src/blackmisc/network/fsdsetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace BlackMisc::Network
//! \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.
Expand Down
2 changes: 1 addition & 1 deletion src/blackmisc/simulation/interpolatorspline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ namespace BlackMisc::Simulation
}

// set some default values
const qint64 os = qMax(CFsdSetup::c_interimPositionTimeOffsetMsec, m_s[2].getTimeOffsetMs());
const qint64 os = qMax(CFsdSetup::c_minimumPositionTimeOffsetMsec, 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
if (m_currentSituations.isEmpty()) { return false; }
Expand Down

0 comments on commit b8cdc28

Please sign in to comment.