mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
#refs 686, used settings in readers
* moved threaded reader to BlackCore (settings are normally BlackCore aware) * created ns/subfolder VATSIM * prepared settings for the VATSIM readers
This commit is contained in:
68
src/blackcore/vatsim/vatsimbookingreader.h
Normal file
68
src/blackcore/vatsim/vatsimbookingreader.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* Copyright (C) 2013
|
||||
* 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_VATSIM_VATSIMBOOKINGREADER_H
|
||||
#define BLACKCORE_VATSIM_VATSIMBOOKINGREADER_H
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
#include "blackcore/threadedreader.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QNetworkReply;
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
namespace Vatsim
|
||||
{
|
||||
//! Read bookings from VATSIM
|
||||
class BLACKCORE_EXPORT CVatsimBookingReader : public BlackCore::CThreadedReader
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CVatsimBookingReader(QObject *owner);
|
||||
|
||||
//! Read / re-read bookings
|
||||
void readInBackgroundThread();
|
||||
|
||||
signals:
|
||||
//! Bookings have been read and converted to BlackMisc::Aviation::CAtcStationList
|
||||
void atcBookingsRead(const BlackMisc::Aviation::CAtcStationList &bookedStations);
|
||||
|
||||
//! Data have been read
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
|
||||
protected:
|
||||
//! \name BlackCore::CThreadedReader overrides
|
||||
//! @{
|
||||
virtual void cleanup() override;
|
||||
virtual BlackCore::Settings::CSettingsReader getSettings() const override;
|
||||
//! @}
|
||||
|
||||
private slots:
|
||||
//! Bookings have been read
|
||||
//! \threadsafe
|
||||
void ps_parseBookings(QNetworkReply *nwReply);
|
||||
|
||||
//! Do reading
|
||||
void ps_read();
|
||||
|
||||
private:
|
||||
BlackMisc::CSettingReadOnly<BlackCore::Settings::SettingsVatsimBookings> m_settings { this };
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user