mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Ref T232, some formatting
* made "private slots" -> "slots" * cross context slots marked with "xCtx" prefix
This commit is contained in:
@@ -437,7 +437,7 @@ namespace BlackCore
|
|||||||
emit this->connectionStatusChanged(from, to);
|
emit this->connectionStatusChanged(from, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextNetwork::simulatorRenderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const CLength &maxRenderedDistance)
|
void CContextNetwork::xCtxSimulatorRenderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const CLength &maxRenderedDistance)
|
||||||
{
|
{
|
||||||
// mainly passing changed restrictions from simulator to network
|
// mainly passing changed restrictions from simulator to network
|
||||||
if (!m_airspace) { return; }
|
if (!m_airspace) { return; }
|
||||||
|
|||||||
@@ -235,7 +235,8 @@ namespace BlackCore
|
|||||||
|
|
||||||
//! Render restrictions have been changed, used with analyzer
|
//! Render restrictions have been changed, used with analyzer
|
||||||
//! \sa CAirspaceAnalyzer
|
//! \sa CAirspaceAnalyzer
|
||||||
void simulatorRenderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance);
|
//! \ingroup crosscontextslot
|
||||||
|
void xCtxSimulatorRenderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance);
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ namespace BlackCore
|
|||||||
if (this->getIContextAudio()) this->getIContextAudio()->setVoiceOutputVolume(outputVolume);
|
if (this->getIContextAudio()) this->getIContextAudio()->setVoiceOutputVolume(outputVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextOwnAircraft::changedAtcStationOnlineConnectionStatus(const CAtcStation &atcStation, bool connected)
|
void CContextOwnAircraft::xCtxChangedAtcStationOnlineConnectionStatus(const CAtcStation &atcStation, bool connected)
|
||||||
{
|
{
|
||||||
// any of our active frequencies?
|
// any of our active frequencies?
|
||||||
Q_UNUSED(connected);
|
Q_UNUSED(connected);
|
||||||
@@ -331,7 +331,7 @@ namespace BlackCore
|
|||||||
this->resolveVoiceRooms();
|
this->resolveVoiceRooms();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextOwnAircraft::changedSimulatorModel(const CAircraftModel &model)
|
void CContextOwnAircraft::xCtxChangedSimulatorModel(const CAircraftModel &model)
|
||||||
{
|
{
|
||||||
this->updateOwnModel(model);
|
this->updateOwnModel(model);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,11 +185,11 @@ namespace BlackCore
|
|||||||
|
|
||||||
//! Station has been changed, needed to tune in/out voice room
|
//! Station has been changed, needed to tune in/out voice room
|
||||||
//! \ingroup crosscontextslot
|
//! \ingroup crosscontextslot
|
||||||
void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &atcStation, bool connected);
|
void xCtxChangedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &atcStation, bool connected);
|
||||||
|
|
||||||
//! Simulator model has been changed
|
//! Simulator model has been changed
|
||||||
//! \ingroup crosscontextslot
|
//! \ingroup crosscontextslot
|
||||||
void changedSimulatorModel(const BlackMisc::Simulation::CAircraftModel &model);
|
void xCtxChangedSimulatorModel(const BlackMisc::Simulation::CAircraftModel &model);
|
||||||
|
|
||||||
//! Web data loaded
|
//! Web data loaded
|
||||||
void allSwiftWebDataRead();
|
void allSwiftWebDataRead();
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ namespace BlackCore
|
|||||||
this->restoreSimulatorPlugins();
|
this->restoreSimulatorPlugins();
|
||||||
|
|
||||||
connect(&m_weatherManager, &CWeatherManager::weatherGridReceived, this, &CContextSimulator::weatherGridReceived);
|
connect(&m_weatherManager, &CWeatherManager::weatherGridReceived, this, &CContextSimulator::weatherGridReceived);
|
||||||
connect(&m_modelSetLoader, &CAircraftModelSetLoader::simulatorChanged, this, &CContextSimulator::ps_modelSetChanged);
|
connect(&m_modelSetLoader, &CAircraftModelSetLoader::simulatorChanged, this, &CContextSimulator::modelSetChanged);
|
||||||
connect(&m_modelSetLoader, &CAircraftModelSetLoader::cacheChanged, this, &CContextSimulator::ps_modelSetChanged);
|
connect(&m_modelSetLoader, &CAircraftModelSetLoader::cacheChanged, this, &CContextSimulator::modelSetChanged);
|
||||||
|
|
||||||
// deferred init of last model set, if no other data are set in meantime
|
// deferred init of last model set, if no other data are set in meantime
|
||||||
QTimer::singleShot(1250, this, &CContextSimulator::initByLastUsedModelSet);
|
QTimer::singleShot(1250, this, &CContextSimulator::initByLastUsedModelSet);
|
||||||
@@ -287,9 +287,9 @@ namespace BlackCore
|
|||||||
m_aircraftMatcher.setModelSet(m_modelSetLoader.getAircraftModels(), simInfo);
|
m_aircraftMatcher.setModelSet(m_modelSetLoader.getAircraftModels(), simInfo);
|
||||||
m_aircraftMatcher.setDefaultModel(simulator->getDefaultModel());
|
m_aircraftMatcher.setDefaultModel(simulator->getDefaultModel());
|
||||||
|
|
||||||
bool c = connect(simulator, &ISimulator::simulatorStatusChanged, this, &CContextSimulator::ps_onSimulatorStatusChanged);
|
bool c = connect(simulator, &ISimulator::simulatorStatusChanged, this, &CContextSimulator::onSimulatorStatusChanged);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(simulator, &ISimulator::physicallyAddingRemoteModelFailed, this, &CContextSimulator::ps_addingRemoteAircraftFailed);
|
c = connect(simulator, &ISimulator::physicallyAddingRemoteModelFailed, this, &CContextSimulator::addingRemoteAircraftFailed);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(simulator, &ISimulator::ownAircraftModelChanged, this, &IContextSimulator::ownAircraftModelChanged);
|
c = connect(simulator, &ISimulator::ownAircraftModelChanged, this, &IContextSimulator::ownAircraftModelChanged);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
@@ -301,9 +301,9 @@ namespace BlackCore
|
|||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
|
|
||||||
// log from context to simulator
|
// log from context to simulator
|
||||||
c = connect(CLogHandler::instance(), &CLogHandler::localMessageLogged, this, &CContextSimulator::ps_relayStatusMessageToSimulator);
|
c = connect(CLogHandler::instance(), &CLogHandler::localMessageLogged, this, &CContextSimulator::relayStatusMessageToSimulator);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(CLogHandler::instance(), &CLogHandler::remoteMessageLogged, this, &CContextSimulator::ps_relayStatusMessageToSimulator);
|
c = connect(CLogHandler::instance(), &CLogHandler::remoteMessageLogged, this, &CContextSimulator::relayStatusMessageToSimulator);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
Q_UNUSED(c);
|
Q_UNUSED(c);
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
Q_ASSERT_X(!listener->parent(), Q_FUNC_INFO, "Objects with parent cannot be moved to thread");
|
Q_ASSERT_X(!listener->parent(), Q_FUNC_INFO, "Objects with parent cannot be moved to thread");
|
||||||
|
|
||||||
const bool c = connect(listener, &ISimulatorListener::simulatorStarted, this, &CContextSimulator::ps_simulatorStarted);
|
const bool c = connect(listener, &ISimulatorListener::simulatorStarted, this, &CContextSimulator::onSimulatorStarted);
|
||||||
if (!c)
|
if (!c)
|
||||||
{
|
{
|
||||||
CLogMessage(this).error("Unable to use '%1'") << simulatorInfo.toQString();
|
CLogMessage(this).error("Unable to use '%1'") << simulatorInfo.toQString();
|
||||||
@@ -406,7 +406,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_addedRemoteAircraft(const CSimulatedAircraft &remoteAircraft)
|
void CContextSimulator::xCtxAddedRemoteAircraft(const CSimulatedAircraft &remoteAircraft)
|
||||||
{
|
{
|
||||||
if (!isSimulatorSimulating()) { return; }
|
if (!isSimulatorSimulating()) { return; }
|
||||||
const CCallsign callsign = remoteAircraft.getCallsign();
|
const CCallsign callsign = remoteAircraft.getCallsign();
|
||||||
@@ -425,13 +425,13 @@ namespace BlackCore
|
|||||||
emit modelMatchingCompleted(remoteAircraft);
|
emit modelMatchingCompleted(remoteAircraft);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_removedRemoteAircraft(const CCallsign &callsign)
|
void CContextSimulator::xCtxRemovedRemoteAircraft(const CCallsign &callsign)
|
||||||
{
|
{
|
||||||
if (!isSimulatorSimulating()) { return; }
|
if (!isSimulatorSimulating()) { return; }
|
||||||
m_simulatorPlugin.second->logicallyRemoveRemoteAircraft(callsign);
|
m_simulatorPlugin.second->logicallyRemoveRemoteAircraft(callsign);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_onSimulatorStatusChanged(ISimulator::SimulatorStatus status)
|
void CContextSimulator::onSimulatorStatusChanged(ISimulator::SimulatorStatus status)
|
||||||
{
|
{
|
||||||
if (m_initallyAddAircrafts && status.testFlag(ISimulator::Simulating))
|
if (m_initallyAddAircrafts && status.testFlag(ISimulator::Simulating))
|
||||||
{
|
{
|
||||||
@@ -445,7 +445,7 @@ namespace BlackCore
|
|||||||
for (const CSimulatedAircraft &simulatedAircraft : aircraft)
|
for (const CSimulatedAircraft &simulatedAircraft : aircraft)
|
||||||
{
|
{
|
||||||
BLACK_VERIFY_X(!simulatedAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "Need callsign");
|
BLACK_VERIFY_X(!simulatedAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "Need callsign");
|
||||||
ps_addedRemoteAircraft(simulatedAircraft);
|
xCtxAddedRemoteAircraft(simulatedAircraft);
|
||||||
}
|
}
|
||||||
m_initallyAddAircrafts = false;
|
m_initallyAddAircrafts = false;
|
||||||
}
|
}
|
||||||
@@ -458,13 +458,13 @@ namespace BlackCore
|
|||||||
emit simulatorStatusChanged(status);
|
emit simulatorStatusChanged(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_modelSetChanged(const CSimulatorInfo &simulator)
|
void CContextSimulator::onModelSetChanged(const CSimulatorInfo &simulator)
|
||||||
{
|
{
|
||||||
Q_UNUSED(simulator);
|
Q_UNUSED(simulator);
|
||||||
emit this->modelSetChanged();
|
emit this->modelSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_textMessagesReceived(const Network::CTextMessageList &textMessages)
|
void CContextSimulator::xCtxTextMessagesReceived(const Network::CTextMessageList &textMessages)
|
||||||
{
|
{
|
||||||
if (!isSimulatorSimulating()) { return; }
|
if (!isSimulatorSimulating()) { return; }
|
||||||
if (!this->getIContextOwnAircraft()) { return; }
|
if (!this->getIContextOwnAircraft()) { return; }
|
||||||
@@ -477,26 +477,26 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_cockpitChangedFromSimulator(const CSimulatedAircraft &ownAircraft)
|
void CContextSimulator::onCockpitChangedFromSimulator(const CSimulatedAircraft &ownAircraft)
|
||||||
{
|
{
|
||||||
Q_ASSERT(getIContextOwnAircraft());
|
Q_ASSERT(getIContextOwnAircraft());
|
||||||
emit getIContextOwnAircraft()->changedAircraftCockpit(ownAircraft, IContextSimulator::InterfaceName());
|
emit getIContextOwnAircraft()->changedAircraftCockpit(ownAircraft, IContextSimulator::InterfaceName());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_changedRemoteAircraftModel(const CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator)
|
void CContextSimulator::xCtxChangedRemoteAircraftModel(const CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator)
|
||||||
{
|
{
|
||||||
if (CIdentifiable::isMyIdentifier(originator)) { return; }
|
if (CIdentifiable::isMyIdentifier(originator)) { return; }
|
||||||
if (!isSimulatorSimulating()) { return; }
|
if (!isSimulatorSimulating()) { return; }
|
||||||
m_simulatorPlugin.second->changeRemoteAircraftModel(aircraft);
|
m_simulatorPlugin.second->changeRemoteAircraftModel(aircraft);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_changedRemoteAircraftEnabled(const CSimulatedAircraft &aircraft)
|
void CContextSimulator::xCtxChangedRemoteAircraftEnabled(const CSimulatedAircraft &aircraft)
|
||||||
{
|
{
|
||||||
if (!isSimulatorSimulating()) { return; }
|
if (!isSimulatorSimulating()) { return; }
|
||||||
m_simulatorPlugin.second->changeRemoteAircraftEnabled(aircraft);
|
m_simulatorPlugin.second->changeRemoteAircraftEnabled(aircraft);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_networkConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
|
void CContextSimulator::xCtxNetworkConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
|
||||||
{
|
{
|
||||||
Q_UNUSED(from);
|
Q_UNUSED(from);
|
||||||
BLACK_VERIFY_X(getIContextNetwork(), Q_FUNC_INFO, "Missing network context");
|
BLACK_VERIFY_X(getIContextNetwork(), Q_FUNC_INFO, "Missing network context");
|
||||||
@@ -512,13 +512,13 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_addingRemoteAircraftFailed(const CSimulatedAircraft &remoteAircraft, const CStatusMessage &message)
|
void CContextSimulator::addingRemoteAircraftFailed(const CSimulatedAircraft &remoteAircraft, const CStatusMessage &message)
|
||||||
{
|
{
|
||||||
if (!isSimulatorSimulating()) { return; }
|
if (!isSimulatorSimulating()) { return; }
|
||||||
emit addingRemoteModelFailed(remoteAircraft, message);
|
emit this->addingRemoteModelFailed(remoteAircraft, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_updateSimulatorCockpitFromContext(const CSimulatedAircraft &ownAircraft, const CIdentifier &originator)
|
void CContextSimulator::xCtxUpdateSimulatorCockpitFromContext(const CSimulatedAircraft &ownAircraft, const CIdentifier &originator)
|
||||||
{
|
{
|
||||||
if (!isSimulatorSimulating()) { return; }
|
if (!isSimulatorSimulating()) { return; }
|
||||||
if (originator.getName().isEmpty() || originator == IContextSimulator::InterfaceName()) { return; }
|
if (originator.getName().isEmpty() || originator == IContextSimulator::InterfaceName()) { return; }
|
||||||
@@ -527,7 +527,7 @@ namespace BlackCore
|
|||||||
m_simulatorPlugin.second->updateOwnSimulatorCockpit(ownAircraft, originator);
|
m_simulatorPlugin.second->updateOwnSimulatorCockpit(ownAircraft, originator);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_updateSimulatorSelcalFromContext(const CSelcal &selcal, const CIdentifier &originator)
|
void CContextSimulator::xCtxUpdateSimulatorSelcalFromContext(const CSelcal &selcal, const CIdentifier &originator)
|
||||||
{
|
{
|
||||||
if (!isSimulatorSimulating()) { return; }
|
if (!isSimulatorSimulating()) { return; }
|
||||||
if (originator.getName().isEmpty() || originator == IContextSimulator::InterfaceName()) { return; }
|
if (originator.getName().isEmpty() || originator == IContextSimulator::InterfaceName()) { return; }
|
||||||
@@ -536,13 +536,13 @@ namespace BlackCore
|
|||||||
m_simulatorPlugin.second->updateOwnSimulatorSelcal(selcal, originator);
|
m_simulatorPlugin.second->updateOwnSimulatorSelcal(selcal, originator);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_networkRequestedNewAircraft(const CCallsign &callsign, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery)
|
void CContextSimulator::xCtxNetworkRequestedNewAircraft(const CCallsign &callsign, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery)
|
||||||
{
|
{
|
||||||
if (m_networkSessionId.isEmpty()) { return; }
|
if (m_networkSessionId.isEmpty()) { return; }
|
||||||
m_aircraftMatcher.evaluateStatisticsEntry(m_networkSessionId, callsign, aircraftIcao, airlineIcao, livery);
|
m_aircraftMatcher.evaluateStatisticsEntry(m_networkSessionId, callsign, aircraftIcao, airlineIcao, livery);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_relayStatusMessageToSimulator(const BlackMisc::CStatusMessage &message)
|
void CContextSimulator::relayStatusMessageToSimulator(const BlackMisc::CStatusMessage &message)
|
||||||
{
|
{
|
||||||
if (!isSimulatorSimulating()) { return; }
|
if (!isSimulatorSimulating()) { return; }
|
||||||
const CSimulatorMessagesSettings simMsg = m_messageSettings.getThreadLocal();
|
const CSimulatorMessagesSettings simMsg = m_messageSettings.getThreadLocal();
|
||||||
@@ -676,7 +676,7 @@ namespace BlackCore
|
|||||||
CSimulatedAircraft aircraft = getAircraftInRangeForCallsign(callsign);
|
CSimulatedAircraft aircraft = getAircraftInRangeForCallsign(callsign);
|
||||||
if (aircraft.getCallsign() != callsign) { return false; } // not found
|
if (aircraft.getCallsign() != callsign) { return false; } // not found
|
||||||
aircraft.setModel(aircraft.getNetworkModel());
|
aircraft.setModel(aircraft.getNetworkModel());
|
||||||
ps_addedRemoteAircraft(aircraft);
|
xCtxAddedRemoteAircraft(aircraft);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -695,7 +695,7 @@ namespace BlackCore
|
|||||||
m_weatherManager.requestWeatherGrid(weatherGrid, identifier);
|
m_weatherManager.requestWeatherGrid(weatherGrid, identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::ps_simulatorStarted(const CSimulatorPluginInfo &info)
|
void CContextSimulator::onSimulatorStarted(const CSimulatorPluginInfo &info)
|
||||||
{
|
{
|
||||||
stopSimulatorListeners();
|
stopSimulatorListeners();
|
||||||
loadSimulatorPlugin(info);
|
loadSimulatorPlugin(info);
|
||||||
|
|||||||
@@ -117,7 +117,9 @@ namespace BlackCore
|
|||||||
//! @}
|
//! @}
|
||||||
//! \copydoc IContextSimulator::parseCommandLine
|
//! \copydoc IContextSimulator::parseCommandLine
|
||||||
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
|
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
|
||||||
|
// ----------------------------- context interface -----------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
//! Register dot commands
|
//! Register dot commands
|
||||||
static void registerHelp()
|
static void registerHelp()
|
||||||
{
|
{
|
||||||
@@ -128,8 +130,6 @@ namespace BlackCore
|
|||||||
BlackMisc::CSimpleCommandParser::registerCommand({".ris parts on|off", "aircraft parts"});
|
BlackMisc::CSimpleCommandParser::registerCommand({".ris parts on|off", "aircraft parts"});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------- context interface -----------------------------
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! Constructor
|
//! Constructor
|
||||||
CContextSimulator(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime);
|
CContextSimulator(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime);
|
||||||
@@ -137,59 +137,58 @@ namespace BlackCore
|
|||||||
//! Register myself in DBus
|
//! Register myself in DBus
|
||||||
CContextSimulator *registerWithDBus(BlackMisc::CDBusServer *server);
|
CContextSimulator *registerWithDBus(BlackMisc::CDBusServer *server);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
// ------------ slots connected with network or other contexts ---------
|
// ------------ slots connected with network or other contexts ---------
|
||||||
//! \ingroup crosscontextslot
|
//! \ingroup crosscontextslot
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
//! Remote aircraft added
|
//! Remote aircraft added
|
||||||
void ps_addedRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft);
|
void xCtxAddedRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft);
|
||||||
|
|
||||||
//! Remove remote aircraft
|
//! Remove remote aircraft
|
||||||
void ps_removedRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign);
|
void xCtxRemovedRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign);
|
||||||
|
|
||||||
//! Changed remote aircraft model
|
//! Changed remote aircraft model
|
||||||
void ps_changedRemoteAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator);
|
void xCtxChangedRemoteAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator);
|
||||||
|
|
||||||
//! Enable / disable aircraft
|
//! Enable / disable aircraft
|
||||||
void ps_changedRemoteAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
void xCtxChangedRemoteAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||||
|
|
||||||
//! Network connection status
|
//! Network connection status
|
||||||
void ps_networkConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to);
|
void xCtxNetworkConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to);
|
||||||
|
|
||||||
//! Update simulator cockpit from context, because someone else has changed cockpit (e.g. GUI, 3rd party)
|
//! Update simulator cockpit from context, because someone else has changed cockpit (e.g. GUI, 3rd party)
|
||||||
void ps_updateSimulatorCockpitFromContext(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft, const BlackMisc::CIdentifier &originator);
|
void xCtxUpdateSimulatorCockpitFromContext(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft, const BlackMisc::CIdentifier &originator);
|
||||||
|
|
||||||
//! Update simulator SELCAL from context, because someone else has changed cockpit (e.g. GUI, 3rd party)
|
//! Update simulator SELCAL from context, because someone else has changed cockpit (e.g. GUI, 3rd party)
|
||||||
void ps_updateSimulatorSelcalFromContext(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator);
|
void xCtxUpdateSimulatorSelcalFromContext(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator);
|
||||||
|
|
||||||
//! Raw data when a new aircraft was requested, used for statistics
|
//! Raw data when a new aircraft was requested, used for statistics
|
||||||
void ps_networkRequestedNewAircraft(const BlackMisc::Aviation::CCallsign &callsign, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery);
|
void xCtxNetworkRequestedNewAircraft(const BlackMisc::Aviation::CCallsign &callsign, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery);
|
||||||
|
|
||||||
|
//! Text message received
|
||||||
|
void xCtxTextMessagesReceived(const BlackMisc::Network::CTextMessageList &textMessages);
|
||||||
//! @}
|
//! @}
|
||||||
// ------------ slots connected with network or other contexts ---------
|
// ------------ slots connected with network or other contexts ---------
|
||||||
|
|
||||||
//! Handle new connection status of simulator
|
//! Handle new connection status of simulator
|
||||||
void ps_onSimulatorStatusChanged(ISimulator::SimulatorStatus status);
|
void onSimulatorStatusChanged(ISimulator::SimulatorStatus status);
|
||||||
|
|
||||||
//! Model set from model set loader changed
|
//! Model set from model set loader changed
|
||||||
void ps_modelSetChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
void onModelSetChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||||
|
|
||||||
//! Text message received
|
|
||||||
void ps_textMessagesReceived(const BlackMisc::Network::CTextMessageList &textMessages);
|
|
||||||
|
|
||||||
//! Listener reports the simulator has started
|
//! Listener reports the simulator has started
|
||||||
void ps_simulatorStarted(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
|
void onSimulatorStarted(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
|
||||||
|
|
||||||
//! Simulator has changed cockpit
|
//! Simulator has changed cockpit
|
||||||
void ps_cockpitChangedFromSimulator(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft);
|
void onCockpitChangedFromSimulator(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft);
|
||||||
|
|
||||||
//! Failed adding remote aircraft
|
//! Failed adding remote aircraft
|
||||||
void ps_addingRemoteAircraftFailed(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, const BlackMisc::CStatusMessage &message);
|
void addingRemoteAircraftFailed(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, const BlackMisc::CStatusMessage &message);
|
||||||
|
|
||||||
//! Relay status message to simulator under consideration of settings
|
//! Relay status message to simulator under consideration of settings
|
||||||
void ps_relayStatusMessageToSimulator(const BlackMisc::CStatusMessage &message);
|
void relayStatusMessageToSimulator(const BlackMisc::CStatusMessage &message);
|
||||||
|
|
||||||
private:
|
|
||||||
//! Handle a change in enabled simulators
|
//! Handle a change in enabled simulators
|
||||||
void changeEnabledSimulators();
|
void changeEnabledSimulators();
|
||||||
|
|
||||||
|
|||||||
@@ -194,31 +194,31 @@ namespace BlackCore
|
|||||||
Q_ASSERT_X(this->getCContextNetwork()->airspace(), Q_FUNC_INFO, "No airspace object");
|
Q_ASSERT_X(this->getCContextNetwork()->airspace(), Q_FUNC_INFO, "No airspace object");
|
||||||
|
|
||||||
c = connect(m_contextNetwork, &IContextNetwork::textMessagesReceived,
|
c = connect(m_contextNetwork, &IContextNetwork::textMessagesReceived,
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_textMessagesReceived);
|
this->getCContextSimulator(), &CContextSimulator::xCtxTextMessagesReceived);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
|
|
||||||
// use readyForModelMatching instead of CAirspaceMonitor::addedAircraft, as it contains client information
|
// use readyForModelMatching instead of CAirspaceMonitor::addedAircraft, as it contains client information
|
||||||
// ready for model matching is sent delayed when all information are available
|
// ready for model matching is sent delayed when all information are available
|
||||||
c = connect(m_contextNetwork, &IContextNetwork::readyForModelMatching,
|
c = connect(m_contextNetwork, &IContextNetwork::readyForModelMatching,
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_addedRemoteAircraft);
|
this->getCContextSimulator(), &CContextSimulator::xCtxAddedRemoteAircraft);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(m_contextNetwork, &IContextNetwork::removedAircraft,
|
c = connect(m_contextNetwork, &IContextNetwork::removedAircraft,
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_removedRemoteAircraft);
|
this->getCContextSimulator(), &CContextSimulator::xCtxRemovedRemoteAircraft);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(m_contextNetwork, &IContextNetwork::changedRemoteAircraftModel,
|
c = connect(m_contextNetwork, &IContextNetwork::changedRemoteAircraftModel,
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_changedRemoteAircraftModel);
|
this->getCContextSimulator(), &CContextSimulator::xCtxChangedRemoteAircraftModel);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(m_contextNetwork, &IContextNetwork::changedRemoteAircraftEnabled,
|
c = connect(m_contextNetwork, &IContextNetwork::changedRemoteAircraftEnabled,
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_changedRemoteAircraftEnabled);
|
this->getCContextSimulator(), &CContextSimulator::xCtxChangedRemoteAircraftEnabled);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(m_contextNetwork, &IContextNetwork::connectionStatusChanged,
|
c = connect(m_contextNetwork, &IContextNetwork::connectionStatusChanged,
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_networkConnectionStatusChanged);
|
this->getCContextSimulator(), &CContextSimulator::xCtxNetworkConnectionStatusChanged);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(this->getCContextNetwork()->airspace(), &CAirspaceMonitor::requestedNewAircraft,
|
c = connect(this->getCContextNetwork()->airspace(), &CAirspaceMonitor::requestedNewAircraft,
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_networkRequestedNewAircraft);
|
this->getCContextSimulator(), &CContextSimulator::xCtxNetworkRequestedNewAircraft);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(this->getCContextSimulator(), &CContextSimulator::renderRestrictionsChanged,
|
c = connect(this->getCContextSimulator(), &CContextSimulator::renderRestrictionsChanged,
|
||||||
this->getCContextNetwork(), &CContextNetwork::simulatorRenderRestrictionsChanged);
|
this->getCContextNetwork(), &CContextNetwork::xCtxSimulatorRenderRestrictionsChanged);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,13 +226,13 @@ namespace BlackCore
|
|||||||
if (m_contextOwnAircraft && m_contextOwnAircraft->isUsingImplementingObject())
|
if (m_contextOwnAircraft && m_contextOwnAircraft->isUsingImplementingObject())
|
||||||
{
|
{
|
||||||
c = connect(m_contextOwnAircraft, &IContextOwnAircraft::changedAircraftCockpit,
|
c = connect(m_contextOwnAircraft, &IContextOwnAircraft::changedAircraftCockpit,
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_updateSimulatorCockpitFromContext);
|
this->getCContextSimulator(), &CContextSimulator::xCtxUpdateSimulatorCockpitFromContext);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(m_contextOwnAircraft, &IContextOwnAircraft::changedSelcal,
|
c = connect(m_contextOwnAircraft, &IContextOwnAircraft::changedSelcal,
|
||||||
this->getCContextSimulator(), &CContextSimulator::ps_updateSimulatorSelcalFromContext);
|
this->getCContextSimulator(), &CContextSimulator::xCtxUpdateSimulatorSelcalFromContext);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
c = connect(this->getCContextSimulator(), &CContextSimulator::ownAircraftModelChanged,
|
c = connect(this->getCContextSimulator(), &CContextSimulator::ownAircraftModelChanged,
|
||||||
this->getCContextOwnAircraft(), &CContextOwnAircraft::changedSimulatorModel);
|
this->getCContextOwnAircraft(), &CContextOwnAircraft::xCtxChangedSimulatorModel);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,7 +245,7 @@ namespace BlackCore
|
|||||||
if (m_contextNetwork && m_contextOwnAircraft && m_contextNetwork->isUsingImplementingObject() && m_contextOwnAircraft->isUsingImplementingObject())
|
if (m_contextNetwork && m_contextOwnAircraft && m_contextNetwork->isUsingImplementingObject() && m_contextOwnAircraft->isUsingImplementingObject())
|
||||||
{
|
{
|
||||||
c = connect(m_contextNetwork, &IContextNetwork::changedAtcStationOnlineConnectionStatus,
|
c = connect(m_contextNetwork, &IContextNetwork::changedAtcStationOnlineConnectionStatus,
|
||||||
this->getCContextOwnAircraft(), &CContextOwnAircraft::changedAtcStationOnlineConnectionStatus);
|
this->getCContextOwnAircraft(), &CContextOwnAircraft::xCtxChangedAtcStationOnlineConnectionStatus);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
times.insert("Post setup, connects network", time.restart());
|
times.insert("Post setup, connects network", time.restart());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user