Issue #37 Emit signal when FPS drops below threshold

This commit is contained in:
Mat Sutcliffe
2021-08-09 00:10:30 +01:00
parent 14e03bd4b5
commit f311906d04
5 changed files with 27 additions and 1 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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());
}