mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 14:47:19 +08:00
[xplane] Add monitoring of the number of track miles lost due to low FPS
This commit is contained in:
@@ -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_serviceProxy->getFrameStats(&m_averageFps, &m_simTimeRatio, &m_trackMilesShort);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,30 +319,32 @@ namespace BlackSimPlugin
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("isUsingRealTime"), setterCallback(o_isRealTime));
|
||||
}
|
||||
|
||||
void CXSwiftBusServiceProxy::getFrameStats(double *o_averageFps, double *o_simTimeRatio) const
|
||||
void CXSwiftBusServiceProxy::getFrameStats(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesLost) const
|
||||
{
|
||||
std::function<void(QDBusPendingCallWatcher *)> callback = [ = ](QDBusPendingCallWatcher * watcher)
|
||||
{
|
||||
QDBusPendingReply<double, double> reply = *watcher;
|
||||
QDBusPendingReply<double, double, double> reply = *watcher;
|
||||
if (!reply.isError())
|
||||
{
|
||||
*o_averageFps = reply.argumentAt<0>();
|
||||
*o_simTimeRatio = reply.argumentAt<1>();
|
||||
*o_trackMilesLost = reply.argumentAt<2>();
|
||||
}
|
||||
watcher->deleteLater();
|
||||
};
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getFrameStats"), callback)->waitForFinished();
|
||||
}
|
||||
|
||||
void CXSwiftBusServiceProxy::getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio)
|
||||
void CXSwiftBusServiceProxy::getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesLost)
|
||||
{
|
||||
std::function<void(QDBusPendingCallWatcher *)> callback = [ = ](QDBusPendingCallWatcher * watcher)
|
||||
{
|
||||
QDBusPendingReply<double, double> reply = *watcher;
|
||||
QDBusPendingReply<double, double, double> reply = *watcher;
|
||||
if (!reply.isError())
|
||||
{
|
||||
*o_averageFps = reply.argumentAt<0>();
|
||||
*o_simTimeRatio = reply.argumentAt<1>();
|
||||
*o_trackMilesLost = reply.argumentAt<2>();
|
||||
}
|
||||
watcher->deleteLater();
|
||||
};
|
||||
|
||||
@@ -210,8 +210,8 @@ namespace BlackSimPlugin
|
||||
|
||||
//! \copydoc XSwiftBus::CService::getFrameStats
|
||||
//! @{
|
||||
void getFrameStats(double *o_averageFps, double *o_simTimeRatio) const;
|
||||
void getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio);
|
||||
void getFrameStats(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesLost) const;
|
||||
void getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesLost);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XSwiftBus::CService::getLatitudeDeg
|
||||
|
||||
Reference in New Issue
Block a user