Ref T681, preparations to use CG from DB

* renamed to "getSimulatorCG" ...
* pass simulator settings to sim.env.provider to decide what CG to use
* store DB CG and init it when aircraft is added
* style
This commit is contained in:
Klaus Basan
2019-06-10 19:54:35 +02:00
committed by Mat Sutcliffe
parent 33c3ee68f1
commit 6d490e9a49
14 changed files with 196 additions and 64 deletions

View File

@@ -380,15 +380,15 @@ namespace BlackSimPlugin
if (plugin.isValid())
{
// ? restart driver, disconnect/reconnect
this->setNewPluginInfo(plugin, settings.getDefaultModel());
this->setNewPluginInfo(plugin, m_multiSettings.getSettings(simulator), settings.getDefaultModel());
}
else
{
// not all drivers are installed
// not all drivers are installed, like FS9/FSX on x64
CLogMessage(this).validationError(u"No valid plugin in emulated driver for '%1'") << simulator.toQString();
const QString sn = simulator.toQString(true);
const CSimulatorPluginInfo fakedPlugin = CSimulatorPluginInfo(simulator.toPluginIdentifier(), sn, sn, QStringLiteral("Emulated, but uninstalled '%1'").arg(sn), false);
this->setNewPluginInfo(fakedPlugin, settings.getDefaultModel());
this->setNewPluginInfo(fakedPlugin, m_multiSettings.getSettings(simulator), settings.getDefaultModel());
}
// update provider, own name, title

View File

@@ -170,6 +170,7 @@ namespace BlackSimPlugin
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_pluginSettings { this, &CSimulatorEmulated::onSettingsChanged };
BlackMisc::Simulation::Settings::CMultiSimulatorSettings m_multiSettings { this };
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Simulation::CInterpolatorMultiWrapper> m_interpolators; //!< interpolators per callsign
};