diff --git a/src/blackcore/contextnetworkimpl.cpp b/src/blackcore/contextnetworkimpl.cpp index f6c63f701..e803a4fe1 100644 --- a/src/blackcore/contextnetworkimpl.cpp +++ b/src/blackcore/contextnetworkimpl.cpp @@ -439,7 +439,7 @@ namespace BlackCore m_airspace->analyzer()->setSimulatorRenderRestrictionsChanged(restricted, enabled, maxAircraft, maxRenderedDistance, maxRenderedBoundary); } - void CContextNetwork::ps_updateMetars(const BlackMisc::Weather::CMetarSet &metars) + void CContextNetwork::ps_updateMetars(const BlackMisc::Weather::CMetarList &metars) { if (this->isDebugEnabled()) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; } CLogMessage(this).info("%1 METARs updated") << metars.size(); diff --git a/src/blackcore/contextnetworkimpl.h b/src/blackcore/contextnetworkimpl.h index 6c4f61004..315e1ac38 100644 --- a/src/blackcore/contextnetworkimpl.h +++ b/src/blackcore/contextnetworkimpl.h @@ -47,7 +47,7 @@ #include "blackmisc/simulation/simulatedaircraftlist.h" #include "blackmisc/statusmessage.h" #include "blackmisc/weather/metar.h" -#include "blackmisc/weather/metarset.h" +#include "blackmisc/weather/metarlist.h" class QTimer; @@ -278,7 +278,7 @@ namespace BlackCore private slots: //! Update METAR collection - void ps_updateMetars(const BlackMisc::Weather::CMetarSet &metars); + void ps_updateMetars(const BlackMisc::Weather::CMetarList &metars); //! Check if a supervisor message was received void ps_checkForSupervisiorTextMessage(const BlackMisc::Network::CTextMessageList &messages); diff --git a/src/blackcore/vatsim/vatsimmetarreader.cpp b/src/blackcore/vatsim/vatsimmetarreader.cpp index 6e3b3d280..b998c74a8 100644 --- a/src/blackcore/vatsim/vatsimmetarreader.cpp +++ b/src/blackcore/vatsim/vatsimmetarreader.cpp @@ -51,7 +51,7 @@ namespace BlackCore Q_UNUSED(s); } - CMetarSet CVatsimMetarReader::getMetars() const + CMetarList CVatsimMetarReader::getMetars() const { QReadLocker l(&m_lock); return m_metars; @@ -119,9 +119,9 @@ namespace BlackCore return; } - CMetarSet metars; QString invalidMetars; int invalidLineCount = 0; + CMetarList metars; QTextStream lineReader(&metarData); while (!lineReader.atEnd()) { diff --git a/src/blackcore/vatsim/vatsimmetarreader.h b/src/blackcore/vatsim/vatsimmetarreader.h index c11b0f8d9..490da3c76 100644 --- a/src/blackcore/vatsim/vatsimmetarreader.h +++ b/src/blackcore/vatsim/vatsimmetarreader.h @@ -18,7 +18,7 @@ #include "blackcore/threadedreader.h" #include "blackmisc/weather/metar.h" #include "blackmisc/weather/metardecoder.h" -#include "blackmisc/weather/metarset.h" +#include "blackmisc/weather/metarlist.h" #include @@ -42,7 +42,7 @@ namespace BlackCore //! Get METARs //! \threadsafe - virtual BlackMisc::Weather::CMetarSet getMetars() const; + virtual BlackMisc::Weather::CMetarList getMetars() const; //! Get METAR for airport //! \threadsafe @@ -53,8 +53,8 @@ namespace BlackCore virtual int getMetarsCount() const; signals: - //! METARs have been read and converted to BlackMisc::Weather::CMetarSet - void metarsRead(const BlackMisc::Weather::CMetarSet &metars); + //! METARs have been read and converted to BlackMisc::Weather::CMetarList + void metarsRead(const BlackMisc::Weather::CMetarList &metars); //! Data have been read void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number); @@ -76,7 +76,7 @@ namespace BlackCore private: BlackMisc::Weather::CMetarDecoder m_metarDecoder; - BlackMisc::Weather::CMetarSet m_metars; + BlackMisc::Weather::CMetarList m_metars; BlackMisc::CSettingReadOnly m_settings { this }; }; } // ns diff --git a/src/blackcore/webdataservices.cpp b/src/blackcore/webdataservices.cpp index c66084ffa..1f53f7928 100644 --- a/src/blackcore/webdataservices.cpp +++ b/src/blackcore/webdataservices.cpp @@ -381,10 +381,10 @@ namespace BlackCore return CCountry(); } - CMetarSet CWebDataServices::getMetars() const + CMetarList CWebDataServices::getMetars() const { if (m_vatsimMetarReader) { return m_vatsimMetarReader->getMetars(); } - return CMetarSet(); + return {}; } CMetar CWebDataServices::getMetarForAirport(const CAirportIcaoCode &icao) const @@ -541,7 +541,7 @@ namespace BlackCore CLogMessage(this).info("Read %1 ATC bookings from network") << stations.size(); } - void CWebDataServices::ps_receivedMetars(const CMetarSet &metars) + void CWebDataServices::ps_receivedMetars(const CMetarList &metars) { CLogMessage(this).info("Read %1 METARs") << metars.size(); } diff --git a/src/blackcore/webdataservices.h b/src/blackcore/webdataservices.h index 2aa93731a..00ed5d069 100644 --- a/src/blackcore/webdataservices.h +++ b/src/blackcore/webdataservices.h @@ -37,7 +37,7 @@ #include "blackmisc/simulation/distributorlist.h" #include "blackmisc/statusmessagelist.h" #include "blackmisc/weather/metar.h" -#include "blackmisc/weather/metarset.h" +#include "blackmisc/weather/metarlist.h" #include #include @@ -264,7 +264,7 @@ namespace BlackCore //! Get METARs //! \threadsafe - BlackMisc::Weather::CMetarSet getMetars() const; + BlackMisc::Weather::CMetarList getMetars() const; //! Get METAR for airport //! \threadsafe @@ -302,7 +302,7 @@ namespace BlackCore void ps_receivedBookings(const BlackMisc::Aviation::CAtcStationList &bookedStations); //! Received METAR data - void ps_receivedMetars(const BlackMisc::Weather::CMetarSet &metars); + void ps_receivedMetars(const BlackMisc::Weather::CMetarList &metars); //! Data file has been read void ps_dataFileRead(int lines); diff --git a/src/blackmisc/weather/metarset.cpp b/src/blackmisc/weather/metarlist.cpp similarity index 73% rename from src/blackmisc/weather/metarset.cpp rename to src/blackmisc/weather/metarlist.cpp index 1127b8dbe..a897fb5cd 100644 --- a/src/blackmisc/weather/metarset.cpp +++ b/src/blackmisc/weather/metarlist.cpp @@ -7,7 +7,7 @@ * contained in the LICENSE file. */ -#include "blackmisc/weather/metarset.h" +#include "blackmisc/weather/metarlist.h" #include @@ -15,11 +15,11 @@ namespace BlackMisc { namespace Weather { - CMetarSet::CMetarSet(const CCollection &other) : - CCollection(other) + CMetarList::CMetarList(const CSequence &other) : + CSequence(other) { } - CMetar CMetarSet::getMetarForAirport(const Aviation::CAirportIcaoCode &icao) const + CMetar CMetarList::getMetarForAirport(const Aviation::CAirportIcaoCode &icao) const { return this->findFirstByOrDefault(&CMetar::getAirportIcaoCode, icao); } diff --git a/src/blackmisc/weather/metarset.h b/src/blackmisc/weather/metarlist.h similarity index 73% rename from src/blackmisc/weather/metarset.h rename to src/blackmisc/weather/metarlist.h index 5e1e47831..1091ff56a 100644 --- a/src/blackmisc/weather/metarset.h +++ b/src/blackmisc/weather/metarlist.h @@ -9,8 +9,8 @@ //! \file -#ifndef BLACKMISC_WEATHER_METARSET_H -#define BLACKMISC_WEATHER_METARSET_H +#ifndef BLACKMISC_WEATHER_METARLIST_H +#define BLACKMISC_WEATHER_METARLIST_H #include "blackmisc/aviation/airporticaocode.h" #include "blackmisc/blackmiscexport.h" @@ -28,19 +28,19 @@ namespace BlackMisc { namespace Weather { - //! Collection of Metars - class BLACKMISC_EXPORT CMetarSet : - public CCollection, - public BlackMisc::Mixin::MetaType + //! Sequence of Metars + class BLACKMISC_EXPORT CMetarList : + public CSequence, + public BlackMisc::Mixin::MetaType { public: - BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CMetarSet) + BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CMetarList) //! Default constructor. - CMetarSet() = default; + CMetarList() = default; //! Construct from a base class object. - CMetarSet(const CCollection &other); + CMetarList(const CSequence &other); //! METAR for ICAO code CMetar getMetarForAirport(const Aviation::CAirportIcaoCode &icao) const; @@ -49,7 +49,7 @@ namespace BlackMisc } //namespace } // namespace -Q_DECLARE_METATYPE(BlackMisc::Weather::CMetarSet) +Q_DECLARE_METATYPE(BlackMisc::Weather::CMetarList) Q_DECLARE_METATYPE(BlackMisc::CCollection) Q_DECLARE_METATYPE(BlackMisc::CSequence) diff --git a/src/blackmisc/weather/registermetadataweather.cpp b/src/blackmisc/weather/registermetadataweather.cpp index 5202d3a09..9dcd2346c 100644 --- a/src/blackmisc/weather/registermetadataweather.cpp +++ b/src/blackmisc/weather/registermetadataweather.cpp @@ -22,7 +22,7 @@ namespace BlackMisc CCloudLayerList::registerMetadata(); CGridPoint::registerMetadata(); CMetar::registerMetadata(); - CMetarSet::registerMetadata(); + CMetarList::registerMetadata(); CPresentWeather::registerMetadata(); CPresentWeatherList::registerMetadata(); CTemperatureLayer::registerMetadata(); diff --git a/src/blackmisc/weather/weather.h b/src/blackmisc/weather/weather.h index bbd5c162d..e8cfa5378 100644 --- a/src/blackmisc/weather/weather.h +++ b/src/blackmisc/weather/weather.h @@ -21,7 +21,7 @@ #include "blackmisc/weather/cloudlayerlist.h" #include "blackmisc/weather/gridpoint.h" #include "blackmisc/weather/metar.h" -#include "blackmisc/weather/metarset.h" +#include "blackmisc/weather/metarlist.h" #include "blackmisc/weather/presentweather.h" #include "blackmisc/weather/presentweatherlist.h" #include "blackmisc/weather/temperaturelayer.h"