mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 03:35:35 +08:00
committed by
Mathew Sutcliffe
parent
53abc6aaa3
commit
0eaab1753d
@@ -555,6 +555,20 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
void CContextSimulator::changeEnabledSimulators()
|
||||
{
|
||||
CSimulatorPluginInfo currentPluginInfo = m_simulatorPlugin.first;
|
||||
const QStringList enabledSimulators = m_enabledSimulators.getThreadLocal();
|
||||
|
||||
// Unload the current plugin, if it is no longer enabled
|
||||
if (!currentPluginInfo.isUnspecified() && !enabledSimulators.contains(currentPluginInfo.getIdentifier()))
|
||||
{
|
||||
unloadSimulatorPlugin();
|
||||
emit simulatorStatusChanged(ISimulator::Disconnected);
|
||||
}
|
||||
restoreSimulatorPlugins();
|
||||
}
|
||||
|
||||
void CContextSimulator::restoreSimulatorPlugins()
|
||||
{
|
||||
stopSimulatorListeners();
|
||||
|
||||
@@ -172,6 +172,9 @@ namespace BlackCore
|
||||
void ps_relayStatusMessageToSimulator(const BlackMisc::CStatusMessage &message);
|
||||
|
||||
private:
|
||||
//! Handle a change in enabled simulators
|
||||
void changeEnabledSimulators();
|
||||
|
||||
//! Reads list of enabled simulators, starts listeners
|
||||
void restoreSimulatorPlugins();
|
||||
|
||||
@@ -204,7 +207,7 @@ namespace BlackCore
|
||||
BlackMisc::Simulation::CAircraftModelSetLoader m_modelSetLoader { this }; //!< load model set from caches
|
||||
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::CStatusMessageList> m_matchingMessages;
|
||||
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::TSimulatorMessages> m_messageSettings { this }; //!< settings for messages
|
||||
BlackMisc::CSettingReadOnly<BlackCore::Application::TEnabledSimulators> m_enabledSimulators { this, &CContextSimulator::restoreSimulatorPlugins };
|
||||
BlackMisc::CSettingReadOnly<BlackCore::Application::TEnabledSimulators> m_enabledSimulators { this, &CContextSimulator::changeEnabledSimulators };
|
||||
QString m_networkSessionId; //! Network session, if not connected empty
|
||||
bool m_initallyAddAircrafts = false;
|
||||
bool m_enableMatchingMessages = true;
|
||||
|
||||
Reference in New Issue
Block a user