diff --git a/src/blackcore/airspace_monitor.cpp b/src/blackcore/airspace_monitor.cpp index d9ee27e6d..d9fca7c6b 100644 --- a/src/blackcore/airspace_monitor.cpp +++ b/src/blackcore/airspace_monitor.cpp @@ -31,7 +31,7 @@ namespace BlackCore this->connect(this->m_network, &INetwork::atisVoiceRoomReplyReceived, this, &CAirspaceMonitor::ps_atisVoiceRoomReceived); this->connect(this->m_network, &INetwork::atisLogoffTimeReplyReceived, this, &CAirspaceMonitor::ps_atisLogoffTimeReceived); this->connect(this->m_network, &INetwork::metarReplyReceived, this, &CAirspaceMonitor::ps_metarReceived); - this->connect(this->m_network, &INetwork::flightPlanReplyReceived, this, &CAirspaceMonitor::ps_flightplanReceived); + this->connect(this->m_network, &INetwork::flightPlanReplyReceived, this, &CAirspaceMonitor::ps_flightPlanReceived); this->connect(this->m_network, &INetwork::realNameReplyReceived, this, &CAirspaceMonitor::ps_realNameReplyReceived); this->connect(this->m_network, &INetwork::icaoCodesReplyReceived, this, &CAirspaceMonitor::ps_icaoCodesReceived); this->connect(this->m_network, &INetwork::pilotDisconnected, this, &CAirspaceMonitor::ps_pilotDisconnected); @@ -434,9 +434,9 @@ namespace BlackCore // Logic to set logoff time bool ok; int h = zuluTime.left(2).toInt(&ok); - if (!ok) return; + if (!ok) { return; } int m = zuluTime.right(2).toInt(&ok); - if (!ok) return; + if (!ok) { return; } QDateTime logoffDateTime = QDateTime::currentDateTimeUtc(); logoffDateTime.setTime(QTime(h, m)); CIndexVariantMap vm(CAtcStation::IndexBookedUntil, logoffDateTime); diff --git a/src/blackcore/airspace_monitor.h b/src/blackcore/airspace_monitor.h index f566a16c8..fcd132dc0 100644 --- a/src/blackcore/airspace_monitor.h +++ b/src/blackcore/airspace_monitor.h @@ -106,7 +106,7 @@ namespace BlackCore //! Own aircraft model updated void setOwnAircraftModel(const BlackMisc::Network::CAircraftModel &model) { m_ownAircraftModel = model; } - + public: //! Clear the contents void clear() @@ -122,16 +122,16 @@ namespace BlackCore private: BlackMisc::Aviation::CAtcStationList m_atcStationsOnline; BlackMisc::Aviation::CAtcStationList m_atcStationsBooked; - BlackMisc::Aviation::CAircraftList m_aircraftsInRange; - BlackMisc::Network::CClientList m_otherClients; + BlackMisc::Aviation::CAircraftList m_aircraftsInRange; + BlackMisc::Network::CClientList m_otherClients; QMap m_metarCache; QMap m_flightPlanCache; - BlackMisc::Aviation::CAircraft m_ownAircraft; + BlackMisc::Aviation::CAircraft m_ownAircraft; BlackMisc::Network::CAircraftModel m_ownAircraftModel; INetwork *m_network; - CVatsimBookingReader *m_vatsimBookingReader; + CVatsimBookingReader *m_vatsimBookingReader; CVatsimDataFileReader *m_vatsimDataFileReader; // FIXME (MS) should be in INetwork @@ -145,8 +145,7 @@ namespace BlackCore void ps_fsipirCustomPacketReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &, const QString &, const QString &, const QString &model); void ps_serverReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &server); void ps_metarReceived(const QString &metarMessage); - void ps_flightplanReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CFlightPlan &flightPlan); - void ps_receivedBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations); + void ps_flightPlanReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CFlightPlan &flightPlan); void ps_atcPositionUpdate(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &frequency, const BlackMisc::Geo::CCoordinateGeodetic &position, const BlackMisc::PhysicalQuantities::CLength &range); void ps_atcControllerDisconnected(const BlackMisc::Aviation::CCallsign &callsign); void ps_atisReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CInformationMessage &atisMessage); @@ -156,6 +155,10 @@ namespace BlackCore void ps_aircraftUpdateReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CTransponder &transponder); void ps_pilotDisconnected(const BlackMisc::Aviation::CCallsign &callsign); void ps_frequencyReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &frequency); + + void ps_receivedBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations); + void ps_receivedDataFile(); + }; } // namespace diff --git a/src/blackcore/context_network.h b/src/blackcore/context_network.h index 11ac1967b..8cbf10d9f 100644 --- a/src/blackcore/context_network.h +++ b/src/blackcore/context_network.h @@ -95,7 +95,7 @@ namespace BlackCore void connectionTerminated(); /*! - * \brief Connection status changed + * Connection status changed * \param from old status * \param to new status * \param message further details @@ -113,7 +113,7 @@ namespace BlackCore virtual void readAtcBookingsFromSource() const = 0; /*! - * \brief The ATC list with online ATC controllers + * The ATC list with online ATC controllers * \remarks If I make this &getAtcStations XML is not generated correctly */ virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsOnline() const = 0; @@ -140,19 +140,19 @@ namespace BlackCore virtual BlackMisc::Network::CClientList getOtherClientsForCallsigns(const BlackMisc::Aviation::CCallsignList &callsigns) const = 0; /*! - * \brief Connect to Network + * Connect to Network * \return messages gererated during connecting * \see INetwork::LoginMode */ virtual BlackMisc::CStatusMessageList connectToNetwork(uint loginMode) = 0; /*! - * \brief Disconnect from network + * Disconnect from network * \return messages generated during disconnecting */ virtual BlackMisc::CStatusMessageList disconnectFromNetwork() = 0; - //! \brief Network connected? + //! Network connected? virtual bool isConnected() const = 0; //! Text messages (radio and private chat messages) @@ -165,7 +165,7 @@ namespace BlackCore virtual BlackMisc::Aviation::CFlightPlan loadFlightPlanFromNetwork(const BlackMisc::Aviation::CCallsign &callsign) const = 0; /*! - * \brief Get METAR, if not available request it + * Get METAR, if not available request it * \param airportIcaoCode such as EDDF, KLAX * \return */ diff --git a/src/blackcore/context_network_impl.cpp b/src/blackcore/context_network_impl.cpp index 27f90986e..84d6e9f36 100644 --- a/src/blackcore/context_network_impl.cpp +++ b/src/blackcore/context_network_impl.cpp @@ -45,19 +45,19 @@ namespace BlackCore // 1. Init by "network driver" this->m_network = new CNetworkVatlib(this); - this->connect(this->m_network, &INetwork::connectionStatusChanged, this, &CContextNetwork::ps_FsdConnectionStatusChanged); - this->connect(this->m_network, &INetwork::textMessagesReceived, this, &CContextNetwork::ps_FsdTextMessageReceived); + this->connect(this->m_network, &INetwork::connectionStatusChanged, this, &CContextNetwork::ps_fsdConnectionStatusChanged); + this->connect(this->m_network, &INetwork::textMessagesReceived, this, &CContextNetwork::ps_fsdTextMessageReceived); // 2. VATSIM bookings this->m_vatsimBookingReader = new CVatsimBookingReader(this->getRuntime()->getIContextSettings()->getNetworkSettings().getBookingServiceUrl(), this); - this->connect(this->m_vatsimBookingReader, &CVatsimBookingReader::dataRead, this, &CContextNetwork::ps_ReceivedBookings); + this->connect(this->m_vatsimBookingReader, &CVatsimBookingReader::dataRead, this, &CContextNetwork::ps_receivedBookings); this->m_vatsimBookingReader->read(); // first read this->m_vatsimBookingReader->setInterval(180 * 1000); // 3. VATSIM data file const QStringList dataFileUrls = { "http://info.vroute.net/vatsim-data.txt" }; this->m_vatsimDataFileReader = new CVatsimDataFileReader(dataFileUrls, this); - this->connect(this->m_vatsimDataFileReader, &CVatsimDataFileReader::dataRead, this, &CContextNetwork::ps_DataFileRead); + this->connect(this->m_vatsimDataFileReader, &CVatsimDataFileReader::dataRead, this, &CContextNetwork::ps_dataFileRead); this->m_vatsimDataFileReader->read(); // first read this->m_vatsimDataFileReader->setInterval(90 * 1000); @@ -267,9 +267,8 @@ namespace BlackCore /* * Connection status changed */ - void CContextNetwork::ps_FsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to, const QString &message) + void CContextNetwork::ps_fsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to, const QString &message) { - this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, { QString::number(from), QString::number(to) }); INetwork::ConnectionStatus fromOld = this->m_currentStatus; this->m_currentStatus = to; @@ -310,17 +309,19 @@ namespace BlackCore /* * Data file (VATSIM) has been read */ - void CContextNetwork::ps_DataFileRead() + void CContextNetwork::ps_dataFileRead() { this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO); - // TODO (MS) no test for if (this->getIContextApplication()) here? - this->getIContextApplication()->sendStatusMessage(CStatusMessage::getInfoMessage("Read VATSIM data file", CStatusMessage::TypeTrafficNetwork)); + if (this->getIContextApplication()) + { + this->getIContextApplication()->sendStatusMessage(CStatusMessage::getInfoMessage("Read VATSIM data file", CStatusMessage::TypeTrafficNetwork)); + } } /* * Radio text message received */ - void CContextNetwork::ps_FsdTextMessageReceived(const CTextMessageList &messages) + void CContextNetwork::ps_fsdTextMessageReceived(const CTextMessageList &messages) { this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, messages.toQString()); this->textMessagesReceived(messages); // relay @@ -333,7 +334,7 @@ namespace BlackCore return this->getRuntime()->getCContextOwnAircraft()->ownAircraft(); } - void CContextNetwork::ps_ChangedOwnAircraft(const CAircraft &aircraft, const QString &originator) + void CContextNetwork::ps_changedOwnAircraft(const CAircraft &aircraft, const QString &originator) { Q_ASSERT(this->m_network); Q_UNUSED(originator); @@ -352,7 +353,7 @@ namespace BlackCore /* * Updated bookings */ - void CContextNetwork::ps_ReceivedBookings(const CAtcStationList &) + void CContextNetwork::ps_receivedBookings(const CAtcStationList &) { // TODO (MS) no test for if (this->getIContextApplication()) here? this->getIContextApplication()->sendStatusMessage(CStatusMessage::getInfoMessage("Read bookings from network", CStatusMessage::TypeTrafficNetwork)); diff --git a/src/blackcore/context_network_impl.h b/src/blackcore/context_network_impl.h index d583cd7ff..8e182d419 100644 --- a/src/blackcore/context_network_impl.h +++ b/src/blackcore/context_network_impl.h @@ -7,11 +7,11 @@ * contained in the LICENSE file. */ +//! \file + #ifndef BLACKCORE_CONTEXTNETWORK_IMPL_H #define BLACKCORE_CONTEXTNETWORK_IMPL_H -//! \file - #include "blackcore/context_network.h" #include "blackcore/context_settings.h" #include "blackcore/context_runtime.h" @@ -175,23 +175,23 @@ namespace BlackCore private slots: //! Own aircraft was updated - void ps_ChangedOwnAircraft(const BlackMisc::Aviation::CAircraft &aircraft, const QString &originator); + void ps_changedOwnAircraft(const BlackMisc::Aviation::CAircraft &aircraft, const QString &originator); //! ATC bookings received - void ps_ReceivedBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations); + void ps_receivedBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations); //! Data file has been read - void ps_DataFileRead(); + void ps_dataFileRead(); /*! * \brief Connection status changed? * \param from old status * \param to new status */ - void ps_FsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to, const QString &message); + void ps_fsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to, const QString &message); //! Radio text messages received - void ps_FsdTextMessageReceived(const BlackMisc::Network::CTextMessageList &messages); + void ps_fsdTextMessageReceived(const BlackMisc::Network::CTextMessageList &messages); }; } diff --git a/src/blackcore/context_runtime.cpp b/src/blackcore/context_runtime.cpp index ef9768a97..db7964cea 100644 --- a/src/blackcore/context_runtime.cpp +++ b/src/blackcore/context_runtime.cpp @@ -457,7 +457,7 @@ namespace BlackCore // inject updated own aircraft to network c = this->connect(this->m_contextOwnAircraft, &IContextOwnAircraft::changedAircraft, - this->getCContextNetwork(), &CContextNetwork::ps_ChangedOwnAircraft); + this->getCContextNetwork(), &CContextNetwork::ps_changedOwnAircraft); Q_ASSERT(c); } } diff --git a/src/blackcore/vatsimbookingreader.h b/src/blackcore/vatsimbookingreader.h index f838dc374..5bd39eddd 100644 --- a/src/blackcore/vatsimbookingreader.h +++ b/src/blackcore/vatsimbookingreader.h @@ -7,11 +7,11 @@ * contained in the LICENSE file. */ +//! \file + #ifndef BLACKCORE_VATSIMBOOKINGREADER_H #define BLACKCORE_VATSIMBOOKINGREADER_H -//! \file - #include "blackmisc/threadedreader.h" #include "blackmisc/avatcstationlist.h" diff --git a/src/blackcore/vatsimdatafilereader.cpp b/src/blackcore/vatsimdatafilereader.cpp index f8da5c745..261f64478 100644 --- a/src/blackcore/vatsimdatafilereader.cpp +++ b/src/blackcore/vatsimdatafilereader.cpp @@ -304,7 +304,7 @@ namespace BlackCore } // read success nwReply->close(); - nwReply->deleteLater(); // we are responsible for reading this + nwReply->deleteLater(); // we are responsible for deleting this emit this->dataRead(); // warnings, if required diff --git a/src/blackcore/vatsimdatafilereader.h b/src/blackcore/vatsimdatafilereader.h index 60f05167b..38f4978d0 100644 --- a/src/blackcore/vatsimdatafilereader.h +++ b/src/blackcore/vatsimdatafilereader.h @@ -37,7 +37,7 @@ namespace BlackCore //! Constructor explicit CVatsimDataFileReader(const QStringList &urls, QObject *parent = nullptr); - //! Read / re-read bookings + //! Read / re-read data file void read(); //! Get aircrafts @@ -92,9 +92,12 @@ namespace BlackCore QStringList m_serviceUrls; /*!< URL of the service */ int m_currentUrlIndex; QNetworkAccessManager *m_networkManager; - BlackMisc::Network::CServerList m_voiceServers; + BlackMisc::Network::CServerList m_voiceServers; BlackMisc::Aviation::CAtcStationList m_atcStations; - BlackMisc::Aviation::CAircraftList m_aircrafts; + BlackMisc::Aviation::CAircraftList m_aircrafts; + QMap m_voiceCapabilities; + + //! Split line and assign values to their corresponding attribute names static const QMap clientPartsToMap(const QString ¤tLine, const QStringList &clientSectionAttributes); //! Section in file @@ -112,7 +115,6 @@ namespace BlackCore signals: //! Data have been read void dataRead(); - }; } diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index 9c5a23875..3126c832d 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -40,9 +40,10 @@ namespace BlackGui Q_ASSERT(connected); connect(this, &QTabWidget::currentChanged, this, &CAtcStationComponent::ps_atcStationsTabChanged); connect(this->ui->tvp_AtcStationsOnline, &QTableView::clicked, this, &CAtcStationComponent::ps_onlineAtcStationSelected); - connect(this->ui->pb_AtcStationsAtisReload, &QPushButton::clicked, this, &CAtcStationComponent::ps_requestAtis); - connect(this->ui->pb_ReloadAtcStationsBooked, &QPushButton::clicked, this, &CAtcStationComponent::ps_reloadAtcStationsBooked); connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::testRequestDummyAtcOnlineStations, this, &CAtcStationComponent::ps_testCreateDummyOnlineAtcStations); + connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestUpdate, this->m_timerComponent, &CTimerBasedComponent::fireTimer); + connect(this->ui->pb_AtcStationsAtisReload, &QPushButton::clicked, this, &CAtcStationComponent::ps_requestAtis); + connect(this->ui->tvp_AtcStationsBooked, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::ps_reloadAtcStationsBooked); } CAtcStationComponent::~CAtcStationComponent() diff --git a/src/blackmisc/avatcstationlist.cpp b/src/blackmisc/avatcstationlist.cpp index a726e9e48..981fd493c 100644 --- a/src/blackmisc/avatcstationlist.cpp +++ b/src/blackmisc/avatcstationlist.cpp @@ -104,9 +104,9 @@ namespace BlackMisc } /* - * Merge with booking + * Merge with booking, both (online/booking will be updated) */ - int CAtcStationList::mergeWithBooking(CAtcStation &bookedAtcStation) + int CAtcStationList::mergeWithBooking(CAtcStation &bookedAtcStation) { int c = 0; bookedAtcStation.setOnline(false); // reset @@ -170,9 +170,13 @@ namespace BlackMisc // both ways onlineAtcStation.syncronizeControllerData(bookedAtcStation); if (onlineAtcStation.hasValidDistance()) + { bookedAtcStation.setDistanceToPlane(onlineAtcStation.getDistanceToPlane()); + } else if (bookedAtcStation.hasValidDistance()) + { onlineAtcStation.setDistanceToPlane(bookedAtcStation.getDistanceToPlane()); + } // update *i = onlineAtcStation; @@ -181,6 +185,7 @@ namespace BlackMisc // normally 1 expected, as I should find // only one online station for this booking + Q_ASSERT(c == 0 || c == 1); return c; } diff --git a/src/blackmisc/avatcstationlist.h b/src/blackmisc/avatcstationlist.h index 461d314e4..a74d13738 100644 --- a/src/blackmisc/avatcstationlist.h +++ b/src/blackmisc/avatcstationlist.h @@ -54,7 +54,8 @@ namespace BlackMisc //! Update distances to coordinate, usually own aircraft's position void calculateDistancesToPlane(const BlackMisc::Geo::CCoordinateGeodetic &position); - //! Merge with ATC station representing booking information + //! Merge with ATC station representing booking information. + //! Both sides (booking, online station) will be updated. //! \remarks Can be used if the stored data in this list are online ATC stations int mergeWithBooking(CAtcStation &bookedAtcStation); diff --git a/src/blackmisc/blackmiscfreefunctions.cpp b/src/blackmisc/blackmiscfreefunctions.cpp index 8815ff1c9..d6ba2081f 100644 --- a/src/blackmisc/blackmiscfreefunctions.cpp +++ b/src/blackmisc/blackmiscfreefunctions.cpp @@ -226,7 +226,9 @@ bool BlackMisc::equalQVariants(const QVariant &v1, const QVariant &v2) */ int BlackMisc::compareQVariants(const QVariant &v1, const QVariant &v2) { - if (v1 == v2) return 0; // compares on primitives or on address + // Compares this QVariant with v and returns true if they are equal; otherwise returns false. + // In the case of custom types, their equalness operators are not called. Instead the values' addresses are compared. + if (v1 == v2) return 0; if (!v1.isValid() || !v2.isValid()) qFatal("Invalid variants"); if (v1.type() != v2.type()) qFatal("Mismatching types"); @@ -274,7 +276,7 @@ int BlackMisc::compareQVariants(const QVariant &v1, const QVariant &v2) break; } - // BlackObject + // CValueObject if (v1Type == QMetaType::User) { const CValueObject *cs1 = CValueObject::fromQVariant(v1); diff --git a/src/blackmisc/nwvoicecapabilites.cpp b/src/blackmisc/nwvoicecapabilites.cpp index 915648b30..46f0f3c10 100644 --- a/src/blackmisc/nwvoicecapabilites.cpp +++ b/src/blackmisc/nwvoicecapabilites.cpp @@ -24,7 +24,7 @@ namespace BlackMisc */ CVoiceCapabilities::CVoiceCapabilities(const QString &flightPlanRemarks) { - this->fromFlightPlanRemarks(flightPlanRemarks); + this->setFromFlightPlanRemarks(flightPlanRemarks); } /* @@ -50,8 +50,8 @@ namespace BlackMisc static const QString r("voice listening only"); return r; } - default: case Unknown: + default: { static const QString u("unknown"); return u; @@ -61,15 +61,16 @@ namespace BlackMisc return QString(""); // never reached } - void CVoiceCapabilities::fromFlightPlanRemarks(const QString &flightPlanRemarks) + void CVoiceCapabilities::setFromFlightPlanRemarks(const QString &flightPlanRemarks) { + // http://www.vatpac.org/cms/index.php?option=com_content&view=article&id=608&Itemid=213 if (flightPlanRemarks.isEmpty()) { - this->m_voiceCapabilities = Unknown; + this->setCapabilities(Unknown); return; } - QString r = flightPlanRemarks.toLower(); + const QString r = flightPlanRemarks.toLower(); if (r.contains("/v/") || r.contains("/voice/")) { this->setCapabilities(Voice); diff --git a/src/blackmisc/nwvoicecapabilities.h b/src/blackmisc/nwvoicecapabilities.h index b40b93fb8..2934f5536 100644 --- a/src/blackmisc/nwvoicecapabilities.h +++ b/src/blackmisc/nwvoicecapabilities.h @@ -27,7 +27,7 @@ namespace BlackMisc { public: - //!< Voice capabilities + //! Voice capabilities enum VoiceCapabilities { Unknown, diff --git a/src/blackmisc/sharedlockablepointer.h b/src/blackmisc/sharedlockablepointer.h index d9003f0fb..02b28ba30 100644 --- a/src/blackmisc/sharedlockablepointer.h +++ b/src/blackmisc/sharedlockablepointer.h @@ -17,7 +17,8 @@ namespace BlackMisc { - /*! Wrapper container for shared lockable pointer. + /*! + * Wrapper container for shared lockable pointer. * Provides BasicLockable characteristics to be used * with std::lock_guard */ diff --git a/src/blackmisc/testing.cpp b/src/blackmisc/testing.cpp index 4a69a78bd..8defceebc 100644 --- a/src/blackmisc/testing.cpp +++ b/src/blackmisc/testing.cpp @@ -8,6 +8,7 @@ */ #include "testing.h" +#include "nwvoicecapabilities.h" using namespace BlackMisc; using namespace BlackMisc::Geo; @@ -34,20 +35,20 @@ namespace BlackMisc // from WGS is slow, so static const (only 1 time init) // https://dev.vatsim-germany.org/issues/322#note-2 static const CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", CLength(index, CLengthUnit::ft())); - QString cs = QString("%1_TWR").arg(index); QString usr = QString("Joe %1").arg(index); QString id = QString("00000%1").arg(index).right(6); double f = 118.0 + (index % 30) * 0.25; - QDateTime dtFrom = QDateTime::currentDateTimeUtc(); - QDateTime dtUntil = dtFrom.addSecs(60 * 60.0); // 1 hour + const QDateTime dtFrom = QDateTime::currentDateTimeUtc(); + const QDateTime dtUntil = dtFrom.addSecs(60 * 60.0); // 1 hour + const CUser user(id, usr); if (byPropertyIndex) { CAtcStation station; station.setPropertyByIndex(CCallsign(cs).toQVariant(), CAtcStation::IndexCallsign); - station.setPropertyByIndex(CUser(id, usr).toQVariant(), CAtcStation::IndexController); + station.setPropertyByIndex(user.toQVariant(), CAtcStation::IndexController); station.setPropertyByIndex(CFrequency(f, CFrequencyUnit::MHz()).toQVariant(), CAtcStation::IndexFrequency); station.setPropertyByIndex(CLength(50, CLengthUnit::km()).toQVariant(), CAtcStation::IndexRange); station.setPropertyByIndex(geoPos.toQVariant(), CAtcStation::IndexPosition); @@ -59,7 +60,7 @@ namespace BlackMisc } else { - CAtcStation station(CCallsign(cs), CUser(id, usr), + CAtcStation station(CCallsign(cs), user, CFrequency(f, CFrequencyUnit::MHz()), geoPos, CLength(50, CLengthUnit::km()), false, dtFrom, dtUntil); station.setDistanceToPlane(CLength(index + 1, CLengthUnit::NM())); @@ -134,7 +135,6 @@ namespace BlackMisc } } - void CTesting::parseWgs(int times) { static QStringList wgsLatLng( diff --git a/src/blackmisc/testing.h b/src/blackmisc/testing.h index ce959e505..a50bb5dae 100644 --- a/src/blackmisc/testing.h +++ b/src/blackmisc/testing.h @@ -12,8 +12,7 @@ #ifndef BLACKMISC_TESTING_H #define BLACKMISC_TESTING_H -#include "avallclasses.h" - +#include "avatcstationlist.h" /*! * Generate data for testing purposes. diff --git a/src/blackmisc/threadedreader.h b/src/blackmisc/threadedreader.h index b90d86d3d..13e200304 100644 --- a/src/blackmisc/threadedreader.h +++ b/src/blackmisc/threadedreader.h @@ -19,13 +19,13 @@ #include #include -// Header only class, to avoid orward instantiation across subprojects - namespace BlackMisc { /*! * Support for threaded based reading and parsing tasks such * as data files via http, or file system and parsing (such as FSX models) + * + * \remarks Header only class to avoid forward instantiations across subprojects */ template class CThreadedReader {