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"
12 #include "core/threadedreader.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 
33  void readInBackgroundThread();
34 
37  virtual swift::misc::weather::CMetarList getMetars() const;
38 
42  getMetarForAirport(const swift::misc::aviation::CAirportIcaoCode &icao) const;
43 
44  signals:
47 
49  void dataRead(swift::misc::network::CEntityFlags::Entity entity,
50  swift::misc::network::CEntityFlags::ReadState state, int number, const QUrl &url);
51 
52  protected:
53  // CThreadedReader overrides
54  virtual void doWorkImpl() override;
55 
56  private:
59  void decodeMetars(QNetworkReply *nwReply);
60 
62  void read();
63 
65  void reloadSettings();
66 
67  private:
71  this, &CVatsimMetarReader::reloadSettings
72  };
73  };
74 } // namespace swift::core::vatsim
75 #endif // SWIFT_CORE_VATSIM_VATSIMMETARREADER_H
Support for threaded based reading and parsing tasks such as data files via http, or file system and ...
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.