Rename argument simulatorInfo to simulatorPluginInfo

This commit is contained in:
Roland Winklmeier
2016-09-09 00:49:07 +02:00
parent e5e5e796f7
commit 004ca4f0ca
2 changed files with 11 additions and 11 deletions

View File

@@ -303,14 +303,14 @@ namespace BlackCore
return m_simulatorPlugin.second->getTimeSynchronizationOffset(); return m_simulatorPlugin.second->getTimeSynchronizationOffset();
} }
bool CContextSimulator::loadSimulatorPlugin(const CSimulatorPluginInfo &simulatorInfo, bool withListener) bool CContextSimulator::loadSimulatorPlugin(const CSimulatorPluginInfo &simulatorPluginInfo, bool withListener)
{ {
Q_ASSERT(getIContextApplication()); Q_ASSERT(getIContextApplication());
Q_ASSERT(getIContextApplication()->isUsingImplementingObject()); Q_ASSERT(getIContextApplication()->isUsingImplementingObject());
Q_ASSERT(!simulatorInfo.isUnspecified()); Q_ASSERT(!simulatorPluginInfo.isUnspecified());
Q_ASSERT(CThreadUtils::isCurrentThreadApplicationThread()); // only run in main thread Q_ASSERT(CThreadUtils::isCurrentThreadApplicationThread()); // only run in main thread
if (!simulatorInfo.isValid()) if (!simulatorPluginInfo.isValid())
{ {
CLogMessage(this).error("Illegal plugin"); CLogMessage(this).error("Illegal plugin");
return false; return false;
@@ -327,17 +327,17 @@ namespace BlackCore
// now we have a state where no driver is loaded // now we have a state where no driver is loaded
if (withListener) if (withListener)
{ {
this->listenForSimulator(simulatorInfo); this->listenForSimulator(simulatorPluginInfo);
return false; // not a plugin yet, just listener return false; // not a plugin yet, just listener
} }
if (!simulatorInfo.isValid() || simulatorInfo.isUnspecified()) if (!simulatorPluginInfo.isValid() || simulatorPluginInfo.isUnspecified())
{ {
CLogMessage(this).error("Illegal plugin"); CLogMessage(this).error("Illegal plugin");
return false; return false;
} }
ISimulatorFactory *factory = m_plugins->getFactory(simulatorInfo.getIdentifier()); ISimulatorFactory *factory = m_plugins->getFactory(simulatorPluginInfo.getIdentifier());
Q_ASSERT_X(factory, Q_FUNC_INFO, "no factory"); Q_ASSERT_X(factory, Q_FUNC_INFO, "no factory");
// We assume we run in the same process as the own aircraft context // We assume we run in the same process as the own aircraft context
@@ -346,7 +346,7 @@ namespace BlackCore
Q_ASSERT(this->getIContextNetwork()->isUsingImplementingObject()); Q_ASSERT(this->getIContextNetwork()->isUsingImplementingObject());
IOwnAircraftProvider *ownAircraftProvider = this->getRuntime()->getCContextOwnAircraft(); IOwnAircraftProvider *ownAircraftProvider = this->getRuntime()->getCContextOwnAircraft();
IRemoteAircraftProvider *renderedAircraftProvider = this->getRuntime()->getCContextNetwork(); IRemoteAircraftProvider *renderedAircraftProvider = this->getRuntime()->getCContextNetwork();
ISimulator *simulator = factory->create(simulatorInfo, ownAircraftProvider, renderedAircraftProvider, &m_weatherManager); ISimulator *simulator = factory->create(simulatorPluginInfo, ownAircraftProvider, renderedAircraftProvider, &m_weatherManager);
Q_ASSERT_X(simulator, Q_FUNC_INFO, "no simulator driver can be created"); Q_ASSERT_X(simulator, Q_FUNC_INFO, "no simulator driver can be created");
bool c = connect(simulator, &ISimulator::simulatorStatusChanged, this, &CContextSimulator::ps_onSimulatorStatusChanged); bool c = connect(simulator, &ISimulator::simulatorStatusChanged, this, &CContextSimulator::ps_onSimulatorStatusChanged);
@@ -374,11 +374,11 @@ namespace BlackCore
// try to connect to simulator // try to connect to simulator
simulator->connectTo(); simulator->connectTo();
// when everything is set up connected, update the current plugin info // when everything is set up connected, update the current plugin info
m_simulatorPlugin.first = simulatorInfo; m_simulatorPlugin.first = simulatorPluginInfo;
m_simulatorPlugin.second = simulator; m_simulatorPlugin.second = simulator;
emit simulatorPluginChanged(simulatorInfo); emit simulatorPluginChanged(simulatorPluginInfo);
CLogMessage(this).info("Simulator plugin loaded: %1") << simulatorInfo.toQString(true); CLogMessage(this).info("Simulator plugin loaded: %1") << simulatorPluginInfo.toQString(true);
return true; return true;
} }

View File

@@ -187,7 +187,7 @@ namespace BlackCore
private: private:
//! Load plugin, if required start listeners before //! Load plugin, if required start listeners before
bool loadSimulatorPlugin(const BlackMisc::Simulation::CSimulatorPluginInfo &simulatorInfo, bool withListeners); bool loadSimulatorPlugin(const BlackMisc::Simulation::CSimulatorPluginInfo &simulatorPluginInfo, bool withListeners);
//! Unload plugin, if desired restart listeners //! Unload plugin, if desired restart listeners
void unloadSimulatorPlugin(); void unloadSimulatorPlugin();