mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-06 02:16:04 +08:00
Issue #37 Reset FPS counter when network is connected
This commit is contained in:
@@ -226,6 +226,15 @@ namespace BlackSimPlugin
|
|||||||
CSimulatorPluginCommon::callbackReceivedRequestedElevation(plane, callsign, isWater);
|
CSimulatorPluginCommon::callbackReceivedRequestedElevation(plane, callsign, isWater);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimulatorXPlane::setFlightNetworkConnected(bool connected)
|
||||||
|
{
|
||||||
|
if (connected && !this->isShuttingDownOrDisconnected())
|
||||||
|
{
|
||||||
|
m_serviceProxy->resetFrameTotals();
|
||||||
|
}
|
||||||
|
CSimulatorPluginCommon::setFlightNetworkConnected(connected);
|
||||||
|
}
|
||||||
|
|
||||||
bool CSimulatorXPlane::isSuspiciousTerrainValue(const CElevationPlane &elevation)
|
bool CSimulatorXPlane::isSuspiciousTerrainValue(const CElevationPlane &elevation)
|
||||||
{
|
{
|
||||||
if (!elevation.hasMSLGeodeticHeight()) { return true; }
|
if (!elevation.hasMSLGeodeticHeight()) { return true; }
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ namespace BlackSimPlugin
|
|||||||
virtual bool testSendSituationAndParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) override;
|
virtual bool testSendSituationAndParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) override;
|
||||||
virtual void injectWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid) override;
|
virtual void injectWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid) override;
|
||||||
virtual void callbackReceivedRequestedElevation(const BlackMisc::Geo::CElevationPlane &plane, const BlackMisc::Aviation::CCallsign &callsign, bool isWater) override;
|
virtual void callbackReceivedRequestedElevation(const BlackMisc::Geo::CElevationPlane &plane, const BlackMisc::Aviation::CCallsign &callsign, bool isWater) override;
|
||||||
|
virtual void setFlightNetworkConnected(bool connected) override;
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Simulation::ISimulationEnvironmentProvider::requestElevation
|
//! \copydoc BlackMisc::Simulation::ISimulationEnvironmentProvider::requestElevation
|
||||||
|
|||||||
@@ -358,6 +358,11 @@ namespace BlackSimPlugin
|
|||||||
m_dbusInterface->callDBusAsync(QLatin1String("getFrameStats"), callback);
|
m_dbusInterface->callDBusAsync(QLatin1String("getFrameStats"), callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CXSwiftBusServiceProxy::resetFrameTotals()
|
||||||
|
{
|
||||||
|
m_dbusInterface->callDBus(QLatin1String("resetFrameTotals"));
|
||||||
|
}
|
||||||
|
|
||||||
double CXSwiftBusServiceProxy::getLatitudeDeg() const
|
double CXSwiftBusServiceProxy::getLatitudeDeg() const
|
||||||
{
|
{
|
||||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getLatitudeDeg"));
|
return m_dbusInterface->callDBusRet<double>(QLatin1String("getLatitudeDeg"));
|
||||||
@@ -746,5 +751,6 @@ namespace BlackSimPlugin
|
|||||||
{
|
{
|
||||||
m_dbusInterface->callDBus(QLatin1String("setSettingsJson"), json);
|
m_dbusInterface->callDBus(QLatin1String("setSettingsJson"), json);
|
||||||
}
|
}
|
||||||
} // ns
|
}
|
||||||
|
// ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -217,6 +217,9 @@ namespace BlackSimPlugin
|
|||||||
void getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesShort, double *o_minutesLate);
|
void getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesShort, double *o_minutesLate);
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
//! \copydoc XSwiftBus::CService::resetFrameTotals
|
||||||
|
void resetFrameTotals();
|
||||||
|
|
||||||
//! \copydoc XSwiftBus::CService::getLatitudeDeg
|
//! \copydoc XSwiftBus::CService::getLatitudeDeg
|
||||||
//! @{
|
//! @{
|
||||||
double getLatitudeDeg() const;
|
double getLatitudeDeg() const;
|
||||||
|
|||||||
@@ -105,6 +105,8 @@ R"XML(<node>
|
|||||||
<arg name="trackMilesShort" type="d" direction="out"/>
|
<arg name="trackMilesShort" type="d" direction="out"/>
|
||||||
<arg name="minutesLate" type="d" direction="out"/>
|
<arg name="minutesLate" type="d" direction="out"/>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="resetFrameTotals">
|
||||||
|
</method>
|
||||||
<method name="getLatitudeDeg">
|
<method name="getLatitudeDeg">
|
||||||
<arg type="d" direction="out"/>
|
<arg type="d" direction="out"/>
|
||||||
</method>
|
</method>
|
||||||
|
|||||||
@@ -607,6 +607,14 @@ namespace XSwiftBus
|
|||||||
sendDBusMessage(reply);
|
sendDBusMessage(reply);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else if (message.getMethodName() == "resetFrameTotals")
|
||||||
|
{
|
||||||
|
maybeSendEmptyDBusReply(wantsReply, sender, serial);
|
||||||
|
queueDBusCall([=]()
|
||||||
|
{
|
||||||
|
resetFrameTotals();
|
||||||
|
});
|
||||||
|
}
|
||||||
else if (message.getMethodName() == "getLatitudeDeg")
|
else if (message.getMethodName() == "getLatitudeDeg")
|
||||||
{
|
{
|
||||||
queueDBusCall([ = ]()
|
queueDBusCall([ = ]()
|
||||||
|
|||||||
Reference in New Issue
Block a user