mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Issue #37 Emit signal when FPS drops below threshold
This commit is contained in:
@@ -120,6 +120,9 @@ namespace BlackCore
|
||||
//! A formerly vital driver is no longer vital/responding
|
||||
void vitalityLost();
|
||||
|
||||
//! Frame rate has fallen too far below the threshold to maintain consistent sim rate
|
||||
void insufficientFrameRateDetected(bool fatal);
|
||||
|
||||
//! Render restrictions have been changed
|
||||
void renderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance);
|
||||
|
||||
|
||||
@@ -534,6 +534,10 @@ namespace BlackCore
|
||||
c = connect(simulator, &ISimulator::autoPublishDataWritten, this, &IContextSimulator::autoPublishDataWritten);
|
||||
Q_ASSERT(c);
|
||||
|
||||
// disconnect for X-Plane FPS below 20
|
||||
c = connect(simulator, &ISimulator::insufficientFrameRateDetected, this, &IContextSimulator::insufficientFrameRateDetected);
|
||||
Q_ASSERT(c);
|
||||
|
||||
// log from context to simulator
|
||||
c = connect(CLogHandler::instance(), &CLogHandler::localMessageLogged, this, &CContextSimulator::relayStatusMessageToSimulator);
|
||||
Q_ASSERT(c);
|
||||
|
||||
@@ -104,6 +104,9 @@ namespace BlackCore
|
||||
s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(),
|
||||
"validatedModelSet", this, SIGNAL(validatedModelSet(BlackMisc::Simulation::CSimulatorInfo, BlackMisc::Simulation::CAircraftModelList, BlackMisc::Simulation::CAircraftModelList, bool, BlackMisc::CStatusMessageList)));
|
||||
Q_ASSERT(s);
|
||||
s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(),
|
||||
"insufficientFrameRateDetected", this, SIGNAL(insufficientFrameRateDetected(bool)));
|
||||
Q_ASSERT(s);
|
||||
Q_UNUSED(s)
|
||||
this->relayBaseClassSignals(serviceName, connection, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user