swift
vatsimmetarreader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_CORE_VATSIM_VATSIMMETARREADER_H
7 #define SWIFT_CORE_VATSIM_VATSIMMETARREADER_H
8 
9 #include <QObject>
10 
11 #include "core/swiftcoreexport.h"
15 #include "misc/weather/metar.h"
17 #include "misc/weather/metarlist.h"
18 
19 class QNetworkReply;
20 
21 namespace swift::core::vatsim
22 {
25  {
26  Q_OBJECT
27 
28  public:
30  explicit CVatsimMetarReader(QObject *owner);
31 
34  virtual swift::misc::weather::CMetarList getMetars() const;
35 
39  getMetarForAirport(const swift::misc::aviation::CAirportIcaoCode &icao) const;
40 
41  signals:
44 
46  void dataRead(swift::misc::network::CEntityFlags::Entity entity,
47  swift::misc::network::CEntityFlags::ReadState state, int number, const QUrl &url);
48 
49  protected:
50  // CThreadedReader overrides
51  virtual void doWorkImpl() override;
52 
53  private:
56  void decodeMetars(QNetworkReply *nwReply);
57 
59  void read();
60 
62  void reloadSettings();
63 
64  private:
68  this, &CVatsimMetarReader::reloadSettings
69  };
70  };
71 } // namespace swift::core::vatsim
72 #endif // SWIFT_CORE_VATSIM_VATSIMMETARREADER_H
Periodically executes doWorkImpl() in a separate thread.
void metarsRead(const swift::misc::weather::CMetarList &metars)
METARs have been read and converted to swift::misc::weather::CMetarList.
void dataRead(swift::misc::network::CEntityFlags::Entity entity, swift::misc::network::CEntityFlags::ReadState state, int number, const QUrl &url)
Data have been read.
Value object encapsulating information of airport ICAO data.
Value object encapsulating information about METAR FIXME: runway visibilities FIXME: runway wind shea...
Definition: metar.h:38
Sequence of Metars.
Definition: metarlist.h:24
#define SWIFT_CORE_EXPORT
Export a class or function from the library.