mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
refs #780, signal installedAircraftModelsChanged dangling
* discovered during testing, signal is not used (since we now use model set) * renamed context signal to "modelSetChanged" * prepared context for message settings
This commit is contained in:
@@ -90,8 +90,8 @@ namespace BlackCore
|
||||
//! Render restrictions have been changed
|
||||
void renderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance, const BlackMisc::PhysicalQuantities::CLength &maxRenderedBoundary);
|
||||
|
||||
//! Installed aircraft models ready or changed
|
||||
void installedAircraftModelsChanged();
|
||||
//! Model set ready or changed
|
||||
void modelSetChanged();
|
||||
|
||||
//! A single model has been matched for given aircraft
|
||||
void modelMatchingCompleted(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
|
||||
@@ -57,6 +57,9 @@ namespace BlackCore
|
||||
connect(&m_weatherManager, &CWeatherManager::weatherGridReceived, this, &CContextSimulator::weatherGridReceived);
|
||||
m_plugins->collectPlugins();
|
||||
restoreSimulatorPlugins();
|
||||
|
||||
connect(&m_modelSetLoader, &CAircraftModelSetLoader::simulatorChanged, this, &CContextSimulator::ps_modelSetChanged);
|
||||
connect(&m_modelSetLoader, &CAircraftModelSetLoader::cacheChanged, this, &CContextSimulator::ps_modelSetChanged);
|
||||
}
|
||||
|
||||
CContextSimulator *CContextSimulator::registerWithDBus(CDBusServer *server)
|
||||
@@ -358,17 +361,15 @@ namespace BlackCore
|
||||
Q_ASSERT(c);
|
||||
c = connect(simulator, &ISimulator::aircraftRenderingChanged, this, &IContextSimulator::aircraftRenderingChanged);
|
||||
Q_ASSERT(c);
|
||||
c = connect(simulator, &ISimulator::installedAircraftModelsChanged, this, &IContextSimulator::installedAircraftModelsChanged);
|
||||
Q_ASSERT(c);
|
||||
c = connect(simulator, &ISimulator::renderRestrictionsChanged, this, &IContextSimulator::renderRestrictionsChanged);
|
||||
Q_ASSERT(c);
|
||||
c = connect(simulator, &ISimulator::airspaceSnapshotHandled, this, &IContextSimulator::airspaceSnapshotHandled);
|
||||
Q_ASSERT(c);
|
||||
|
||||
// log from context to simulator
|
||||
c = connect(CLogHandler::instance(), &CLogHandler::localMessageLogged, simulator, &ISimulator::displayStatusMessage);
|
||||
c = connect(CLogHandler::instance(), &CLogHandler::localMessageLogged, this, &CContextSimulator::ps_relayStatusMessageToSimulator);
|
||||
Q_ASSERT(c);
|
||||
c = connect(CLogHandler::instance(), &CLogHandler::remoteMessageLogged, simulator, &ISimulator::displayStatusMessage);
|
||||
c = connect(CLogHandler::instance(), &CLogHandler::remoteMessageLogged, this, &CContextSimulator::ps_relayStatusMessageToSimulator);
|
||||
Q_ASSERT(c);
|
||||
Q_UNUSED(c);
|
||||
|
||||
@@ -525,6 +526,12 @@ namespace BlackCore
|
||||
emit simulatorStatusChanged(status);
|
||||
}
|
||||
|
||||
void CContextSimulator::ps_modelSetChanged(const CSimulatorInfo &simulator)
|
||||
{
|
||||
Q_UNUSED(simulator);
|
||||
emit this->modelSetChanged();
|
||||
}
|
||||
|
||||
void CContextSimulator::ps_textMessagesReceived(const Network::CTextMessageList &textMessages)
|
||||
{
|
||||
if (!isSimulatorSimulating()) { return; }
|
||||
@@ -563,6 +570,13 @@ namespace BlackCore
|
||||
m_simulatorPlugin.second->updateOwnSimulatorCockpit(ownAircraft, originator);
|
||||
}
|
||||
|
||||
void CContextSimulator::ps_relayStatusMessageToSimulator(const BlackMisc::CStatusMessage &message)
|
||||
{
|
||||
if (!isSimulatorSimulating()) { return; }
|
||||
//! \todo add settings and only relay messages as set in settings
|
||||
m_simulatorPlugin.second->displayStatusMessage(message);
|
||||
}
|
||||
|
||||
void CContextSimulator::restoreSimulatorPlugins()
|
||||
{
|
||||
stopSimulatorListeners();
|
||||
|
||||
@@ -122,6 +122,9 @@ namespace BlackCore
|
||||
//! Handle new connection status of simulator
|
||||
void ps_onSimulatorStatusChanged(int status);
|
||||
|
||||
//! Model set from model set loader changed
|
||||
void ps_modelSetChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! Text message received
|
||||
void ps_textMessagesReceived(const BlackMisc::Network::CTextMessageList &textMessages);
|
||||
|
||||
@@ -141,10 +144,13 @@ namespace BlackCore
|
||||
//! \remarks set by runtime, only to be used locally (not via DBus)
|
||||
void ps_updateSimulatorCockpitFromContext(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! Relay status message to simulator under consideration of settings
|
||||
void ps_relayStatusMessageToSimulator(const BlackMisc::CStatusMessage &message);
|
||||
|
||||
private:
|
||||
//! Reads list of enabled simulators, starts listeners
|
||||
void restoreSimulatorPlugins();
|
||||
|
||||
private:
|
||||
//! Load plugin, if required start listeners before
|
||||
bool loadSimulatorPlugin(const BlackMisc::Simulation::CSimulatorPluginInfo &simulatorPluginInfo, bool withListeners);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace BlackCore
|
||||
"simulatorStatusChanged", this, SIGNAL(simulatorStatusChanged(int)));
|
||||
Q_ASSERT(s);
|
||||
s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(),
|
||||
"installedAircraftModelsChanged", this, SIGNAL(installedAircraftModelsChanged()));
|
||||
"modelSetChanged", this, SIGNAL(modelSetChanged()));
|
||||
Q_ASSERT(s);
|
||||
s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(),
|
||||
"ownAircraftModelChanged", this, SIGNAL(ownAircraftModelChanged(BlackMisc::Simulation::CAircraftModel)));
|
||||
|
||||
Reference in New Issue
Block a user