[xplane] Add monitoring of the number of minutes behind due to low FPS

This commit is contained in:
Mat Sutcliffe
2020-01-25 13:30:38 +00:00
parent 377b2f6a3e
commit e50bb6d5c7
10 changed files with 36 additions and 19 deletions

View File

@@ -369,7 +369,7 @@ namespace BlackSimPlugin
if ((m_slowTimerCalls % 5u) == 0u)
{
// reading FPS resets average, so we only monitor over some time
m_serviceProxy->getFrameStats(&m_averageFps, &m_simTimeRatio, &m_trackMilesShort);
m_serviceProxy->getFrameStats(&m_averageFps, &m_simTimeRatio, &m_trackMilesShort, &m_minutesLate);
}
}
}

View File

@@ -319,32 +319,34 @@ namespace BlackSimPlugin
m_dbusInterface->callDBusAsync(QLatin1String("isUsingRealTime"), setterCallback(o_isRealTime));
}
void CXSwiftBusServiceProxy::getFrameStats(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesLost) const
void CXSwiftBusServiceProxy::getFrameStats(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesShort, double *o_minutesLate) const
{
std::function<void(QDBusPendingCallWatcher *)> callback = [ = ](QDBusPendingCallWatcher * watcher)
{
QDBusPendingReply<double, double, double> reply = *watcher;
QDBusPendingReply<double, double, double, double> reply = *watcher;
if (!reply.isError())
{
*o_averageFps = reply.argumentAt<0>();
*o_simTimeRatio = reply.argumentAt<1>();
*o_trackMilesLost = reply.argumentAt<2>();
*o_trackMilesShort = reply.argumentAt<2>();
*o_minutesLate = reply.argumentAt<3>();
}
watcher->deleteLater();
};
m_dbusInterface->callDBusAsync(QLatin1String("getFrameStats"), callback)->waitForFinished();
}
void CXSwiftBusServiceProxy::getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesLost)
void CXSwiftBusServiceProxy::getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesShort, double *o_minutesLate)
{
std::function<void(QDBusPendingCallWatcher *)> callback = [ = ](QDBusPendingCallWatcher * watcher)
{
QDBusPendingReply<double, double, double> reply = *watcher;
QDBusPendingReply<double, double, double, double> reply = *watcher;
if (!reply.isError())
{
*o_averageFps = reply.argumentAt<0>();
*o_simTimeRatio = reply.argumentAt<1>();
*o_trackMilesLost = reply.argumentAt<2>();
*o_trackMilesShort = reply.argumentAt<2>();
*o_minutesLate = reply.argumentAt<3>();
}
watcher->deleteLater();
};

View File

@@ -210,8 +210,8 @@ namespace BlackSimPlugin
//! \copydoc XSwiftBus::CService::getFrameStats
//! @{
void getFrameStats(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesLost) const;
void getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesLost);
void getFrameStats(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesShort, double *o_minutesLate) const;
void getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesShort, double *o_minutesLate);
//! @}
//! \copydoc XSwiftBus::CService::getLatitudeDeg