[xplane] Added display of simulation time ratio in simulator component

This commit is contained in:
Mat Sutcliffe
2020-01-12 17:34:48 +00:00
parent c88b05a734
commit 35cfaebc7d
9 changed files with 79 additions and 19 deletions

View File

@@ -260,6 +260,7 @@ namespace BlackCore
{
this->clearAllRemoteAircraftData(); // reset
m_averageFps = -1.0;
m_simTimeRatio = 1.0;
}
bool ISimulator::isUpdateAllRemoteAircraft(qint64 currentTimestamp) const
@@ -1034,6 +1035,7 @@ namespace BlackCore
bool ISimulator::disconnectFrom()
{
m_averageFps = -1.0;
m_simTimeRatio = 1.0;
return true;
}

View File

@@ -218,6 +218,9 @@ namespace BlackCore
//! Average FPS (frames per second)
double getAverageFPS() const { return m_averageFps; }
//! Ratio of simulation time to real time, due to low FPS
double getSimTimeRatio() const { return m_simTimeRatio; }
//! Send situation/parts for testing
virtual bool testSendSituationAndParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) = 0;
@@ -579,6 +582,7 @@ namespace BlackCore
int m_statsUpdateAircraftLimited = 0; //!< skipped because of max.update limitations
double m_statsUpdateAircraftTimeAvgMs = 0; //!< statistics average update time
double m_averageFps = -1.0; //!< FPS
double m_simTimeRatio = 1.0; //!< ratio of simulation time to real time, due to low FPS (X-Plane)
qint64 m_updateAllRemoteAircraftUntil = 0; //!< force an update of all remote aircraft, used when own aircraft is moved, paused to make sure all remote aircraft are updated
qint64 m_statsUpdateAircraftTimeTotalMs = 0; //!< statistics total update time
qint64 m_statsCurrentUpdateTimeMs = 0; //!< statistics current update time