diff --git a/resources/share/shared/bootstrap/bootstrap.json b/resources/share/shared/bootstrap/bootstrap.json index 48907f080..a1a28efdf 100644 --- a/resources/share/shared/bootstrap/bootstrap.json +++ b/resources/share/shared/bootstrap/bootstrap.json @@ -36,9 +36,6 @@ ] }, "timestampMSecsSinceEpoch": 1559602257000, - "vatsimBookingsUrl": { - "url": "http://vatbook.euroutepro.com/xml2.php" - }, "vatsimDataFileUrls": { "containerbase": [ { diff --git a/samples/blackmisc/sampleschangeobject.cpp b/samples/blackmisc/sampleschangeobject.cpp index 6b38e7395..70e2ff1f4 100644 --- a/samples/blackmisc/sampleschangeobject.cpp +++ b/samples/blackmisc/sampleschangeobject.cpp @@ -31,18 +31,14 @@ namespace BlackSample int CSamplesChangeObject::samples() { // ATC station - const QDateTime dtFrom = QDateTime::currentDateTimeUtc(); - const QDateTime dtUntil = dtFrom.addSecs(60 * 60); // 1 hour - const QDateTime dtFrom2 = dtUntil; - const QDateTime dtUntil2 = dtUntil.addSecs(60 * 60); const CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() }); const CAtcStation station1(CCallsign("eddm_twr"), CUser("123456", "Joe Doe"), CFrequency(118.7, CFrequencyUnit::MHz()), - geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil); + geoPos, CLength(50, CLengthUnit::km()), false); const CAtcStation station2(station1); const CAtcStation station3(CCallsign("eddm_app"), CUser("654321", "Jen Doe"), CFrequency(120.7, CFrequencyUnit::MHz()), - geoPos, CLength(100, CLengthUnit::km()), false, dtFrom2, dtUntil2); + geoPos, CLength(100, CLengthUnit::km()), false); Q_ASSERT_X(station1 == station2, Q_FUNC_INFO, "Unequal stations"); diff --git a/samples/blackmisc/samplescontainer.cpp b/samples/blackmisc/samplescontainer.cpp index c8ffa01ee..65f4d270f 100644 --- a/samples/blackmisc/samplescontainer.cpp +++ b/samples/blackmisc/samplescontainer.cpp @@ -56,7 +56,7 @@ namespace BlackSample qDebug() << "-- find by:"; qDebug() << atcListFind.toQString(); - CAtcStationList atcListSort = atcList.sortedBy(&CAtcStation::getBookedFromUtc, &CAtcStation::getCallsign, &CAtcStation::getControllerRealName); + CAtcStationList atcListSort = atcList.sortedBy(&CAtcStation::getCallsign, &CAtcStation::getControllerRealName); qDebug() << "-- sort by:"; qDebug() << atcListSort.toQString(); diff --git a/samples/blackmisc/samplesperformance.cpp b/samples/blackmisc/samplesperformance.cpp index 827b8dd18..b25107deb 100644 --- a/samples/blackmisc/samplesperformance.cpp +++ b/samples/blackmisc/samplesperformance.cpp @@ -852,8 +852,7 @@ namespace BlackSample r.append(station.propertyByIndex(CPropertyIndex { CAtcStation::IndexPosition, CCoordinateGeodetic::IndexLatitudeAsString }).toString()); r.append(station.propertyByIndex(CPropertyIndex { CAtcStation::IndexPosition, CCoordinateGeodetic::IndexLongitudeAsString }).toString()); r.append(station.propertyByIndex(CPropertyIndex { CAtcStation::IndexRelativeDistance, CLength::IndexValueRounded2DigitsWithUnit }).toString()); - r.append(station.propertyByIndex(CPropertyIndex { CAtcStation::IndexBookedFrom }).toDateTime().toString("yyyy-MM-dd hh:mm")); - r.append(station.propertyByIndex(CPropertyIndex { CAtcStation::IndexBookedUntil }).toDateTime().toString("yyyy-MM-dd hh:mm")); + r.append(station.propertyByIndex(CPropertyIndex { CAtcStation::IndexLogoffTime }).toDateTime().toString("yyyy-MM-dd hh:mm")); } else { @@ -862,8 +861,7 @@ namespace BlackSample r.append(station.getPosition().latitudeAsString()); r.append(station.getPosition().longitudeAsString()); r.append(station.getRelativeDistance().toQString(true)); - r.append(station.getBookedFromUtc().toString("yyyy-MM-dd hh:mm")); - r.append(station.getBookedUntilUtc().toString("yyyy-MM-dd hh:mm")); + r.append(station.getLogoffTimeUtc().toString("yyyy-MM-dd hh:mm")); } return r; } diff --git a/samples/blackmiscquantities/samplesaviation.cpp b/samples/blackmiscquantities/samplesaviation.cpp index 8111a09e1..9d7325a2d 100644 --- a/samples/blackmiscquantities/samplesaviation.cpp +++ b/samples/blackmiscquantities/samplesaviation.cpp @@ -80,7 +80,7 @@ namespace BlackSample CAtcStationList atcList = CTestData::getAtcStations(); atcList.push_back(CTestData::getAtcStations()); atcList = atcList.findBy(&CAtcStation::getCallsign, "eddm_twr", &CAtcStation::getFrequency, CFrequency(118.7, CFrequencyUnit::MHz())); - atcList = atcList.sortedBy(&CAtcStation::getBookedFromUtc, &CAtcStation::getCallsign, &CAtcStation::getControllerRealName); + atcList = atcList.sortedBy(&CAtcStation::getCallsign, &CAtcStation::getControllerRealName); out << atcList << Qt::endl; out << "-----------------------------------------------" << Qt::endl; diff --git a/scripts/swift.imp b/scripts/swift.imp index a2d754aac..d88d2c3d3 100644 --- a/scripts/swift.imp +++ b/scripts/swift.imp @@ -480,7 +480,6 @@ { include: [ "\"pluginmanagerweatherdata.h\"", "private", "\"blackcore/pluginmanagerweatherdata.h\"", "public" ] }, { include: [ "\"contextnetwork.h\"", "private", "\"blackcore/contextnetwork.h\"", "public" ] }, { include: [ "\"corefacadeconfig.h\"", "private", "\"blackcore/corefacadeconfig.h\"", "public" ] }, - { include: [ "\"vatsimbookingreader.h\"", "private", "\"blackcore/vatsimbookingreader.h\"", "public" ] }, { include: [ "\"airspaceanalyzer.h\"", "private", "\"blackcore/airspaceanalyzer.h\"", "public" ] }, { include: [ "\"actionbind.h\"", "private", "\"blackcore/actionbind.h\"", "public" ] }, { include: [ "\"contextapplicationproxy.h\"", "private", "\"blackcore/contextapplicationproxy.h\"", "public" ] }, diff --git a/src/blackcore/CMakeLists.txt b/src/blackcore/CMakeLists.txt index 517900e89..c427a1935 100644 --- a/src/blackcore/CMakeLists.txt +++ b/src/blackcore/CMakeLists.txt @@ -188,8 +188,6 @@ add_library(core SHARED fsd/visualpilotdataperiodic.h # VATSIM - vatsim/vatsimbookingreader.cpp - vatsim/vatsimbookingreader.h vatsim/vatsimdatafilereader.cpp vatsim/vatsimdatafilereader.h vatsim/vatsimmetarreader.cpp diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index de8e6f4d1..f4f326509 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 #include "blackcore/airspacemonitor.h" -#include "blackcore/vatsim/vatsimbookingreader.h" #include "blackcore/vatsim/vatsimdatafilereader.h" #include "blackcore/airspaceanalyzer.h" #include "blackcore/aircraftmatcher.h" @@ -94,13 +93,6 @@ namespace BlackCore // AutoConnection: this should also avoid race conditions by updating the bookings Q_ASSERT_X(sApp && sApp->hasWebDataServices(), Q_FUNC_INFO, "Missing data reader"); - // optional readers - if (sApp && sApp->getWebDataServices()->getBookingReader()) - { - connect(sApp->getWebDataServices()->getBookingReader(), &CVatsimBookingReader::atcBookingsRead, this, &CAirspaceMonitor::onReceivedAtcBookings); - connect(sApp->getWebDataServices()->getBookingReader(), &CVatsimBookingReader::atcBookingsReadUnchanged, this, &CAirspaceMonitor::onReadUnchangedAtcBookings); - } - if (this->supportsVatsimDataFile()) { connect(sApp->getWebDataServices()->getVatsimDataFileReader(), &CVatsimDataFileReader::dataFileRead, this, &CAirspaceMonitor::onReceivedVatsimDataFile); @@ -211,12 +203,6 @@ namespace BlackCore return m_atcStationsOnline; } - CAtcStationList CAirspaceMonitor::getAtcStationsBookedRecalculated() - { - m_atcStationsBooked.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftSituation()); - return m_atcStationsBooked; - } - CUserList CAirspaceMonitor::getUsers() const { CUserList users; @@ -332,13 +318,6 @@ namespace BlackCore } } - void CAirspaceMonitor::requestAtcBookingsUpdate() - { - if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return; } - sApp->getWebDataServices()->readInBackground(BlackMisc::Network::CEntityFlags::BookingEntity); - m_bookingsRequested = true; - } - bool CAirspaceMonitor::enableAnalyzer(bool enable) { if (!this->analyzer()) { return false; } @@ -484,8 +463,7 @@ namespace BlackCore // very likely and ATC callsign const CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({ CAtcStation::IndexController, CUser::IndexRealName }, rn); const int c1 = this->updateOnlineStation(callsign, vm, false, true); - const int c2 = this->updateBookedStation(callsign, vm, false, true); - wasAtc = c1 > 0 || c2 > 0; + wasAtc = c1 > 0; } if (!wasAtc) @@ -552,36 +530,6 @@ namespace BlackCore this->removeReverseLookupMessages(callsign); } - void CAirspaceMonitor::onReceivedAtcBookings(const CAtcStationList &bookedStations) - { - Q_ASSERT(CThreadUtils::isInThisThread(this)); - if (bookedStations.isEmpty()) - { - m_atcStationsBooked.clear(); - } - else - { - CAtcStationList newBookedStations(bookedStations); // modifyable copy - for (CAtcStation &bookedStation : newBookedStations) - { - // exchange booking and online data, both sides are updated - m_atcStationsOnline.synchronizeWithBookedStation(bookedStation); - } - m_atcStationsBooked = newBookedStations; - } - m_bookingsRequested = false; // we already emit here - m_atcStationsBooked.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftSituation()); - - emit this->changedAtcStationsBooked(); // all booked stations reloaded - } - - void CAirspaceMonitor::onReadUnchangedAtcBookings() - { - if (!m_bookingsRequested) { return; } - m_bookingsRequested = false; - emit this->changedAtcStationsBooked(); // treat as stations were changed - } - void CAirspaceMonitor::onReceivedVatsimDataFile() { Q_ASSERT(CThreadUtils::isInThisThread(this)); @@ -735,14 +683,6 @@ namespace BlackCore station.setOnline(true); station.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftPosition()); - // sync with bookings - if (m_atcStationsBooked.containsCallsign(callsign)) - { - CAtcStation bookedStation(m_atcStationsBooked.findFirstByCallsign(callsign)); - station.synchronizeWithBookedStation(bookedStation); // both will be aligned - m_atcStationsBooked.replaceIf(&CAtcStation::getCallsign, callsign, bookedStation); - } - m_atcStationsOnline.push_back(station); // subsequent queries @@ -780,9 +720,6 @@ namespace BlackCore emit this->changedAtcStationsOnline(); emit this->changedAtcStationOnlineConnectionStatus(removedStation, false); } - - // booked - this->updateBookedStation(callsign, CPropertyIndexVariantMap(CAtcStation::IndexIsOnline, CVariant::from(false)), true, false); } void CAirspaceMonitor::onAtisReceived(const CCallsign &callsign, const CInformationMessage &atisMessage) @@ -791,9 +728,6 @@ namespace BlackCore if (!this->isConnectedAndNotShuttingDown() || callsign.isEmpty()) return; const bool changedAtis = m_atcStationsOnline.updateIfMessageChanged(atisMessage, callsign, true); - // receiving an ATIS means station is online, update in bookings - m_atcStationsBooked.setOnline(callsign, true); - // signal if (changedAtis) { emit this->changedAtisReceived(callsign); } } @@ -814,9 +748,8 @@ namespace BlackCore QDateTime logoffDateTime = QDateTime::currentDateTimeUtc(); logoffDateTime.setTime(QTime(h, m)); - const CPropertyIndexVariantMap vm(CAtcStation::IndexBookedUntil, CVariant(logoffDateTime)); + const CPropertyIndexVariantMap vm(CAtcStation::IndexLogoffTime, CVariant(logoffDateTime)); this->updateOnlineStation(callsign, vm); - this->updateBookedStation(callsign, vm); } } @@ -1138,17 +1071,6 @@ namespace BlackCore return c; } - int CAirspaceMonitor::updateBookedStation(const CCallsign &callsign, const CPropertyIndexVariantMap &vm, bool skipEqualValues, bool sendSignal) - { - // do not used applyFirst here, more stations wit callsign at a time - const int c = m_atcStationsBooked.applyIfCallsign(callsign, vm, skipEqualValues); - if (c > 0 && sendSignal) - { - emit this->changedAtcStationsBooked(); - } - return c; - } - bool CAirspaceMonitor::handleMaxRange(const CAircraftSituation &situation) { if (situation.isNull()) { return false; } diff --git a/src/blackcore/airspacemonitor.h b/src/blackcore/airspacemonitor.h index d4a681894..4b46cb217 100644 --- a/src/blackcore/airspacemonitor.h +++ b/src/blackcore/airspacemonitor.h @@ -102,18 +102,12 @@ namespace BlackCore //! \threadsafe BlackMisc::Aviation::CFlightPlanRemarks tryToGetFlightPlanRemarks(const BlackMisc::Aviation::CCallsign &callsign) const; - //! Returns the current online ATC stations (consolidated with booked stations) + //! Returns the current online ATC stations BlackMisc::Aviation::CAtcStationList getAtcStationsOnline() const { return m_atcStationsOnline; } //! Recalculate distance to own aircraft BlackMisc::Aviation::CAtcStationList getAtcStationsOnlineRecalculated(); - //! Returns the current booked ATC stations (consolidated with online stations) - BlackMisc::Aviation::CAtcStationList getAtcStationsBooked() const { return m_atcStationsBooked; } - - //! Recalculate distance to own aircraft - BlackMisc::Aviation::CAtcStationList getAtcStationsBookedRecalculated(); - //! Returns the closest ATC station operating on the given frequency, if any BlackMisc::Aviation::CAtcStation getAtcStationForComUnit(const BlackMisc::Aviation::CComSystem &comSystem) const; @@ -126,9 +120,6 @@ namespace BlackCore //! Request to update ATC stations' ATIS data from the network void requestAtisUpdates(); - //! Request updates of bookings - void requestAtcBookingsUpdate(); - //! Analyzer CAirspaceAnalyzer *analyzer() const { return m_analyzer; } @@ -189,9 +180,6 @@ namespace BlackCore //! Online ATC stations were changed void changedAtcStationsOnline(); - //! Booked ATC stations were changed - void changedAtcStationsBooked(); - //! Connection status of an ATC station was changed void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool isConnected); @@ -278,7 +266,6 @@ namespace BlackCore }; BlackMisc::Aviation::CAtcStationList m_atcStationsOnline; //!< online ATC stations - BlackMisc::Aviation::CAtcStationList m_atcStationsBooked; //!< booked ATC stations QHash m_tempFsInnPackets; //!< unhandled FsInn packets QHash m_flightPlanCache; //!< flight plan information retrieved from network and cached QHash m_readiness; //!< readiness @@ -287,7 +274,6 @@ namespace BlackCore 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 int m_maxDistanceNM = 125; //!< position range / FSD range int m_maxDistanceNMHysteresis = qRound(1.1 * m_maxDistanceNM); int m_foundInNonMovingAircraft = 0; @@ -383,9 +369,6 @@ namespace BlackCore //! Update online stations by callsign int updateOnlineStation(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::CPropertyIndexVariantMap &vm, bool skipEqualValues = true, bool sendSignal = true); - //! Update booked station by callsign - int updateBookedStation(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::CPropertyIndexVariantMap &vm, bool skipEqualValues = true, bool sendSignal = true); - //! Handle max.range bool handleMaxRange(const BlackMisc::Aviation::CAircraftSituation &situation); @@ -445,8 +428,6 @@ namespace BlackCore void onIcaoCodesReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &aircraftIcaoDesignator, const QString &airlineIcaoDesignator, const QString &livery); void onPilotDisconnected(const BlackMisc::Aviation::CCallsign &callsign); void onFrequencyReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &frequency); - void onReceivedAtcBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations); - void onReadUnchangedAtcBookings(); void onReceivedVatsimDataFile(); void onAircraftConfigReceived(const BlackMisc::Aviation::CCallsign &callsign, const QJsonObject &jsonObject, qint64 currentOffsetMs); void onAircraftInterimUpdateReceived(const BlackMisc::Aviation::CAircraftSituation &situation); diff --git a/src/blackcore/context/contextnetwork.h b/src/blackcore/context/contextnetwork.h index fa6819695..79896a422 100644 --- a/src/blackcore/context/contextnetwork.h +++ b/src/blackcore/context/contextnetwork.h @@ -114,12 +114,6 @@ namespace BlackCore::Context //! Digest signal changedAtcStationsOnline() void changedAtcStationsOnlineDigest(); - //! ATC station (booked) list has been changed - void changedAtcStationsBooked(); - - //! Digest signal changedAtcStationsBooked() - void changedAtcStationsBookedDigest(); - //! Aircraft list has been changed void changedAircraftInRange(); @@ -170,9 +164,6 @@ namespace BlackCore::Context void textMessageSent(const BlackMisc::Network::CTextMessage &sentMessage); public slots: - //! Reload bookings from booking service - virtual void requestAtcBookingsUpdate() const = 0; - //! The ATC list with online ATC controllers virtual BlackMisc::Aviation::CAtcStationList getAtcStationsOnline(bool recalculateDistance) const = 0; @@ -181,9 +172,6 @@ namespace BlackCore::Context //! \remark sorted by distance, nearest first virtual BlackMisc::Aviation::CAtcStationList getClosestAtcStationsOnline(int number) const = 0; - //! ATC list, with booked controllers - virtual BlackMisc::Aviation::CAtcStationList getAtcStationsBooked(bool recalculateDistance) const = 0; - //! Aircraft list virtual BlackMisc::Simulation::CSimulatedAircraftList getAircraftInRange() const = 0; diff --git a/src/blackcore/context/contextnetworkempty.h b/src/blackcore/context/contextnetworkempty.h index 2d9a1c9c7..205a742de 100644 --- a/src/blackcore/context/contextnetworkempty.h +++ b/src/blackcore/context/contextnetworkempty.h @@ -24,12 +24,6 @@ namespace BlackCore::Context CContextNetworkEmpty(CCoreFacade *runtime) : IContextNetwork(CCoreFacadeConfig::NotUsed, runtime) {} public slots: - //! \copydoc IContextNetwork::requestAtcBookingsUpdate() - virtual void requestAtcBookingsUpdate() const override - { - logEmptyContextWarning(Q_FUNC_INFO); - } - //! \copydoc IContextNetwork::getAtcStationsOnline() virtual BlackMisc::Aviation::CAtcStationList getAtcStationsOnline(bool recalculateDistance) const override { @@ -46,14 +40,6 @@ namespace BlackCore::Context return BlackMisc::Aviation::CAtcStationList(); } - //! \copydoc IContextNetwork::getAtcStationsBooked() - virtual BlackMisc::Aviation::CAtcStationList getAtcStationsBooked(bool recalculateDistance) const override - { - Q_UNUSED(recalculateDistance) - logEmptyContextWarning(Q_FUNC_INFO); - return BlackMisc::Aviation::CAtcStationList(); - } - //! \copydoc IContextNetwork::getAircraftInRange() virtual BlackMisc::Simulation::CSimulatedAircraftList getAircraftInRange() const override { diff --git a/src/blackcore/context/contextnetworkimpl.cpp b/src/blackcore/context/contextnetworkimpl.cpp index 6ed000efb..e816c0da5 100644 --- a/src/blackcore/context/contextnetworkimpl.cpp +++ b/src/blackcore/context/contextnetworkimpl.cpp @@ -99,7 +99,6 @@ namespace BlackCore::Context m_fsdClient->setClientProvider(m_airspace); connect(m_airspace, &CAirspaceMonitor::changedAtcStationOnlineConnectionStatus, this, &CContextNetwork::changedAtcStationOnlineConnectionStatus, Qt::QueuedConnection); connect(m_airspace, &CAirspaceMonitor::changedAtcStationsOnline, this, &CContextNetwork::changedAtcStationsOnline, Qt::QueuedConnection); - connect(m_airspace, &CAirspaceMonitor::changedAtcStationsBooked, this, &CContextNetwork::changedAtcStationsBooked, Qt::QueuedConnection); connect(m_airspace, &CAirspaceMonitor::changedAircraftInRange, this, &CContextNetwork::changedAircraftInRange, Qt::QueuedConnection); connect(m_airspace, &CAirspaceMonitor::removedAircraft, this, &IContextNetwork::removedAircraft, Qt::QueuedConnection); // DBus connect(m_airspace, &CAirspaceMonitor::readyForModelMatching, this, &CContextNetwork::onReadyForModelMatching); // intentionally NOT QueuedConnection @@ -883,15 +882,6 @@ namespace BlackCore::Context return stations; } - CAtcStationList CContextNetwork::getAtcStationsBooked(bool recalculateDistance) const - { - if (this->isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } - CAtcStationList stations = m_airspace->getAtcStationsBooked(); - if (!recalculateDistance || !this->getIContextOwnAircraft()) { return stations; } - stations.calculcateAndUpdateRelativeDistanceAndBearing(this->getIContextOwnAircraft()->getOwnAircraftSituation()); - return stations; - } - CSimulatedAircraftList CContextNetwork::getAircraftInRange() const { if (this->isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } @@ -1173,13 +1163,6 @@ namespace BlackCore::Context return c; } - void CContextNetwork::requestAtcBookingsUpdate() const - { - if (!canUseAirspaceMonitor()) { return; } - if (this->isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } - m_airspace->requestAtcBookingsUpdate(); - } - bool CContextNetwork::updateAircraftRendered(const CCallsign &callsign, bool rendered) { if (!canUseAirspaceMonitor()) { return false; } diff --git a/src/blackcore/context/contextnetworkimpl.h b/src/blackcore/context/contextnetworkimpl.h index e5f5fcd2e..7e9f7e3c2 100644 --- a/src/blackcore/context/contextnetworkimpl.h +++ b/src/blackcore/context/contextnetworkimpl.h @@ -308,12 +308,6 @@ namespace BlackCore BlackMisc::CSimpleCommandParser::registerCommand({ ".disable callsign", "disable/ignore callsign" }); } - //! \copydoc BlackCore::Context::IContextNetwork::requestAtcBookingsUpdate - virtual void requestAtcBookingsUpdate() const override; - - //! \copydoc BlackCore::Context::IContextNetwork::getAtcStationsBooked - virtual BlackMisc::Aviation::CAtcStationList getAtcStationsBooked(bool recalculateDistance) const override; - //! \copydoc BlackCore::Context::IContextNetwork::getAtcStationsOnline virtual BlackMisc::Aviation::CAtcStationList getAtcStationsOnline(bool recalculateDistance) const override; @@ -425,7 +419,6 @@ namespace BlackCore BlackMisc::Simulation::CSimulatorInfo m_lastConnectedSim; //!< last connected sim. // Digest signals, only sending after some time - BlackMisc::CDigestSignal m_dsAtcStationsBookedChanged { this, &IContextNetwork::changedAtcStationsBooked, &IContextNetwork::changedAtcStationsBookedDigest, 1000, 2 }; BlackMisc::CDigestSignal m_dsAtcStationsOnlineChanged { this, &IContextNetwork::changedAtcStationsOnline, &IContextNetwork::changedAtcStationsOnlineDigest, 1000, 4 }; BlackMisc::CDigestSignal m_dsAircraftsInRangeChanged { this, &IContextNetwork::changedAircraftInRange, &IContextNetwork::changedAircraftInRangeDigest, 1000, 4 }; diff --git a/src/blackcore/context/contextnetworkproxy.cpp b/src/blackcore/context/contextnetworkproxy.cpp index d728f180a..35fa28873 100644 --- a/src/blackcore/context/contextnetworkproxy.cpp +++ b/src/blackcore/context/contextnetworkproxy.cpp @@ -43,15 +43,9 @@ namespace BlackCore::Context bool s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), "connectionStatusChanged", this, SIGNAL(connectionStatusChanged(BlackMisc::Network::CConnectionStatus, BlackMisc::Network::CConnectionStatus))); Q_ASSERT(s); - s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), - "changedAtcStationsBooked", this, SIGNAL(changedAtcStationsBooked())); - Q_ASSERT(s); s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), "changedAtcStationsOnline", this, SIGNAL(changedAtcStationsOnline())); Q_ASSERT(s); - s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), - "changedAtcStationsBookedDigest", this, SIGNAL(changedAtcStationsBookedDigest())); - Q_ASSERT(s); s = connection.connect(serviceName, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), "changedAtcStationsOnlineDigest", this, SIGNAL(changedAtcStationsOnlineDigest())); Q_ASSERT(s); @@ -95,11 +89,6 @@ namespace BlackCore::Context this->relayBaseClassSignals(serviceName, connection, IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName()); } - void CContextNetworkProxy::requestAtcBookingsUpdate() const - { - m_dBusInterface->callDBus(QLatin1String("requestAtcBookingsUpdate")); - } - CAtcStationList CContextNetworkProxy::getAtcStationsOnline(bool recalculateDistance) const { return m_dBusInterface->callDBusRet(QLatin1String("getAtcStationsOnline"), recalculateDistance); @@ -110,11 +99,6 @@ namespace BlackCore::Context return m_dBusInterface->callDBusRet(QLatin1String("getClosestAtcStationsOnline"), number); } - CAtcStationList CContextNetworkProxy::getAtcStationsBooked(bool recalculateDistance) const - { - return m_dBusInterface->callDBusRet(QLatin1String("getAtcStationsBooked"), recalculateDistance); - } - CSimulatedAircraftList CContextNetworkProxy::getAircraftInRange() const { return m_dBusInterface->callDBusRet(QLatin1String("getAircraftInRange")); diff --git a/src/blackcore/context/contextnetworkproxy.h b/src/blackcore/context/contextnetworkproxy.h index cf3e4a4d8..811a0bb59 100644 --- a/src/blackcore/context/contextnetworkproxy.h +++ b/src/blackcore/context/contextnetworkproxy.h @@ -73,18 +73,12 @@ namespace BlackCore //! \name Interface overrides //! @{ - //! \copydoc BlackCore::Context::IContextNetwork::requestAtcBookingsUpdate - virtual void requestAtcBookingsUpdate() const override; - //! \copydoc BlackCore::Context::IContextNetwork::getAtcStationsOnline virtual BlackMisc::Aviation::CAtcStationList getAtcStationsOnline(bool recalculateDistance) const override; //! \copydoc BlackCore::Context::IContextNetwork::getClosestAtcStationsOnline virtual BlackMisc::Aviation::CAtcStationList getClosestAtcStationsOnline(int number) const override; - //! \copydoc BlackCore::Context::IContextNetwork::getAtcStationsBooked - virtual BlackMisc::Aviation::CAtcStationList getAtcStationsBooked(bool recalculateDistance) const override; - //! \copydoc BlackCore::Context::IContextNetwork::getAircraftInRange virtual BlackMisc::Simulation::CSimulatedAircraftList getAircraftInRange() const override; diff --git a/src/blackcore/data/globalsetup.cpp b/src/blackcore/data/globalsetup.cpp index b1b89b53b..89a440fb2 100644 --- a/src/blackcore/data/globalsetup.cpp +++ b/src/blackcore/data/globalsetup.cpp @@ -42,7 +42,6 @@ namespace BlackCore::Data { m_mappingMinimumVersion = CBuildConfig::getVersionString(); m_dbRootDirectoryUrl = CUrl("https://datastore.swift-project.org/"); - m_vatsimBookingsUrl = CUrl("http://vatbook.euroutepro.com/xml2.php"); m_vatsimMetarsUrls = CUrlList { "http://metar.vatsim.net/metar.php" }; m_vatsimStatusFileUrls = CUrlList { "https://status.vatsim.net" }; m_vatsimDataFileUrls = CUrlList { "https://data.vatsim.net/v3/vatsim-data.json" }; @@ -277,7 +276,7 @@ namespace BlackCore::Data s += u"DB root directory: " % getDbRootDirectoryUrl().toQString(i18n) % separator % u"ICAO DB reader: " % getDbIcaoReaderUrl().toQString(i18n) % separator % u"Model DB reader: " % getDbModelReaderUrl().toQString(i18n) % separator % u"Airport DB reader: " % getDbAirportReaderUrl().toQString(i18n) % separator % u"DB home page: " % getDbHomePageUrl().toQString(i18n) % separator % u"DB login service: " % getDbLoginServiceUrl().toQString(i18n) % separator % u"DB client ping service: " % getDbClientPingServiceUrl().toQString(i18n); s += - u"VATSIM bookings: " % getVatsimBookingsUrl().toQString(i18n) % separator % u"VATSIM METARs: " % getVatsimMetarsUrls().toQString(i18n) % separator % u"VATSIM data file: " % getVatsimDataFileUrls().toQString(i18n) % separator % u"VATSIM server file: " % getVatsimServerFileUrl().toQString(i18n) % separator + u"VATSIM METARs: " % getVatsimMetarsUrls().toQString(i18n) % separator % u"VATSIM data file: " % getVatsimDataFileUrls().toQString(i18n) % separator % u"VATSIM server file: " % getVatsimServerFileUrl().toQString(i18n) % separator % u"Predefined servers: " % getPredefinedServers().toQString(i18n) % separator @@ -301,7 +300,6 @@ namespace BlackCore::Data case IndexDbClientPingService: return QVariant::fromValue(this->getDbClientPingServiceUrl()); case IndexVatsimStatus: return QVariant::fromValue(m_vatsimStatusFileUrls); case IndexVatsimData: return QVariant::fromValue(m_vatsimDataFileUrls); - case IndexVatsimBookings: return QVariant::fromValue(m_vatsimBookingsUrl); case IndexVatsimServer: return QVariant::fromValue(m_vatsimServerFileUrl); case IndexVatsimHttpFsd: return QVariant::fromValue(m_vatsimFsdHttpUrl); case IndexVatsimMetars: return QVariant::fromValue(m_vatsimMetarsUrls); @@ -339,7 +337,6 @@ namespace BlackCore::Data case IndexDbLoginService: break; // cannot be changed case IndexDbClientPingService: break; // cannot be changed case IndexVatsimData: m_vatsimDataFileUrls = variant.value(); break; - case IndexVatsimBookings: m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break; case IndexVatsimServer: m_vatsimServerFileUrl = variant.value(); break; case IndexVatsimHttpFsd: m_vatsimFsdHttpUrl = variant.value(); break; case IndexVatsimMetars: m_vatsimMetarsUrls = variant.value(); break; diff --git a/src/blackcore/data/globalsetup.h b/src/blackcore/data/globalsetup.h index 090d4d332..62467dcd0 100644 --- a/src/blackcore/data/globalsetup.h +++ b/src/blackcore/data/globalsetup.h @@ -42,7 +42,6 @@ namespace BlackCore::Data IndexDbLoginService, IndexDbClientPingService, IndexVatsimStatus, - IndexVatsimBookings, IndexVatsimMetars, IndexVatsimData, IndexVatsimServer, @@ -160,9 +159,6 @@ namespace BlackCore::Data //! \remark based on getSwiftSharedUrls BlackMisc::Network::CUrlList getSwiftUpdateInfoFileUrls() const; - //! URL to read VATSIM bookings - const BlackMisc::Network::CUrl &getVatsimBookingsUrl() const { return m_vatsimBookingsUrl; } - //! VATSIM METAR URL const BlackMisc::Network::CUrlList &getVatsimMetarsUrls() const { return m_vatsimMetarsUrls; } @@ -247,7 +243,6 @@ namespace BlackCore::Data QString m_mappingMinimumVersion; //!< minimum version BlackMisc::Network::CUrl m_crashReportServerUrl; //!< crash report server BlackMisc::Network::CUrl m_dbRootDirectoryUrl; //!< Root directory of DB - BlackMisc::Network::CUrl m_vatsimBookingsUrl; //!< ATC bookings BlackMisc::Network::CUrlList m_vatsimMetarsUrls; //!< METAR data BlackMisc::Network::CUrlList m_vatsimStatusFileUrls; //!< Status file, where to find the VATSIM files (METAR, data, ATIS, other status files) BlackMisc::Network::CUrlList m_vatsimDataFileUrls; //!< Overall VATSIM data file / merely for bootstrapping the first time @@ -280,7 +275,6 @@ namespace BlackCore::Data BLACK_METAMEMBER(vatsimDataFileUrls), BLACK_METAMEMBER(vatsimServerFileUrl), BLACK_METAMEMBER(vatsimFsdHttpUrl), - BLACK_METAMEMBER(vatsimBookingsUrl), BLACK_METAMEMBER(vatsimMetarsUrls), BLACK_METAMEMBER(sharedUrls), BLACK_METAMEMBER(onlineHelpUrls), diff --git a/src/blackcore/vatsim/vatsimbookingreader.cpp b/src/blackcore/vatsim/vatsimbookingreader.cpp deleted file mode 100644 index 20f7401b7..000000000 --- a/src/blackcore/vatsim/vatsimbookingreader.cpp +++ /dev/null @@ -1,222 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "blackcore/application.h" -#include "blackcore/data/globalsetup.h" -#include "blackcore/vatsim/vatsimbookingreader.h" -#include "blackmisc/aviation/atcstation.h" -#include "blackmisc/aviation/callsign.h" -#include "blackmisc/logmessage.h" -#include "blackmisc/network/entityflags.h" -#include "blackmisc/network/url.h" -#include "blackmisc/network/user.h" -#include "blackmisc/statusmessage.h" -#include "blackmisc/verify.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace BlackMisc; -using namespace BlackMisc::Aviation; -using namespace BlackMisc::Network; - -namespace BlackCore::Vatsim -{ - CVatsimBookingReader::CVatsimBookingReader(QObject *owner) : CThreadedReader(owner, "CVatsimBookingReader"), - CEcosystemAware(CEcosystemAware::providerIfPossible(owner)) - { - this->settingsChanged(); - } - - void CVatsimBookingReader::readInBackgroundThread() - { - QPointer myself(this); - QTimer::singleShot(0, this, [=] { - if (!myself) { return; } - myself->read(); - }); - } - - void CVatsimBookingReader::doWorkImpl() - { - this->read(); - } - - void CVatsimBookingReader::read() - { - this->threadAssertCheck(); - if (!this->doWorkCheck()) { return; } - if (!this->isInternetAccessible("No network/internet access, cannot read VATSIM bookings")) { return; } - if (this->isNotVATSIMEcosystem()) { return; } - - Q_ASSERT_X(sApp, Q_FUNC_INFO, "No application"); - const QUrl url(sApp->getGlobalSetup().getVatsimBookingsUrl()); - if (url.isEmpty()) { return; } - this->getFromNetworkAndLog(url, { this, &CVatsimBookingReader::parseBookings }); - } - - void CVatsimBookingReader::parseBookings(QNetworkReply *nwReplyPtr) - { - // wrap pointer, make sure any exit cleans up reply - // required to use delete later as object is created in a different thread - QScopedPointer nwReply(nwReplyPtr); - this->threadAssertCheck(); - if (this->isNotVATSIMEcosystem()) { return; } - - // Worker thread, make sure to write no members here od do it threadsafe - if (!this->doWorkCheck()) - { - CLogMessage(this).info(u"Terminated booking parsing process"); - return; // stop, terminate straight away, ending thread - } - - const CReaderSettings settings = m_settings.get(); - this->logNetworkReplyReceived(nwReplyPtr); - const QUrl url = nwReply->url(); - - if (nwReply->error() == QNetworkReply::NoError) - { - static const QString timestampFormat("yyyy-MM-dd HH:mm:ss"); - const QString xmlData = nwReply->readAll(); - nwReply->close(); // close asap - - if (xmlData.isEmpty() || !xmlData.contains("", Qt::CaseInsensitive)) - { - CLogMessage(this).warning(u"Reading bookings wrong XML format for '%1'") << nwReply->url().toString(); - m_failures++; - emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFailed, 0, url); - return; - } - - QDomDocument doc; - QDateTime updateTimestamp = QDateTime::currentDateTimeUtc(); // default - if (doc.setContent(xmlData)) - { - const QDomNode timestamp = doc.elementsByTagName("timestamp").at(0); - const QString ts = timestamp.toElement().text().trimmed(); - BLACK_AUDIT_X(!ts.isEmpty(), Q_FUNC_INFO, "Wrong timestamp format"); - - if (ts.isEmpty()) - { - CLogMessage(this).warning(u"Reading bookings wrong XML timestamp format for '%1'") << nwReply->url().toString(); - m_failures++; - emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFailed, 0, url); - return; - } - else - { - // normally the timestamp is always updated from backend - // if this changes in the future we're prepared - updateTimestamp = fromStringUtc(ts, timestampFormat); - if (this->getUpdateTimestamp() == updateTimestamp) return; // nothing to do - - // save parsing and all follow up actions if nothing changed - bool changed = this->didContentChange(xmlData, xmlData.indexOf("")); - if (!changed) - { - CLogMessage(this).info(u"Read bookings unchanged, skipped"); - emit this->atcBookingsReadUnchanged(); - return; // stop, terminate straight away, ending thread - } - } - - const QDomNode atc = doc.elementsByTagName("atcs").at(0); - const QDomNodeList bookingNodes = atc.toElement().elementsByTagName("booking"); - int size = bookingNodes.size(); - CAtcStationList bookedStations; - for (int i = 0; i < size; i++) - { - if (!this->doWorkCheck()) - { - CLogMessage(this).info(u"Terminated booking parsing process"); // for users - return; // stop, terminate straight away, ending thread - } - - // pase nodes - const QDomNode bookingNode = bookingNodes.at(i); - const QDomNodeList bookingNodeValues = bookingNode.childNodes(); - CAtcStation bookedStation; - CUser user; - for (int v = 0; v < bookingNodeValues.size(); v++) - { - const QDomNode bookingNodeValue = bookingNodeValues.at(v); - const QString name = bookingNodeValue.nodeName().toLower(); - const QString value = bookingNodeValue.toElement().text(); - if (name == "id") - { - // could be used as unique key - } - else if (name == "callsign") - { - bookedStation.setCallsign(CCallsign(value, CCallsign::Atc)); - } - else if (name == "name") - { - user.setRealName(value); - } - else if (name == "cid") - { - user.setId(value); - } - else if (name == "time_end") - { - const QDateTime t = fromStringUtc(value, timestampFormat); - bookedStation.setBookedUntilUtc(t); - } - else if (name == "time_start") - { - const QDateTime t = fromStringUtc(value, timestampFormat); - bookedStation.setBookedFromUtc(t); - } - } - // time checks - const QDateTime now = QDateTime::currentDateTimeUtc(); - if (now.msecsTo(bookedStation.getBookedUntilUtc()) < (1000 * 60 * 15)) { continue; } // until n mins in past - if (now.msecsTo(bookedStation.getBookedFromUtc()) > (1000 * 60 * 60 * 24)) { continue; } // to far in the future, n hours - bookedStation.setController(user); - bookedStations.push_back(bookedStation); - } - m_failures = 0; - this->setUpdateTimestamp(updateTimestamp); // thread safe update - this->setInitialAndPeriodicTime(settings.getInitialTime().toMs(), 3 * settings.getPeriodicTime().toMs()); // slow down, we have some bookings now - - emit this->atcBookingsRead(bookedStations); - emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFinished, bookedStations.size(), url); - } // node - } - else - { - // network error - CLogMessage(this).warning(u"Reading bookings failed '%1' '%2'") << nwReply->errorString() << url.toString(); - nwReply->abort(); - m_failures++; - if (m_failures > 3) - { - // slow updates from now on - this->setInitialAndPeriodicTime(settings.getInitialTime().toMs(), 10 * settings.getPeriodicTime().toMs()); // massively slow down - CLogMessage(this).warning(u"Too many booking reader failures %1, slower updates") << m_failures; - } - emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFailed, 0, url); - } - } // method - - void CVatsimBookingReader::settingsChanged() - { - const CReaderSettings s = m_settings.get(); - this->setInitialAndPeriodicTime(s.getInitialTime().toMs(), s.getPeriodicTime().toMs()); - } -} // ns diff --git a/src/blackcore/vatsim/vatsimbookingreader.h b/src/blackcore/vatsim/vatsimbookingreader.h deleted file mode 100644 index 083237ac2..000000000 --- a/src/blackcore/vatsim/vatsimbookingreader.h +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef BLACKCORE_VATSIM_VATSIMBOOKINGREADER_H -#define BLACKCORE_VATSIM_VATSIMBOOKINGREADER_H - -#include "blackcore/blackcoreexport.h" -#include "blackmisc/aviation/atcstationlist.h" -#include "blackmisc/network/ecosystemprovider.h" -#include "blackmisc/network/entityflags.h" -#include "blackcore/threadedreader.h" - -#include - -class QNetworkReply; - -namespace BlackCore::Vatsim -{ - //! Read bookings from VATSIM - class BLACKCORE_EXPORT CVatsimBookingReader : - public BlackCore::CThreadedReader, - public BlackMisc::Network::CEcosystemAware - { - Q_OBJECT - - public: - //! Constructor - explicit CVatsimBookingReader(QObject *owner); - - //! Read / re-read bookings - void readInBackgroundThread(); - - signals: - //! Bookings have been read and converted to BlackMisc::Aviation::CAtcStationList - void atcBookingsRead(const BlackMisc::Aviation::CAtcStationList &bookedStations); - - //! Bookings have been re-read but did not change - void atcBookingsReadUnchanged(); - - //! Data have been read - void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url); - - protected: - // CThreadedReader overrides - virtual void doWorkImpl() override; - - private: - //! Bookings have been read - //! \threadsafe - void parseBookings(QNetworkReply *nwReply); - - //! Do reading - void read(); - - //! Settings changed - void settingsChanged(); - - int m_failures = 0; - BlackMisc::CSettingReadOnly m_settings { this, &CVatsimBookingReader::settingsChanged }; - }; -} // ns - -#endif // guard diff --git a/src/blackcore/webdataservices.cpp b/src/blackcore/webdataservices.cpp index 26c718a4a..60aa9967e 100644 --- a/src/blackcore/webdataservices.cpp +++ b/src/blackcore/webdataservices.cpp @@ -9,7 +9,6 @@ #include "blackcore/db/databasewriter.h" #include "blackcore/db/icaodatareader.h" #include "blackcore/db/modeldatareader.h" -#include "blackcore/vatsim/vatsimbookingreader.h" #include "blackcore/vatsim/vatsimdatafilereader.h" #include "blackcore/vatsim/vatsimmetarreader.h" #include "blackcore/vatsim/vatsimstatusfilereader.h" @@ -259,15 +258,6 @@ namespace BlackCore } } - if (m_vatsimBookingReader) - { - if (whatToRead.testFlag(CEntityFlags::BookingEntity)) - { - m_vatsimBookingReader->readInBackgroundThread(); - triggeredRead |= CEntityFlags::BookingEntity; - } - } - if (m_vatsimMetarReader) { if (whatToRead.testFlag(CEntityFlags::MetarEntity)) @@ -544,7 +534,6 @@ namespace BlackCore { const QString db = this->getDbReadersLog(separator); QStringList report; - if (m_vatsimBookingReader) { report << m_vatsimBookingReader->getName() + ": " + m_vatsimBookingReader->getReadLog().getSummary(); } if (m_vatsimMetarReader) { report << m_vatsimMetarReader->getName() + ": " + m_vatsimMetarReader->getReadLog().getSummary(); } if (m_vatsimStatusReader) { report << m_vatsimStatusReader->getName() + ": " + m_vatsimStatusReader->getReadLog().getSummary(); } if (report.isEmpty()) { return db; } @@ -971,11 +960,6 @@ namespace BlackCore m_vatsimMetarReader->quitAndWait(); m_vatsimMetarReader = nullptr; } - if (m_vatsimBookingReader) - { - m_vatsimBookingReader->quitAndWait(); - m_vatsimBookingReader = nullptr; - } if (m_vatsimDataFileReader) { m_vatsimDataFileReader->quitAndWait(); @@ -1108,20 +1092,7 @@ namespace BlackCore // ---- "normal data", triggerRead will start read, not starting directly - // 3. VATSIM bookings - if (readersNeeded.testFlag(CWebReaderFlags::WebReaderFlag::VatsimBookingReader)) - { - m_vatsimBookingReader = new CVatsimBookingReader(this); - c = connect(m_vatsimBookingReader, &CVatsimBookingReader::atcBookingsRead, this, &CWebDataServices::receivedBookings, typeReaderReadSignals); - Q_ASSERT_X(c, Q_FUNC_INFO, "VATSIM booking reader signals"); - c = connect(m_vatsimBookingReader, &CVatsimBookingReader::dataRead, this, &CWebDataServices::dataRead, typeReaderReadSignals); - Q_ASSERT_X(c, Q_FUNC_INFO, "connect failed bookings"); - m_entitiesPeriodicallyRead |= CEntityFlags::BookingEntity; - m_vatsimBookingReader->start(QThread::LowPriority); - m_vatsimBookingReader->startReader(); - } - - // 4. VATSIM data file + // 3. VATSIM data file if (readersNeeded.testFlag(CWebReaderFlags::WebReaderFlag::VatsimDataReader)) { m_vatsimDataFileReader = new CVatsimDataFileReader(this); @@ -1134,7 +1105,7 @@ namespace BlackCore m_vatsimDataFileReader->startReader(); } - // 5. VATSIM METAR data + // 4. VATSIM METAR data if (readersNeeded.testFlag(CWebReaderFlags::WebReaderFlag::VatsimMetarReader)) { m_vatsimMetarReader = new CVatsimMetarReader(this); @@ -1147,7 +1118,7 @@ namespace BlackCore m_vatsimMetarReader->startReader(); } - // 6. ICAO data reader + // 5. ICAO data reader if (readersNeeded.testFlag(CWebReaderFlags::WebReaderFlag::IcaoDataReader)) { m_icaoDataReader = new CIcaoDataReader(this, dbReaderConfig); @@ -1162,7 +1133,7 @@ namespace BlackCore m_icaoDataReader->start(QThread::LowPriority); } - // 7. Model reader + // 6. Model reader if (readersNeeded.testFlag(CWebReaderFlags::WebReaderFlag::ModelReader)) { m_modelDataReader = new CModelDataReader(this, dbReaderConfig); @@ -1177,7 +1148,7 @@ namespace BlackCore m_modelDataReader->start(QThread::LowPriority); } - // 8. Airport reader + // 7. Airport reader if (readersNeeded.testFlag(CWebReaderFlags::WebReaderFlag::AirportReader)) { m_airportDataReader = new CAirportDataReader(this, dbReaderConfig); @@ -1361,11 +1332,6 @@ namespace BlackCore return entities; } - void CWebDataServices::receivedBookings(const CAtcStationList &stations) - { - CLogMessage(this).info(u"Read %1 ATC bookings from network") << stations.size(); - } - void CWebDataServices::receivedMetars(const CMetarList &metars) { CLogMessage(this).info(u"Read %1 METARs") << metars.size(); diff --git a/src/blackcore/webdataservices.h b/src/blackcore/webdataservices.h index 90d47c613..f4cc5d551 100644 --- a/src/blackcore/webdataservices.h +++ b/src/blackcore/webdataservices.h @@ -102,15 +102,9 @@ namespace BlackCore //! Shutdown void gracefulShutdown(); - //! Read ATC bookings (used to re-read) - void readAtcBookingsInBackground() const; - //! Data file reader Vatsim::CVatsimDataFileReader *getVatsimDataFileReader() const { return m_vatsimDataFileReader; } - //! Booking reader - Vatsim::CVatsimBookingReader *getBookingReader() const { return m_vatsimBookingReader; } - //! Metar reader Vatsim::CVatsimMetarReader *getMetarReader() const { return m_vatsimMetarReader; } @@ -569,9 +563,6 @@ namespace BlackCore void readInBackground(BlackMisc::Network::CEntityFlags::Entity entities = BlackMisc::Network::CEntityFlags::AllEntities); private: - //! ATC bookings received - void receivedBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations); - //! Received METAR data void receivedMetars(const BlackMisc::Weather::CMetarList &metars); @@ -650,7 +641,6 @@ namespace BlackCore // for reading XML and VATSIM data files Vatsim::CVatsimStatusFileReader *m_vatsimStatusReader = nullptr; - Vatsim::CVatsimBookingReader *m_vatsimBookingReader = nullptr; Vatsim::CVatsimDataFileReader *m_vatsimDataFileReader = nullptr; Vatsim::CVatsimMetarReader *m_vatsimMetarReader = nullptr; Vatsim::CVatsimServerFileReader *m_vatsimServerFileReader = nullptr; diff --git a/src/blackcore/webreaderflags.cpp b/src/blackcore/webreaderflags.cpp index 3e1366e93..fb4b54480 100644 --- a/src/blackcore/webreaderflags.cpp +++ b/src/blackcore/webreaderflags.cpp @@ -28,7 +28,6 @@ namespace BlackCore } if (entities.testFlag(CEntityFlags::DbInfoObjectEntity)) { f |= DbInfoDataReader; } - if (entities.testFlag(CEntityFlags::BookingEntity)) { f |= VatsimBookingReader; } if (entities.testFlag(CEntityFlags::VatsimDataFile)) { f |= VatsimDataReader; } if (entities.testFlag(CEntityFlags::VatsimStatusFile)) { f |= VatsimStatusReader; } if (entities.testFlag(CEntityFlags::MetarEntity)) { f |= VatsimMetarReader; } @@ -48,7 +47,6 @@ namespace BlackCore if (readers.testFlag(ModelReader)) { entities |= CEntityFlags::DistributorLiveryModel; } if (readers.testFlag(AirportReader)) { entities |= CEntityFlags::AirportEntity; } if (readers.testFlag(DbInfoDataReader)) { entities |= CEntityFlags::DbInfoObjectEntity; } - if (readers.testFlag(VatsimBookingReader)) { entities |= CEntityFlags::BookingEntity; } if (readers.testFlag(VatsimMetarReader)) { entities |= CEntityFlags::MetarEntity; } if (readers.testFlag(VatsimDataReader)) { entities |= CEntityFlags::VatsimDataFile; } if (readers.testFlag(VatsimStatusReader)) { entities |= CEntityFlags::VatsimStatusFile; } diff --git a/src/blackcore/webreaderflags.h b/src/blackcore/webreaderflags.h index 215ed152e..1e5a57a40 100644 --- a/src/blackcore/webreaderflags.h +++ b/src/blackcore/webreaderflags.h @@ -24,16 +24,15 @@ namespace BlackCore enum WebReaderFlag { None = 0, //!< no reader at all - VatsimBookingReader = 1 << 0, //!< reader for VATSIM booking data - VatsimDataReader = 1 << 1, //!< reader for VATSIM data - VatsimMetarReader = 1 << 2, //!< reader for VATSIM metar data - VatsimStatusReader = 1 << 3, //!< reader for VATSIM status file - VatsimServerFileReader = 1 << 4, //!< reader for VATSIM server file - IcaoDataReader = 1 << 5, //!< reader for ICAO data - ModelReader = 1 << 6, //!< reader for model data such as liveries, models, etc - AirportReader = 1 << 7, //!< reader for airport list - DbInfoDataReader = 1 << 8, //!< DB info data (metdata, how many data, when updated) - AllVatsimReaders = VatsimBookingReader | VatsimDataReader | VatsimMetarReader | VatsimStatusReader | VatsimServerFileReader, //!< all VATSIM readers + VatsimDataReader = 1 << 0, //!< reader for VATSIM data + VatsimMetarReader = 1 << 1, //!< reader for VATSIM metar data + VatsimStatusReader = 1 << 2, //!< reader for VATSIM status file + VatsimServerFileReader = 1 << 3, //!< reader for VATSIM server file + IcaoDataReader = 1 << 4, //!< reader for ICAO data + ModelReader = 1 << 5, //!< reader for model data such as liveries, models, etc + AirportReader = 1 << 6, //!< reader for airport list + DbInfoDataReader = 1 << 7, //!< DB info data (metdata, how many data, when updated) + AllVatsimReaders = VatsimDataReader | VatsimMetarReader | VatsimStatusReader | VatsimServerFileReader, //!< all VATSIM readers AllSwiftDbReaders = IcaoDataReader | ModelReader | DbInfoDataReader | AirportReader, //!< all swift data AllReaders = AllSwiftDbReaders | AllVatsimReaders //!< everything }; diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index fe158741d..f0076b175 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -78,26 +78,22 @@ namespace BlackGui::Components // set station mode ui->tvp_AtcStationsOnline->setStationMode(CAtcStationListModel::StationsOnline); - ui->tvp_AtcStationsBooked->setStationMode(CAtcStationListModel::StationsBooked); ui->tvp_AtcStationsOnlineTree->setColumns(ui->tvp_AtcStationsOnline->getColumns()); // menus ui->tvp_AtcStationsOnline->menuRemoveItems(CAtcStationView::MenuClear); - ui->tvp_AtcStationsBooked->menuRemoveItems(CAtcStationView::MenuClear); // Signal / Slots connect(ui->le_AtcStationsOnlineMetar, &QLineEdit::returnPressed, this, &CAtcStationComponent::getMetarAsEntered); connect(ui->tb_AtcStationsLoadMetar, &QPushButton::clicked, this, &CAtcStationComponent::getMetarAsEntered); connect(ui->tb_Audio, &QPushButton::clicked, this, &CAtcStationComponent::requestAudioWidget); connect(ui->tb_TextMessageOverlay, &QPushButton::clicked, this, &CAtcStationComponent::showOverlayInlineTextMessage); - connect(ui->tw_Atc, &QTabWidget::currentChanged, this, &CAtcStationComponent::atcStationsTabChanged); // "local" tab changed (booked, online) connect(ui->tvp_AtcStationsOnline, &CAtcStationView::objectClicked, this, &CAtcStationComponent::onOnlineAtcStationVariantSelected, Qt::QueuedConnection); connect(ui->tvp_AtcStationsOnline, &CAtcStationView::objectSelected, this, &CAtcStationComponent::onOnlineAtcStationVariantSelected, Qt::QueuedConnection); connect(ui->tvp_AtcStationsOnline, &CAtcStationView::testRequestDummyAtcOnlineStations, this, &CAtcStationComponent::testCreateDummyOnlineAtcStations); connect(ui->tvp_AtcStationsOnline, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::requestOnlineStationsUpdate); connect(ui->tvp_AtcStationsOnline, &CAtcStationView::requestNewBackendData, this, &CAtcStationComponent::requestOnlineStationsUpdate); - connect(ui->tvp_AtcStationsOnline, &CAtcStationView::modelDataChangedDigest, this, &CAtcStationComponent::onCountChanged); connect(ui->tvp_AtcStationsOnline, &CAtcStationView::requestComFrequency, this, &CAtcStationComponent::setComFrequency); connect(ui->tvp_AtcStationsOnline, &CAtcStationView::requestTextMessageWidget, this, &CAtcStationComponent::requestTextMessageWidget); @@ -107,10 +103,6 @@ namespace BlackGui::Components connect(ui->comp_AtcStationsSettings, &CSettingsAtcStationsInlineComponent::changed, this, &CAtcStationComponent::forceUpdate, Qt::QueuedConnection); - connect(ui->tvp_AtcStationsBooked, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::reloadAtcStationsBooked); - connect(ui->tvp_AtcStationsBooked, &CAtcStationView::requestNewBackendData, this, &CAtcStationComponent::reloadAtcStationsBooked); - connect(ui->tvp_AtcStationsBooked, &CAtcStationView::modelDataChangedDigest, this, &CAtcStationComponent::onCountChanged); - connect(ui->tb_AtcStationsAtisReload, &QPushButton::clicked, this, &CAtcStationComponent::requestAtisUpdates); connect(&m_updateTimer, &QTimer::timeout, this, &CAtcStationComponent::update); @@ -121,7 +113,6 @@ namespace BlackGui::Components if (sGui) { connect(sGui->getIContextNetwork(), &IContextNetwork::changedAtcStationsOnlineDigest, this, &CAtcStationComponent::changedAtcStationsOnline, Qt::QueuedConnection); - connect(sGui->getIContextNetwork(), &IContextNetwork::changedAtcStationsBookedDigest, this, &CAtcStationComponent::changedAtcStationsBooked, Qt::QueuedConnection); connect(sGui->getIContextNetwork(), &IContextNetwork::changedAtcStationOnlineConnectionStatus, this, &CAtcStationComponent::changedAtcStationOnlineConnectionStatus, Qt::QueuedConnection); connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CAtcStationComponent::connectionStatusChanged, Qt::QueuedConnection); } @@ -159,11 +150,6 @@ namespace BlackGui::Components ui->tw_Atc->setCurrentIndex(t); } - int CAtcStationComponent::countBookedStations() const - { - return ui->tvp_AtcStationsBooked->rowCount(); - } - int CAtcStationComponent::countOnlineStations() const { return ui->tvp_AtcStationsOnline->rowCount(); @@ -187,25 +173,17 @@ namespace BlackGui::Components void CAtcStationComponent::update() { if (!this->canAccessContext()) { return; } - Q_ASSERT(ui->tvp_AtcStationsBooked); Q_ASSERT(ui->tvp_AtcStationsOnline); // check if component is visible, if we have already data then skip udpate - const bool hasData = this->countBookedStations() > 0 || this->countOnlineStations() > 0; + const bool hasData = this->countOnlineStations() > 0; if (hasData && !this->isVisibleWidget()) { // Update skipped, as not visible - ui->tvp_AtcStationsBooked->hideLoadIndicator(); ui->tvp_AtcStationsOnline->hideLoadIndicator(); return; } - // bookings - if (m_timestampBookedStationsChanged > m_timestampLastReadBookedStations) - { - this->reloadAtcStationsBooked(); - } - // online stations, only when connected if (sGui->getIContextNetwork()->isConnected()) { @@ -296,25 +274,6 @@ namespace BlackGui::Components } } - void CAtcStationComponent::reloadAtcStationsBooked() - { - Q_ASSERT(ui->tvp_AtcStationsBooked); - if (!this->canAccessContext()) { return; } - - QObject *sender = QObject::sender(); - if (sender == ui->tvp_AtcStationsBooked) - { - // trigger new read, which takes some time. A signal will be received when this is done - CLogMessage(this).info(u"Requested new bookings"); - sGui->getIContextNetwork()->requestAtcBookingsUpdate(); - } - else - { - ui->tvp_AtcStationsBooked->updateContainerMaybeAsync(sGui->getIContextNetwork()->getAtcStationsBooked(false)); - m_timestampLastReadBookedStations = QDateTime::currentDateTimeUtc(); - } - } - void CAtcStationComponent::changedAtcStationsOnline() { // just update timestamp, data will be pulled by timer @@ -322,19 +281,6 @@ namespace BlackGui::Components m_timestampOnlineStationsChanged = QDateTime::currentDateTimeUtc(); } - void CAtcStationComponent::changedAtcStationsBooked() - { - // a change can mean a complete change of the bookings, or - // a single value is updated (e.g. online status) - // just update timestamp, data will be pulled by timer - // the timestamp will tell if there are any newer data - // unlike online stations, this can happen if we are not connected to a FSD server - - m_timestampBookedStationsChanged = QDateTime::currentDateTimeUtc(); - if (m_updateTimer.isActive()) { return; } // update by timer - this->update(); - } - void CAtcStationComponent::connectionStatusChanged(const CConnectionStatus &from, const CConnectionStatus &to) { Q_UNUSED(from) @@ -382,16 +328,6 @@ namespace BlackGui::Components Q_UNUSED(index) } - void CAtcStationComponent::onCountChanged(int count, bool withFilter) - { - Q_UNUSED(count) - Q_UNUSED(withFilter) - const int ib = ui->tw_Atc->indexOf(ui->tb_AtcStationsBooked); - QString b = ui->tw_Atc->tabBar()->tabText(ib); - b = CGuiUtility::replaceTabCountValue(b, this->countBookedStations()); - ui->tw_Atc->tabBar()->setTabText(ib, b); - } - void CAtcStationComponent::setOnlineTabs(int count, int filtered) { const int io = ui->tw_Atc->indexOf(ui->tb_AtcStationsOnline); @@ -483,19 +419,6 @@ namespace BlackGui::Components m_selectedCallsign = station.getCallsign(); } - void CAtcStationComponent::atcStationsTabChanged() - { - const bool booked = ui->tw_Atc->currentWidget() == ui->tb_AtcStationsBooked; - if (booked) - { - if (ui->tvp_AtcStationsBooked->isEmpty()) - { - this->reloadAtcStationsBooked(); - } - } - ui->gb_Details->setVisible(!booked); - } - void CAtcStationComponent::requestAtisUpdates() { if (!this->canAccessContext()) { return; } diff --git a/src/blackgui/components/atcstationcomponent.h b/src/blackgui/components/atcstationcomponent.h index e8348276a..1893bbdf6 100644 --- a/src/blackgui/components/atcstationcomponent.h +++ b/src/blackgui/components/atcstationcomponent.h @@ -56,7 +56,6 @@ namespace BlackGui { TabAtcOnline = 0, TabAtcOnlineTree, - TabAtcBooked }; //! Constructor @@ -68,9 +67,6 @@ namespace BlackGui //! Set tab void setTab(AtcTab tab); - //! Number of booked stations - int countBookedStations() const; - //! Number of online stations int countOnlineStations() const; @@ -109,15 +105,6 @@ namespace BlackGui //! Trigger a selection of an onlie station (async) void triggerOnlineAtcStationSelected(const BlackMisc::Aviation::CAtcStation &station); - //! Tab changed - void atcStationsTabChanged(); - - //! Booked stations reloading - void reloadAtcStationsBooked(); - - //! Booked stations changed - void changedAtcStationsBooked(); - //! Online stations changed void changedAtcStationsOnline(); @@ -133,9 +120,6 @@ namespace BlackGui //! Info area tab bar has changed void infoAreaTabBarChanged(int index); - //! Count has been changed - void onCountChanged(int count, bool withFilter); - //! Online tab info void setOnlineTabs(int count, int filtered); @@ -175,8 +159,6 @@ namespace BlackGui BlackMisc::Aviation::CCallsign m_selectedCallsign; QDateTime m_timestampLastReadOnlineStations; //!< stations read QDateTime m_timestampOnlineStationsChanged; //!< stations marked as changed - QDateTime m_timestampLastReadBookedStations; //!< stations read - QDateTime m_timestampBookedStationsChanged; //!< stations marked as changed BlackMisc::CSettingReadOnly m_settingsView { this, &CAtcStationComponent::settingsChanged }; }; } // namespace diff --git a/src/blackgui/components/atcstationcomponent.ui b/src/blackgui/components/atcstationcomponent.ui index e2516e68e..ecf46be7d 100644 --- a/src/blackgui/components/atcstationcomponent.ui +++ b/src/blackgui/components/atcstationcomponent.ui @@ -120,59 +120,6 @@ - - - ATC booked - - - - 3 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - 1 - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - true - - - false - - - - - @@ -341,7 +288,6 @@ tb_Audio te_AtcStationsOnlineInfo tvp_AtcStationsOnlineTree - tvp_AtcStationsBooked diff --git a/src/blackgui/models/atcstationlistmodel.cpp b/src/blackgui/models/atcstationlistmodel.cpp index cea7d0794..4dca390ec 100644 --- a/src/blackgui/models/atcstationlistmodel.cpp +++ b/src/blackgui/models/atcstationlistmodel.cpp @@ -40,8 +40,6 @@ namespace BlackGui::Models (void)QT_TRANSLATE_NOOP("ModelAtcList", "distance"); (void)QT_TRANSLATE_NOOP("ModelAtcList", "controllername"); (void)QT_TRANSLATE_NOOP("ModelAtcList", "online"); - (void)QT_TRANSLATE_NOOP("ModelAtcList", "bookedfrom"); - (void)QT_TRANSLATE_NOOP("ModelAtcList", "bookeduntil"); } void CAtcStationListModel::setStationMode(CAtcStationListModel::AtcStationMode stationMode) @@ -64,8 +62,7 @@ namespace BlackGui::Models m_columns.addColumn(CColumn("xc.", "AFV cross coupled", CAtcStation::IndexIsAfvCrossCoupled, new CBoolIconFormatter("AFV cross coupled", "not coupled"))); m_columns.addColumn(CColumn("range", CAtcStation::IndexRange, new CAirspaceDistanceFormatter())); m_columns.addColumnIncognito(CColumn::standardString("controllername", { CAtcStation::IndexController, CUser::IndexRealName })); - m_columns.addColumn(CColumn("from", "booked from", CAtcStation::IndexBookedFrom, new CDateTimeFormatter(CDateTimeFormatter::formatHm()))); - m_columns.addColumn(CColumn("until", "booked until", CAtcStation::IndexBookedUntil, new CDateTimeFormatter(CDateTimeFormatter::formatHm()))); + m_columns.addColumn(CColumn("until", "expected logoff time", CAtcStation::IndexLogoffTime, new CDateTimeFormatter(CDateTimeFormatter::formatHm()))); // default sort order this->setSortColumnByPropertyIndex(CAtcStation::IndexRelativeDistance); @@ -73,24 +70,6 @@ namespace BlackGui::Models } break; - case StationsBooked: - { - m_columns.addColumn(CColumn::standardString("cs.", "callsign", { CAtcStation::IndexCallsign, CCallsign::IndexCallsignStringAsSet })); - CColumn col = CColumn("type", CAtcStation::IndexIcon); - col.setSortPropertyIndex({ CAtcStation::IndexCallsign, CCallsign::IndexSuffix }); - m_columns.addColumn(col); - m_columns.addColumn(CColumn("", "on/offline", CAtcStation::IndexIsOnline, new CBoolLedFormatter("online", "offline"))); - m_columns.addColumnIncognito(CColumn::standardString("controllername", { CAtcStation::IndexController, CUser::IndexRealName })); - m_columns.addColumn(CColumn("from", "booked from", CAtcStation::IndexBookedFrom, new CDateTimeFormatter(CDateTimeFormatter::formatYmdhm()))); - m_columns.addColumn(CColumn("until", "booked until", CAtcStation::IndexBookedUntil, new CDateTimeFormatter(CDateTimeFormatter::formatYmdhm()))); - m_columns.addColumn(CColumn("frequency", CAtcStation::IndexFrequency, new CComFrequencyFormatter())); - - // default sort order - this->setSortColumnByPropertyIndex(CAtcStation::IndexBookedFrom); - m_sortOrder = Qt::AscendingOrder; - } - break; - default: qFatal("Wrong mode"); break; diff --git a/src/blackgui/models/atcstationlistmodel.h b/src/blackgui/models/atcstationlistmodel.h index e898e335b..37c979b4c 100644 --- a/src/blackgui/models/atcstationlistmodel.h +++ b/src/blackgui/models/atcstationlistmodel.h @@ -27,7 +27,6 @@ namespace BlackGui::Models enum AtcStationMode { NotSet, - StationsBooked, StationsOnline }; diff --git a/src/blackmisc/aviation/atcstation.cpp b/src/blackmisc/aviation/atcstation.cpp index 95827810f..9da095474 100644 --- a/src/blackmisc/aviation/atcstation.cpp +++ b/src/blackmisc/aviation/atcstation.cpp @@ -34,9 +34,9 @@ namespace BlackMisc::Aviation CAtcStation::CAtcStation(const CCallsign &callsign, const CUser &controller, const CFrequency &frequency, const CCoordinateGeodetic &pos, const CLength &range, bool isOnline, - const QDateTime &bookedFromUtc, const QDateTime &bookedUntilUtc, + const QDateTime &logoffTimeUtc, const CInformationMessage &atis, const CInformationMessage &metar) : m_callsign(callsign), m_controller(controller), m_frequency(frequency), m_position(pos), - m_range(range), m_isOnline(isOnline), m_bookedFromUtc(bookedFromUtc), m_bookedUntilUtc(bookedUntilUtc), + m_range(range), m_isOnline(isOnline), m_logoffTimeUtc(logoffTimeUtc), m_atis(atis), m_metar(metar) { // sync callsigns @@ -47,9 +47,9 @@ namespace BlackMisc::Aviation } } - bool CAtcStation::hasBookingTimes() const + bool CAtcStation::hasLogoffTimeUtc() const { - return !(m_bookedFromUtc.isNull() && m_bookedUntilUtc.isNull()); + return !m_logoffTimeUtc.isNull(); } bool CAtcStation::hasMetar() const @@ -125,18 +125,7 @@ namespace BlackMisc::Aviation u' ' % m_range.toQString(i18n) % // distance / bearing - u' ' % ICoordinateWithRelativePosition::convertToQString(i18n) % - - // booking from/until - u' ' % - (i18n ? fromUtcI18n : QStringLiteral("from(UTC)")) % - u' ' % - (m_bookedFromUtc.isNull() ? QStringLiteral("-") : m_bookedFromUtc.toString("yy-MM-dd HH:mm")) % - - u' ' % - (i18n ? untilUtcI18n : QStringLiteral("until(UTC)")) % - u' ' % - (m_bookedUntilUtc.isNull() ? QStringLiteral("-") : m_bookedUntilUtc.toString("yy-MM-dd HH:mm")); + u' ' % ICoordinateWithRelativePosition::convertToQString(i18n); return s; @@ -156,90 +145,6 @@ namespace BlackMisc::Aviation m_frequency.setUnit(CFrequencyUnit::MHz()); } - void CAtcStation::synchronizeControllerData(CAtcStation &otherStation) - { - if (m_controller == otherStation.getController()) { return; } - CUser otherController = otherStation.getController(); - m_controller.synchronizeData(otherController); - otherStation.setController(otherController); - } - - void CAtcStation::synchronizeWithBookedStation(CAtcStation &bookedStation) - { - if (bookedStation.getCallsign() != this->getCallsign()) { return; } - - // from online to booking - bookedStation.setOnline(true); - bookedStation.setFrequency(this->getFrequency()); - - // Logoff Zulu Time set? - // comes directly from the online controller and is most likely more accurate - if (!this->getBookedUntilUtc().isNull()) - { - bookedStation.setBookedUntilUtc(this->getBookedUntilUtc()); - } - - // from booking to online - // booked now stations have valid data and need no update - if (!this->isBookedNow() && bookedStation.hasValidBookingTimes()) - { - if (this->hasValidBookingTimes()) - { - if (bookedStation.isBookedNow()) - { - // can't get any better, we just copy from / to over - this->setBookedFromUntil(bookedStation); - } - else - { - // we already have some booking dates, we will verify those now - // and will set the most appropriate booking dates - const CTime timeDiffBooking(bookedStation.bookedWhen()); - const CTime timeDiffOnline(this->bookedWhen()); // diff to now - if (timeDiffBooking.isNegativeWithEpsilonConsidered() && timeDiffOnline.isNegativeWithEpsilonConsidered()) - { - // both in past - if (timeDiffBooking > timeDiffOnline) - { - this->setBookedFromUntil(bookedStation); - } - } - else if (timeDiffBooking.isPositiveWithEpsilonConsidered() && timeDiffOnline.isPositiveWithEpsilonConsidered()) - { - // both in future - if (timeDiffBooking < timeDiffOnline) - { - this->setBookedFromUntil(bookedStation); - } - } - else if (timeDiffBooking.isPositiveWithEpsilonConsidered() && timeDiffOnline.isNegativeWithEpsilonConsidered()) - { - // future booking is better than past booking - this->setBookedFromUntil(bookedStation); - } - } - } - else - { - // no booking info so far, so we just copy over - this->setBookedFromUntil(bookedStation); - } - } - - // both ways - this->synchronizeControllerData(bookedStation); - if (this->hasValidRelativeDistance()) - { - bookedStation.setRelativeDistance(this->getRelativeDistance()); - bookedStation.setRelativeBearing(this->getRelativeBearing()); - } - else if (bookedStation.hasValidRelativeDistance()) - { - this->setRelativeDistance(bookedStation.getRelativeDistance()); - this->setRelativeBearing(bookedStation.getRelativeBearing()); - } - } - bool CAtcStation::isInRange() const { if (m_range.isNull() || !hasValidRelativeDistance()) { return false; } @@ -253,27 +158,6 @@ namespace BlackMisc::Aviation return true; } - bool CAtcStation::hasValidBookingTimes() const - { - return !m_bookedFromUtc.isNull() && m_bookedFromUtc.isValid() && - !m_bookedUntilUtc.isNull() && m_bookedUntilUtc.isValid(); - } - - void CAtcStation::setBookedFromUntil(const CAtcStation &otherStation) - { - this->setBookedFromUtc(otherStation.getBookedFromUtc()); - this->setBookedUntilUtc(otherStation.getBookedUntilUtc()); - } - - bool CAtcStation::isBookedNow() const - { - if (!this->hasValidBookingTimes()) { return false; } - QDateTime now = QDateTime::currentDateTimeUtc(); - if (m_bookedFromUtc > now) { return false; } - if (now > m_bookedUntilUtc) { return false; } - return true; - } - bool CAtcStation::isComUnitTunedToFrequency(const CComSystem &comUnit) const { return comUnit.isActiveFrequencySameFrequency(this->getFrequency()); @@ -284,30 +168,6 @@ namespace BlackMisc::Aviation return CComSystem::isSameFrequency(frequency, this->getFrequency()); } - CTime CAtcStation::bookedWhen() const - { - if (!this->hasValidBookingTimes()) { return CTime(0, nullptr); } - QDateTime now = QDateTime::currentDateTimeUtc(); - qint64 diffMs; - if (m_bookedFromUtc > now) - { - // future - diffMs = now.msecsTo(m_bookedFromUtc); - return CTime(diffMs / 1000.0, CTimeUnit::s()); - } - else if (m_bookedUntilUtc > now) - { - // now - return CTime(0.0, CTimeUnit::s()); - } - else - { - // past - diffMs = m_bookedUntilUtc.msecsTo(now); - return CTime(-diffMs / 1000.0, CTimeUnit::s()); - } - } - const CInformationMessage &CAtcStation::getInformationMessage(CInformationMessage::InformationType type) const { switch (type) @@ -361,8 +221,7 @@ namespace BlackMisc::Aviation const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexBookedFrom: return QVariant::fromValue(m_bookedFromUtc); - case IndexBookedUntil: return QVariant::fromValue(m_bookedUntilUtc); + case IndexLogoffTime: return QVariant::fromValue(m_logoffTimeUtc); case IndexCallsign: return m_callsign.propertyByIndex(index.copyFrontRemoved()); case IndexCallsignString: return this->getCallsignAsString(); case IndexCallsignStringCrossCopuled: return this->getCallsignAsStringCrossCoupled(); @@ -394,8 +253,7 @@ namespace BlackMisc::Aviation const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexBookedFrom: this->setBookedFromUtc(variant.value()); break; - case IndexBookedUntil: this->setBookedUntilUtc(variant.value()); break; + case IndexLogoffTime: this->setLogoffTimeUtc(variant.value()); break; case IndexCallsign: m_callsign.setPropertyByIndex(index.copyFrontRemoved(), variant); break; case IndexController: m_controller.setPropertyByIndex(index.copyFrontRemoved(), variant); break; case IndexFrequency: m_frequency.setPropertyByIndex(index.copyFrontRemoved(), variant); break; @@ -432,8 +290,7 @@ namespace BlackMisc::Aviation const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexBookedFrom: return Compare::compare(this->getBookedFromUtc(), compareValue.getBookedFromUtc()); - case IndexBookedUntil: return Compare::compare(this->getBookedUntilUtc(), compareValue.getBookedUntilUtc()); + case IndexLogoffTime: return Compare::compare(this->getLogoffTimeUtc(), compareValue.getLogoffTimeUtc()); case IndexCallsignString: case IndexCallsignStringCrossCopuled: return m_callsign.comparePropertyByIndex(CPropertyIndexRef::empty(), compareValue.getCallsign()); diff --git a/src/blackmisc/aviation/atcstation.h b/src/blackmisc/aviation/atcstation.h index 96ac0cf5b..a07cb45ec 100644 --- a/src/blackmisc/aviation/atcstation.h +++ b/src/blackmisc/aviation/atcstation.h @@ -49,8 +49,7 @@ namespace BlackMisc::Aviation IndexIsInRange, IndexIsOnline, IndexIsAfvCrossCoupled, - IndexBookedFrom, - IndexBookedUntil, + IndexLogoffTime, IndexLatitude, IndexLongitude, IndexAtis, @@ -67,11 +66,11 @@ namespace BlackMisc::Aviation CAtcStation(const CCallsign &callsign, const Network::CUser &controller, const PhysicalQuantities::CFrequency &frequency, const Geo::CCoordinateGeodetic &pos, const PhysicalQuantities::CLength &range, - bool isOnline = false, const QDateTime &bookedFromUtc = QDateTime(), const QDateTime &bookedUntilUtc = QDateTime(), + bool isOnline = false, const QDateTime &logoffTimeUtc = QDateTime(), const CInformationMessage &atis = CInformationMessage(CInformationMessage::ATIS), const CInformationMessage &metar = CInformationMessage(CInformationMessage::METAR)); - //! Has booking times? - bool hasBookingTimes() const; + //! Has expected logoff time? + bool hasLogoffTimeUtc() const; //! Has ATIS? bool hasAtis() const { return m_atis.hasMessage(); } @@ -142,15 +141,6 @@ namespace BlackMisc::Aviation //! Set position void setPosition(const BlackMisc::Geo::CCoordinateGeodetic &position) { m_position = position; } - //! Synchronize controller data - //! Updates two stations (normally a booked and online ATC station) with complementary data - void synchronizeControllerData(CAtcStation &otherStation); - - //! Synchronize station data - //! Updates the two stations (a booked and online ATC station) with complementary data - //! \pre this object is the online station, the passed station the booked station - void synchronizeWithBookedStation(CAtcStation &bookedStation); - //! Get the radius of the controller's area of visibility. const PhysicalQuantities::CLength &getRange() const { return m_range; } @@ -160,7 +150,7 @@ namespace BlackMisc::Aviation //! In range? If range and distance to own aircraft are not available false bool isInRange() const; - //! Is station online (or just booked)? + //! Is station online? bool isOnline() const { return m_isOnline; } //! Set online @@ -172,25 +162,9 @@ namespace BlackMisc::Aviation //! Set AFV cross coupled void setAfvCrossCoupled(bool coupled) { m_isAfvCrossCoupled = coupled; } - //! Booked date/time if any. - //! This represents the closest booking within a time frame as there can be multiple bookings. - const QDateTime &getBookedFromUtc() const { return m_bookedFromUtc; } - - //! Booked date/time if any. - //! This represents the closest booking within a time frame as there can be multiple bookings. - const QDateTime &getBookedUntilUtc() const { return m_bookedUntilUtc; } - - //! Has valid booking times? - bool hasValidBookingTimes() const; - - //! Set booked from - void setBookedFromUtc(const QDateTime &from) { m_bookedFromUtc = from; } - - //! Transfer booking times - void setBookedFromUntil(const CAtcStation &otherStation); - - //! Booked now? - bool isBookedNow() const; + //! Return the expected logoff time (UTC). This data comes + //! from the controller through its ATIS line. + const QDateTime &getLogoffTimeUtc() const { return m_logoffTimeUtc; } //! Is Com unit tuned to this stations frequency bool isComUnitTunedToFrequency(const Aviation::CComSystem &comUnit) const; @@ -198,12 +172,6 @@ namespace BlackMisc::Aviation //! Is passed frequency the frequency of this station bool isAtcStationFrequency(const PhysicalQuantities::CFrequency &frequency) const; - //! When booked, 0 means now, - //! negative values mean booking in past, - //! positive values mean booking in future, - //! no booking dates will result in null time - PhysicalQuantities::CTime bookedWhen() const; - //! Get ATIS const CInformationMessage &getAtis() const { return m_atis; } @@ -228,8 +196,8 @@ namespace BlackMisc::Aviation //! Set given message bool setMessage(const CInformationMessage &message); - //! Set booked until - void setBookedUntilUtc(const QDateTime &until) { m_bookedUntilUtc = until; } + //! Set expected logoff time (UTC) + void setLogoffTimeUtc(const QDateTime &logoffTimeUtc) { m_logoffTimeUtc = logoffTimeUtc; } //! \copydoc Geo::ICoordinateGeodetic::latitude virtual Geo::CLatitude latitude() const override; @@ -269,8 +237,7 @@ namespace BlackMisc::Aviation PhysicalQuantities::CLength m_range; bool m_isOnline = false; bool m_isAfvCrossCoupled = false; - QDateTime m_bookedFromUtc; - QDateTime m_bookedUntilUtc; + QDateTime m_logoffTimeUtc; CInformationMessage m_atis { CInformationMessage::ATIS }; CInformationMessage m_metar { CInformationMessage::METAR }; @@ -283,8 +250,7 @@ namespace BlackMisc::Aviation BLACK_METAMEMBER(range), BLACK_METAMEMBER(isOnline), BLACK_METAMEMBER(isAfvCrossCoupled), - BLACK_METAMEMBER(bookedFromUtc), - BLACK_METAMEMBER(bookedUntilUtc), + BLACK_METAMEMBER(logoffTimeUtc), BLACK_METAMEMBER(atis), BLACK_METAMEMBER(metar), BLACK_METAMEMBER(relativeDistance), diff --git a/src/blackmisc/aviation/atcstationlist.cpp b/src/blackmisc/aviation/atcstationlist.cpp index 8a618be1a..d69bf9572 100644 --- a/src/blackmisc/aviation/atcstationlist.cpp +++ b/src/blackmisc/aviation/atcstationlist.cpp @@ -107,25 +107,6 @@ namespace BlackMisc::Aviation return copy; } - int CAtcStationList::synchronizeWithBookedStation(CAtcStation &bookedAtcStation) - { - int c = 0; - bookedAtcStation.setOnline(false); // reset - if (this->isEmpty()) return 0; - - for (auto i = this->begin(); i != this->end(); ++i) - { - if (i->getCallsign() != bookedAtcStation.getCallsign()) { continue; } - i->synchronizeWithBookedStation(bookedAtcStation); - c++; - } - - // normally 1 expected, as I should find - // only one online station for this booking - Q_ASSERT_X(c == 0 || c == 1, Q_FUNC_INFO, "Found >1 matching station"); - return c; - } - void CAtcStationList::sortByAtcSuffixSortOrderAndDistance() { this->sortBy(&CAtcStation::getSuffixSortOrder, &CAtcStation::getRelativeDistance); diff --git a/src/blackmisc/aviation/atcstationlist.h b/src/blackmisc/aviation/atcstationlist.h index b2ec3fbf3..13c0d28ea 100644 --- a/src/blackmisc/aviation/atcstationlist.h +++ b/src/blackmisc/aviation/atcstationlist.h @@ -68,11 +68,6 @@ namespace BlackMisc::Aviation //! Those in range CAtcStationList findInRange() const; - //! Synchronize with ATC station representing booking information. - //! Both sides (booking, online station) will be updated. - //! \pre Can be used only if the stored data in this list are online ATC stations - int synchronizeWithBookedStation(CAtcStation &bookedAtcStation); - //! Sort by ATC suffix sort order and distance void sortByAtcSuffixSortOrderAndDistance(); diff --git a/src/blackmisc/network/entityflags.cpp b/src/blackmisc/network/entityflags.cpp index 7248d14d5..a96d574fa 100644 --- a/src/blackmisc/network/entityflags.cpp +++ b/src/blackmisc/network/entityflags.cpp @@ -22,7 +22,6 @@ namespace BlackMisc::Network case AllEntities: return QStringLiteral("All"); case AllIcaoAndCountries: return QStringLiteral("All ICAO + country"); case AllIcaoEntities: return QStringLiteral("All ICAO"); - case BookingEntity: return QStringLiteral("VATSIM bookings"); case CountryEntity: return QStringLiteral("Country"); case DistributorEntity: return QStringLiteral("Distributor"); case DbInfoObjectEntity: return QStringLiteral("Info objects (DB)"); @@ -50,7 +49,6 @@ namespace BlackMisc::Network if (entities.testFlag(AircraftCategoryEntity)) list << QStringLiteral("Aircraft category"); if (entities.testFlag(AirlineIcaoEntity)) list << QStringLiteral("Airline ICAO"); if (entities.testFlag(AirportEntity)) list << QStringLiteral("Airport"); - if (entities.testFlag(BookingEntity)) list << QStringLiteral("VATSIM bookings"); if (entities.testFlag(CountryEntity)) list << QStringLiteral("Country"); if (entities.testFlag(DistributorEntity)) list << QStringLiteral("Distributor"); if (entities.testFlag(DbInfoObjectEntity)) list << QStringLiteral("Info objects (DB)"); diff --git a/src/blackmisc/network/entityflags.h b/src/blackmisc/network/entityflags.h index cdd28a172..9a4f64767 100644 --- a/src/blackmisc/network/entityflags.h +++ b/src/blackmisc/network/entityflags.h @@ -33,13 +33,12 @@ namespace BlackMisc::Network DistributorEntity = 1 << 5, //!< distributors LiveryEntity = 1 << 6, //!< liveries ModelEntity = 1 << 7, //!< models - BookingEntity = 1 << 8, //!< bookings - MetarEntity = 1 << 9, //!< METAR - VatsimDataFile = 1 << 10, //!< the VATSIM data file (multiple data entities) - VatsimStatusFile = 1 << 11, //!< the VATSIM status file (URLs for data files etc.) - AirportEntity = 1 << 12, //!< airports - AircraftCategoryEntity = 1 << 13, //!< aircraft category entities - AllEntities = ((1 << 14) - 1), //!< everything + MetarEntity = 1 << 8, //!< METAR + VatsimDataFile = 1 << 9, //!< the VATSIM data file (multiple data entities) + VatsimStatusFile = 1 << 10, //!< the VATSIM status file (URLs for data files etc.) + AirportEntity = 1 << 11, //!< airports + AircraftCategoryEntity = 1 << 12, //!< aircraft category entities + AllEntities = ((1 << 13) - 1), //!< everything AllIcaoEntities = AircraftIcaoEntity | AirlineIcaoEntity, //!< all ICAO codes AllIcaoAndCountries = AircraftIcaoEntity | AirlineIcaoEntity | CountryEntity, //!< all ICAO codes and countries AllIcaoCountriesCategory = AllIcaoAndCountries | AircraftCategoryEntity, //!< includes category diff --git a/src/blackmisc/test/testdata.cpp b/src/blackmisc/test/testdata.cpp index bd6e5c904..554eabf6c 100644 --- a/src/blackmisc/test/testdata.cpp +++ b/src/blackmisc/test/testdata.cpp @@ -91,7 +91,7 @@ namespace BlackMisc::Test { static const CAtcStation t(CCallsign("EDDM_TWR"), CUser("654321", "John Doe"), CFrequency(119.9, CFrequencyUnit::MHz()), CTestData::getCoordinateFrankfurtTower(), CLength(50, CLengthUnit::km()), - false, QDateTime::currentDateTimeUtc().addSecs(7200), QDateTime::currentDateTimeUtc().addSecs(9500)); + false); return t; } @@ -99,7 +99,7 @@ namespace BlackMisc::Test { static const CAtcStation t(CCallsign("EDDF_TWR"), CUser("654321", "Joe Bar"), CFrequency(118.7, CFrequencyUnit::MHz()), CTestData::getCoordinateMunichTower(), CLength(50, CLengthUnit::km()), - true, QDateTime::currentDateTimeUtc().addSecs(-3600), QDateTime::currentDateTimeUtc().addSecs(2400)); + true, QDateTime::currentDateTimeUtc().addSecs(2400)); return t; } @@ -108,7 +108,7 @@ namespace BlackMisc::Test static const CAtcStation t(CCallsign("eddm_app"), CUser("654321", "Jen Doe"), CFrequency(120.7, CFrequencyUnit::MHz()), CTestData::getCoordinateMunichTower(), CLength(100, CLengthUnit::km()), - false, QDateTime::currentDateTimeUtc().addSecs(1000), QDateTime::currentDateTimeUtc().addSecs(2000)); + false); return t; } diff --git a/src/blackmisc/test/testing.cpp b/src/blackmisc/test/testing.cpp index ae29c6ca2..36b192f6c 100644 --- a/src/blackmisc/test/testing.cpp +++ b/src/blackmisc/test/testing.cpp @@ -48,8 +48,6 @@ namespace BlackMisc::Test const QString id = QStringLiteral("00000%1").arg(index).right(6); const double f = 118.0 + (index % 30) * 0.25; - const QDateTime dtFrom = QDateTime::currentDateTimeUtc(); - const QDateTime dtUntil = dtFrom.addSecs(60 * 60); // 1 hour const CUser user(id, usr); const CInformationMessage atis(CInformationMessage::ATIS, "ATIS for " + QString::number(index)); const CInformationMessage metar(CInformationMessage::METAR, "Metar for " + QString::number(index)); @@ -63,8 +61,6 @@ namespace BlackMisc::Test station.setPropertyByIndex(CAtcStation::IndexRange, CVariant::from(CLength(50, CLengthUnit::km()))); station.setPropertyByIndex(CAtcStation::IndexPosition, CVariant::from(geoPos)); station.setPropertyByIndex(CAtcStation::IndexIsOnline, CVariant::from(false)); - station.setPropertyByIndex(CAtcStation::IndexBookedFrom, CVariant::from(dtFrom)); - station.setPropertyByIndex(CAtcStation::IndexBookedUntil, CVariant::from(dtUntil)); station.setPropertyByIndex(CAtcStation::IndexRelativeDistance, CVariant::from(CLength(index + 1, CLengthUnit::NM()))); station.setPropertyByIndex(CAtcStation::IndexAtis, CVariant::from(atis)); station.setPropertyByIndex(CAtcStation::IndexMetar, CVariant::from(metar)); @@ -73,7 +69,7 @@ namespace BlackMisc::Test { station = CAtcStation(CCallsign(cs, CCallsign::Atc), user, CFrequency(f, CFrequencyUnit::MHz()), - geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil); + geoPos, CLength(50, CLengthUnit::km()), false); station.setRelativeDistance(CLength(index + 1, CLengthUnit::NM())); station.setAtis(atis); station.setMetar(metar); diff --git a/src/swiftguistandard/swiftguistd.ui b/src/swiftguistandard/swiftguistd.ui index 954aea666..3beda9168 100644 --- a/src/swiftguistandard/swiftguistd.ui +++ b/src/swiftguistandard/swiftguistd.ui @@ -578,7 +578,6 @@ menuClicked() networkServerSelected(QModelIndex) alterTrafficServer() - reloadAtcStationsBooked() onlineAtcStationSelected(QModelIndex) commandEntered() getMetar() diff --git a/tests/blackmisc/aviation/testaviation/testaviation.cpp b/tests/blackmisc/aviation/testaviation/testaviation.cpp index d562c316d..78b0fe6cc 100644 --- a/tests/blackmisc/aviation/testaviation/testaviation.cpp +++ b/tests/blackmisc/aviation/testaviation/testaviation.cpp @@ -339,9 +339,9 @@ namespace BlackMiscTest const CCallsign call2("edds_n_app", CCallsign::Atc); QVERIFY2(call1 == call2, "Callsigns shall be equal"); - const CAtcStation atc1(c1, user1, f1, situation1.getPosition(), CLength(), false, QDateTime(), QDateTime(), CInformationMessage(CInformationMessage::ATIS, "foo")); - const CAtcStation atc2(c1, user1, f1, situation1.getPosition(), CLength(), false, QDateTime(), QDateTime(), CInformationMessage(CInformationMessage::ATIS, "foo")); - const CAtcStation atc3(c1, user1, f1, situation1.getPosition(), CLength(), false, QDateTime(), QDateTime(), CInformationMessage(CInformationMessage::ATIS, "bar")); + const CAtcStation atc1(c1, user1, f1, situation1.getPosition(), CLength(), false, QDateTime(), CInformationMessage(CInformationMessage::ATIS, "foo")); + const CAtcStation atc2(c1, user1, f1, situation1.getPosition(), CLength(), false, QDateTime(), CInformationMessage(CInformationMessage::ATIS, "foo")); + const CAtcStation atc3(c1, user1, f1, situation1.getPosition(), CLength(), false, QDateTime(), CInformationMessage(CInformationMessage::ATIS, "bar")); QVERIFY2(atc1 == atc2, "ATC stations shall be equal"); QVERIFY2(atc1 != atc3, "ATC stations shall not be equal"); } diff --git a/tests/blackmisc/testvariantandmap/testvariantandmap.cpp b/tests/blackmisc/testvariantandmap/testvariantandmap.cpp index 185f25f2d..a6c8c9c24 100644 --- a/tests/blackmisc/testvariantandmap/testvariantandmap.cpp +++ b/tests/blackmisc/testvariantandmap/testvariantandmap.cpp @@ -87,19 +87,15 @@ namespace BlackMiscTest void CTestVariantAndMap::variant() { // ATC station - QDateTime dtFrom = QDateTime::currentDateTimeUtc(); - QDateTime dtUntil = dtFrom.addSecs(60 * 60); // 1 hour - QDateTime dtFrom2 = dtUntil; - QDateTime dtUntil2 = dtUntil.addSecs(60 * 60); CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() }); CAtcStation station1(CCallsign("eddm_twr"), CUser("123456", "Joe Doe"), CFrequency(118.7, CFrequencyUnit::MHz()), - geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil); + geoPos, CLength(50, CLengthUnit::km()), false); CAtcStation station2(station1); CAtcStation station3(CCallsign("eddm_app"), CUser("654321", "Jen Doe"), CFrequency(120.7, CFrequencyUnit::MHz()), - geoPos, CLength(100, CLengthUnit::km()), false, dtFrom2, dtUntil2); + geoPos, CLength(100, CLengthUnit::km()), false); // compare CLength l1(0, nullptr); @@ -165,13 +161,11 @@ namespace BlackMiscTest void CTestVariantAndMap::valueMap() { // ATC station - QDateTime dtFrom = QDateTime::currentDateTimeUtc(); - QDateTime dtUntil = dtFrom.addSecs(60 * 60); // 1 hour CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() }); CAtcStation station1(CCallsign("eddm_twr"), CUser("123456", "Joe Doe"), CFrequency(118.7, CFrequencyUnit::MHz()), - geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil); + geoPos, CLength(50, CLengthUnit::km()), false); // value maps CPropertyIndexVariantMap vmWildcard(true);