Ref T270, also display update aircraft (interpolation) request time

* made some ISimulator functions public, so they can be used in UI
* added members for request times
* better "shutdown" / "disconnect" detection
This commit is contained in:
Klaus Basan
2018-05-30 22:15:21 +02:00
parent fe8eb89d8b
commit de0a827f87
6 changed files with 122 additions and 40 deletions

View File

@@ -587,6 +587,8 @@ namespace BlackCore
m_statsUpdateAircraftTimeTotalMs = 0;
m_statsPhysicallyAddedAircraft = 0;
m_statsPhysicallyRemovedAircraft = 0;
m_statsLastUpdateAircraftRequested = 0;
m_statsUpdateAircraftRequestedDeltaMs = 0;
}
CStatusMessageList CSimulatorCommon::debugVerifyStateAfterAllAircraftRemoved() const
@@ -638,11 +640,14 @@ namespace BlackCore
void CSimulatorCommon::setStatsRemoteAircraftUpdate(qint64 startTime)
{
const qint64 dt = QDateTime::currentMSecsSinceEpoch() - startTime;
const qint64 now = QDateTime::currentMSecsSinceEpoch();
const qint64 dt = now - startTime;
m_statsUpdateAircraftTimeTotalMs += dt;
m_statsUpdateAircraftRuns++;
m_statsUpdateAircraftTimeAvgMs = static_cast<double>(m_statsUpdateAircraftTimeTotalMs) / static_cast<double>(m_statsUpdateAircraftRuns);
m_updateRemoteAircraftInProgress = false;
if (m_statsLastUpdateAircraftRequested > 0) { m_statsUpdateAircraftRequestedDeltaMs = startTime - m_statsLastUpdateAircraftRequested; }
m_statsLastUpdateAircraftRequested = startTime;
}
void CSimulatorCommon::onRecalculatedRenderedAircraft(const CAirspaceAircraftSnapshot &snapshot)