Ref T312, added checkImpl/check in simulator listeners

This commit is contained in:
Klaus Basan
2018-08-27 14:19:32 +02:00
parent 1d7b3bd180
commit 68beaa6d9d
8 changed files with 106 additions and 36 deletions

View File

@@ -342,7 +342,7 @@ namespace BlackSimPlugin
void CSimulatorEmulated::onSettingsChanged()
{
const CSwiftPluginSettings settings(m_settings.get());
const CSwiftPluginSettings settings(m_pluginSettings.get());
m_log = settings.isLoggingFunctionCalls();
const CSimulatorInfo simulator = settings.getEmulatedSimulator();
@@ -446,7 +446,7 @@ namespace BlackSimPlugin
const QPointer<CSimulatorEmulatedListener> guard(this);
QTimer::singleShot(2000, this, [ = ]
{
if (guard.isNull()) { return; }
if (!guard) { return; }
Q_ASSERT_X(this->getPluginInfo().isValid(), Q_FUNC_INFO, "Invalid plugin");
emit this->simulatorStarted(this->getPluginInfo());
});
@@ -454,5 +454,10 @@ namespace BlackSimPlugin
void CSimulatorEmulatedListener::stopImpl()
{ }
void CSimulatorEmulatedListener::checkImpl()
{
this->startImpl();
}
} // ns
} // ns

View File

@@ -168,7 +168,7 @@ namespace BlackSimPlugin
BlackMisc::Simulation::CSimulatedAircraftList m_renderedAircraft; //!< represents remote aircraft in simulator
QScopedPointer<CSimulatorEmulatedMonitorDialog> m_monitorWidget; //!< parent will be main window, so we need to destroy widget when destroyed
BlackMisc::CConnectionGuard m_connectionGuard; //!< connected with provider
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::Settings::TSwiftPlugin> m_settings { this, &CSimulatorEmulated::onSettingsChanged };
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::Settings::TSwiftPlugin> m_pluginSettings { this, &CSimulatorEmulated::onSettingsChanged };
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Simulation::CInterpolatorMultiWrapper> m_interpolators; //!< interpolators per callsign
};
@@ -187,6 +187,9 @@ namespace BlackSimPlugin
//! \copydoc BlackCore::ISimulatorListener::stopImpl
virtual void stopImpl() override;
//! \copydoc BlackCore::ISimulatorListener::stopImpl
virtual void checkImpl() override;
};
} // ns
} // ns