diff --git a/src/blackcore/airspaceanalyzer.cpp b/src/blackcore/airspaceanalyzer.cpp index ce3ed1a93..b803f634e 100644 --- a/src/blackcore/airspaceanalyzer.cpp +++ b/src/blackcore/airspaceanalyzer.cpp @@ -63,7 +63,7 @@ namespace BlackCore Q_ASSERT(c); c = connect(airspaceMonitorParent, &CAirspaceMonitor::removedAircraft, this, &CAirspaceAnalyzer::watchdogRemoveAircraftCallsign); Q_ASSERT(c); - c = connect(airspaceMonitorParent, &CAirspaceMonitor::changedAtcStationOnlineConnectionStatus, this, &CAirspaceAnalyzer::onChangedAtcStationOnlineConnectionStatus); + c = connect(airspaceMonitorParent, &CAirspaceMonitor::atcStationDisconnected, this, &CAirspaceAnalyzer::onAtcStationDisconnected); Q_ASSERT(c); // -------------------- @@ -97,17 +97,10 @@ namespace BlackCore this->watchdogTouchAircraftCallsign(situation); } - void CAirspaceAnalyzer::onChangedAtcStationOnlineConnectionStatus(const CAtcStation &station, bool isConnected) + void CAirspaceAnalyzer::onAtcStationDisconnected(const CAtcStation &station) { const CCallsign cs = station.getCallsign(); - if (isConnected) - { - m_atcCallsignTimestamps[cs] = QDateTime::currentMSecsSinceEpoch(); - } - else - { - this->watchdogRemoveAtcCallsign(cs); - } + this->watchdogRemoveAtcCallsign(cs); } void CAirspaceAnalyzer::watchdogTouchAircraftCallsign(const CAircraftSituation &situation) diff --git a/src/blackcore/airspaceanalyzer.h b/src/blackcore/airspaceanalyzer.h index 49d248211..6c926a3f7 100644 --- a/src/blackcore/airspaceanalyzer.h +++ b/src/blackcore/airspaceanalyzer.h @@ -108,8 +108,8 @@ namespace BlackCore //! Network position update void onNetworkPositionUpdate(const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CTransponder &transponder); - //! ATC stations online - void onChangedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool isConnected); + //! ATC station disconnected + void onAtcStationDisconnected(const BlackMisc::Aviation::CAtcStation &station); //! Run a check void onTimeout(); diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index 531dd4875..78f501218 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -696,8 +696,6 @@ namespace BlackCore m_atcStationsOnline.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftSituation()); emit this->changedAtcStationsOnline(); - // Remark: this->changedAtcStationOnlineConnectionStatus - // will be triggered in onAtisVoiceRoomReceived } else { @@ -722,7 +720,7 @@ namespace BlackCore const CAtcStation removedStation = m_atcStationsOnline.findFirstByCallsign(callsign); m_atcStationsOnline.removeByCallsign(callsign); emit this->changedAtcStationsOnline(); - emit this->changedAtcStationOnlineConnectionStatus(removedStation, false); + emit this->atcStationDisconnected(removedStation); } } diff --git a/src/blackcore/airspacemonitor.h b/src/blackcore/airspacemonitor.h index 4b46cb217..719180848 100644 --- a/src/blackcore/airspacemonitor.h +++ b/src/blackcore/airspacemonitor.h @@ -180,8 +180,8 @@ namespace BlackCore //! Online ATC stations were changed void changedAtcStationsOnline(); - //! Connection status of an ATC station was changed - void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool isConnected); + //! ATC station disconnected + void atcStationDisconnected(const BlackMisc::Aviation::CAtcStation &station); //! Raw data as received from network //! \remark used for statistics diff --git a/src/blackcore/context/contextnetwork.h b/src/blackcore/context/contextnetwork.h index 195167f81..80b3baeea 100644 --- a/src/blackcore/context/contextnetwork.h +++ b/src/blackcore/context/contextnetwork.h @@ -136,8 +136,8 @@ namespace BlackCore::Context //! Changed gnd. flag capability void changedGndFlagCapability(const BlackMisc::Simulation::CSimulatedAircraft &aircraft); - //! Connection status changed for online station - void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &atcStation, bool connected); + //! ATC station disconnected + void atcStationDisconnected(const BlackMisc::Aviation::CAtcStation &atcStation); //! User has been kicked from network void kicked(const QString &kickMessage); diff --git a/src/blackcore/context/contextnetworkimpl.cpp b/src/blackcore/context/contextnetworkimpl.cpp index 12f402a84..ead99e4e4 100644 --- a/src/blackcore/context/contextnetworkimpl.cpp +++ b/src/blackcore/context/contextnetworkimpl.cpp @@ -97,7 +97,7 @@ namespace BlackCore::Context this->getRuntime()->getCContextSimulator(), m_fsdClient, this); m_fsdClient->setClientProvider(m_airspace); - connect(m_airspace, &CAirspaceMonitor::changedAtcStationOnlineConnectionStatus, this, &CContextNetwork::changedAtcStationOnlineConnectionStatus, Qt::QueuedConnection); + connect(m_airspace, &CAirspaceMonitor::atcStationDisconnected, this, &CContextNetwork::atcStationDisconnected, Qt::QueuedConnection); connect(m_airspace, &CAirspaceMonitor::changedAtcStationsOnline, this, &CContextNetwork::changedAtcStationsOnline, Qt::QueuedConnection); connect(m_airspace, &CAirspaceMonitor::changedAircraftInRange, this, &CContextNetwork::changedAircraftInRange, Qt::QueuedConnection); connect(m_airspace, &CAirspaceMonitor::removedAircraft, this, &IContextNetwork::removedAircraft, Qt::QueuedConnection); // DBus diff --git a/src/blackcore/context/contextnetworkproxy.cpp b/src/blackcore/context/contextnetworkproxy.cpp index 673753b37..8f6126d57 100644 --- a/src/blackcore/context/contextnetworkproxy.cpp +++ b/src/blackcore/context/contextnetworkproxy.cpp @@ -52,7 +52,7 @@ namespace BlackCore::Context "changedAircraftInRange", this, SIGNAL(changedAircraftInRange())); Q_ASSERT(s); s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), - "changedAtcStationOnlineConnectionStatus", this, SIGNAL(changedAtcStationOnlineConnectionStatus(BlackMisc::Aviation::CAtcStation, bool))); + "atcStationDisconnected", this, SIGNAL(atcStationDisconnected(BlackMisc::Aviation::CAtcStation))); Q_ASSERT(s); s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), "changedAircraftInRangeDigest", this, SIGNAL(changedAircraftInRangeDigest())); diff --git a/src/blackcore/context/contextownaircraftimpl.cpp b/src/blackcore/context/contextownaircraftimpl.cpp index b877efe9b..37c8903dc 100644 --- a/src/blackcore/context/contextownaircraftimpl.cpp +++ b/src/blackcore/context/contextownaircraftimpl.cpp @@ -449,9 +449,8 @@ namespace BlackCore::Context return true; } - void CContextOwnAircraft::xCtxChangedAtcStationOnlineConnectionStatus(const CAtcStation &atcStation, bool connected) + void CContextOwnAircraft::xCtxAtcStationDisconnected(const CAtcStation &atcStation) { - Q_UNUSED(connected) Q_UNUSED(atcStation) this->evaluateComStations(true); } diff --git a/src/blackcore/context/contextownaircraftimpl.h b/src/blackcore/context/contextownaircraftimpl.h index 14393942a..0bd9a1f7d 100644 --- a/src/blackcore/context/contextownaircraftimpl.h +++ b/src/blackcore/context/contextownaircraftimpl.h @@ -218,9 +218,9 @@ namespace BlackCore BlackMisc::CSetting m_currentNetworkServer { this }; - //! Station has been changed, needed to tune in/out voice room + //! Station has disconnected //! \ingroup crosscontextfunction - void xCtxChangedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &atcStation, bool connected); + void xCtxAtcStationDisconnected(const BlackMisc::Aviation::CAtcStation &atcStation); //! Simulator model has been changed //! \ingroup crosscontextfunction diff --git a/src/blackcore/corefacade.cpp b/src/blackcore/corefacade.cpp index 7797e6ee3..8b68ec63c 100644 --- a/src/blackcore/corefacade.cpp +++ b/src/blackcore/corefacade.cpp @@ -298,8 +298,8 @@ namespace BlackCore // -> in the core or an all local implementation if (m_contextNetwork && m_contextOwnAircraft && m_contextNetwork->isUsingImplementingObject() && m_contextOwnAircraft->isUsingImplementingObject()) { - c = connect(m_contextNetwork, &IContextNetwork::changedAtcStationOnlineConnectionStatus, - this->getCContextOwnAircraft(), &CContextOwnAircraft::xCtxChangedAtcStationOnlineConnectionStatus); + c = connect(m_contextNetwork, &IContextNetwork::atcStationDisconnected, + this->getCContextOwnAircraft(), &CContextOwnAircraft::xCtxAtcStationDisconnected); Q_ASSERT(c); times.insert("Post setup, connects network", time.restart()); } diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index 3db63e941..50ea06d59 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -113,7 +113,7 @@ namespace BlackGui::Components if (sGui) { connect(sGui->getIContextNetwork(), &IContextNetwork::changedAtcStationsOnlineDigest, this, &CAtcStationComponent::changedAtcStationsOnline, Qt::QueuedConnection); - connect(sGui->getIContextNetwork(), &IContextNetwork::changedAtcStationOnlineConnectionStatus, this, &CAtcStationComponent::changedAtcStationOnlineConnectionStatus, Qt::QueuedConnection); + connect(sGui->getIContextNetwork(), &IContextNetwork::atcStationDisconnected, this, &CAtcStationComponent::atcStationDisconnected, Qt::QueuedConnection); connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CAtcStationComponent::connectionStatusChanged, Qt::QueuedConnection); } @@ -245,10 +245,10 @@ namespace BlackGui::Components } } - void CAtcStationComponent::changedAtcStationOnlineConnectionStatus(const CAtcStation &station, bool added) + void CAtcStationComponent::atcStationDisconnected(const CAtcStation &station) { // trick here is, we want to display a station ASAP - ui->tvp_AtcStationsOnline->changedAtcStationConnectionStatus(station, added); + ui->tvp_AtcStationsOnline->changedAtcStationConnectionStatus(station, false); } void CAtcStationComponent::getMetarAsEntered() diff --git a/src/blackgui/components/atcstationcomponent.h b/src/blackgui/components/atcstationcomponent.h index 1893bbdf6..25b20e1af 100644 --- a/src/blackgui/components/atcstationcomponent.h +++ b/src/blackgui/components/atcstationcomponent.h @@ -87,8 +87,8 @@ namespace BlackGui //! Set timestampd and call update void forceUpdate(); - //! \copydoc Models::CAtcStationListModel::changedAtcStationConnectionStatus - void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool added); + //! ATC station disconnected + void atcStationDisconnected(const BlackMisc::Aviation::CAtcStation &station); //! Get all METARs void getMetarAsEntered();