diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index c9d075ef1..3871100d5 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -75,10 +75,9 @@ namespace BlackCore this->setObjectName("CAirspaceMonitor"); this->enableReverseLookupMessages(sApp->isDeveloperFlagSet() || CBuildConfig::isLocalDeveloperDebugBuild() ? RevLogEnabled : RevLogEnabledSimplified); - connect(m_fsdClient, &CFSDClient::atcDataUpdateReceived, this, &CAirspaceMonitor::onAtcPositionUpdate); // FSD TODO + connect(m_fsdClient, &CFSDClient::atcDataUpdateReceived, this, &CAirspaceMonitor::onAtcPositionUpdate); connect(m_fsdClient, &CFSDClient::atisReplyReceived, this, &CAirspaceMonitor::onAtisReceived); - connect(m_fsdClient, &CFSDClient::atisVoiceRoomReplyReceived, this, &CAirspaceMonitor::onAtisVoiceRoomReceived); connect(m_fsdClient, &CFSDClient::atisLogoffTimeReplyReceived, this, &CAirspaceMonitor::onAtisLogoffTimeReceived); connect(m_fsdClient, &CFSDClient::flightPlanReceived, this, &CAirspaceMonitor::onFlightPlanReceived); connect(m_fsdClient, &CFSDClient::realNameResponseReceived, this, &CAirspaceMonitor::onRealNameReplyReceived); @@ -94,11 +93,14 @@ namespace BlackCore connect(m_fsdClient, &CFSDClient::aircraftConfigReceived, this, &CAirspaceMonitor::onAircraftConfigReceived); connect(m_fsdClient, &CFSDClient::connectionStatusChanged, this, &CAirspaceMonitor::onConnectionStatusChanged); + // No longer existing with AFV + // connect(m_fsdClient, &CFSDClient::atisVoiceRoomReplyReceived, this, &CAirspaceMonitor::onAtisVoiceRoomReceived); + // AutoConnection: this should also avoid race conditions by updating the bookings Q_ASSERT_X(sApp && sApp->getWebDataServices(), Q_FUNC_INFO, "Missing data reader"); // optional readers - if (sApp->getWebDataServices()->getBookingReader()) + if (sApp && sApp->getWebDataServices()->getBookingReader()) { connect(sApp->getWebDataServices()->getBookingReader(), &CVatsimBookingReader::atcBookingsRead, this, &CAirspaceMonitor::onReceivedAtcBookings); connect(sApp->getWebDataServices()->getBookingReader(), &CVatsimBookingReader::atcBookingsReadUnchanged, this, &CAirspaceMonitor::onReadUnchangedAtcBookings); @@ -734,7 +736,11 @@ namespace BlackCore { Q_ASSERT(CThreadUtils::isCurrentThreadObjectThread(this)); if (!this->isConnectedAndNotShuttingDown()) { return; } + return; + Q_UNUSED(url) + Q_UNUSED(callsign) + /** // URL const QString trimmedUrl = url.trimmed(); CPropertyIndexVariantMap vm({ CAtcStation::IndexVoiceRoom, CVoiceRoom::IndexUrl }, trimmedUrl); @@ -754,6 +760,7 @@ namespace BlackCore vm = CPropertyIndexVariantMap(CClient::IndexVoiceCapabilities, CVariant::from(CVoiceCapabilities::fromVoiceCapabilities(CVoiceCapabilities::Voice))); this->updateOrAddClient(callsign, vm, false); } + **/ } void CAirspaceMonitor::onAtisLogoffTimeReceived(const CCallsign &callsign, const QString &zuluTime) diff --git a/src/blackcore/airspacemonitor.h b/src/blackcore/airspacemonitor.h index cb4f82c26..554a09ba5 100644 --- a/src/blackcore/airspacemonitor.h +++ b/src/blackcore/airspacemonitor.h @@ -257,9 +257,9 @@ namespace BlackCore BlackMisc::CSettingReadOnly m_matchingSettings { this }; //!< settings QQueue m_queryAtis; //!< query the ATIS QQueue m_queryPilot; //!< query the pilot data - Fsd::CFSDClient *m_fsdClient = nullptr; //!< corresponding network interface - CAirspaceAnalyzer *m_analyzer = nullptr; //!< owned analyzer - bool m_bookingsRequested = false; //!< bookings have been requested, it can happen we receive an BlackCore::Vatsim::CVatsimBookingReader::atcBookingsReadUnchanged signal + Fsd::CFSDClient *m_fsdClient = nullptr; //!< corresponding network interface + CAirspaceAnalyzer *m_analyzer = nullptr; //!< owned analyzer + bool m_bookingsRequested = false; //!< bookings have been requested, it can happen we receive an BlackCore::Vatsim::CVatsimBookingReader::atcBookingsReadUnchanged signal QTimer m_processTimer; static constexpr int ProcessInterval = 50; // in ms @@ -377,7 +377,6 @@ namespace BlackCore void onFlightPlanReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CFlightPlan &flightPlan); void onAtcControllerDisconnected(const BlackMisc::Aviation::CCallsign &callsign); void onAtisReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CInformationMessage &atisMessage); - void onAtisVoiceRoomReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &url); void onAtisLogoffTimeReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &zuluTime); void onIcaoCodesReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &aircraftIcaoDesignator, const QString &airlineIcaoDesignator, const QString &livery); void onPilotDisconnected(const BlackMisc::Aviation::CCallsign &callsign); @@ -388,6 +387,9 @@ namespace BlackCore void onAircraftConfigReceived(const BlackMisc::Aviation::CCallsign &callsign, const QJsonObject &jsonObject, qint64 currentOffsetMs); void onAircraftInterimUpdateReceived(const BlackMisc::Aviation::CAircraftSituation &situation); void onConnectionStatusChanged(BlackMisc::Network::CConnectionStatus oldStatus, BlackMisc::Network::CConnectionStatus newStatus); + + //! \deprecated + void onAtisVoiceRoomReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &url); }; } // namespace diff --git a/src/blackgui/models/atcstationlistmodel.cpp b/src/blackgui/models/atcstationlistmodel.cpp index 2a1e3a35b..634cc1719 100644 --- a/src/blackgui/models/atcstationlistmodel.cpp +++ b/src/blackgui/models/atcstationlistmodel.cpp @@ -68,6 +68,7 @@ namespace BlackGui CColumn col("type", CAtcStation::IndexIcon); col.setSortPropertyIndex({ CAtcStation::IndexCallsign, CCallsign::IndexSuffix }); m_columns.addColumn(col); + m_columns.addColumn(CColumn("xc.", "AFV cross coupled", CAtcStation::IndexIsAfvCrossCoupled, new CBoolIconFormatter("AFV cross coupled", "not coupled"))); m_columns.addColumn(CColumn("distance", CAtcStation::IndexRelativeDistance, new CAirspaceDistanceFormatter())); m_columns.addColumn(CColumn("frequency", CAtcStation::IndexFrequency, new CComFrequencyFormatter())); m_columns.addColumn(CColumn("r.", "in range", CAtcStation::IndexIsInRange, new CBoolIconFormatter("in range", "outside range"))); diff --git a/src/blackmisc/aviation/atcstation.cpp b/src/blackmisc/aviation/atcstation.cpp index a4c456276..6b43d9bd3 100644 --- a/src/blackmisc/aviation/atcstation.cpp +++ b/src/blackmisc/aviation/atcstation.cpp @@ -84,6 +84,7 @@ namespace BlackMisc { m_callsign = callsign; m_controller.setCallsign(callsign); + m_isAfvCrossCoupled = callsign.getStringAsSet().startsWith('*'); } QString CAtcStation::getCallsignAndControllerRealName() const