refs #452, integrated METAR reader in CWebDataServices

* renamed files without "_"
* added flags
* integrated URL into global reader settings
* added new parameter for connectVatsimDataSignals
* removed unused setting in settings / network.h
This commit is contained in:
Klaus Basan
2015-09-26 01:06:11 +02:00
committed by Mathew Sutcliffe
parent 3923336da8
commit 24432a56c7
12 changed files with 121 additions and 69 deletions

View File

@@ -0,0 +1,57 @@
/* Copyright (C) 2015
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKCORE_VATSIMMETARREADER_H
#define BLACKCORE_VATSIMMETARREADER_H
#include "blackcoreexport.h"
#include "blackmisc/threadedreader.h"
#include "blackmisc/weather/metardecoder.h"
#include "blackmisc/weather/metarset.h"
#include <QObject>
#include <QTimer>
#include <QNetworkReply>
#include <QReadWriteLock>
namespace BlackCore
{
//! Read bookings from VATSIM
class BLACKCORE_EXPORT CVatsimMetarReader : public BlackMisc::CThreadedReader
{
Q_OBJECT
public:
//! Constructor
explicit CVatsimMetarReader(QObject *owner, const QString &url);
//! Read / re-read bookings
void readInBackgroundThread();
signals:
//! METARs have been read and converted to BlackMisc::Weather::CMetarSet
void dataRead(const BlackMisc::Weather::CMetarSet &metars);
private slots:
//! Decode METARs
//! \threadsafe
void ps_decodeMetars(QNetworkReply *nwReply);
//! Do reading
void ps_readMetars();
private:
QString m_metarUrl; //!< URL of the service
QNetworkAccessManager *m_networkManager = nullptr;
BlackMisc::Weather::CMetarDecoder m_metarDecoder;
};
}
#endif // guard