mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
refs #452, data readers / writers for DB (via web services)
* flags for readers (which reader is reading specific entities etc.) * web data services: bundling multiple readers (webdataservices) and implementing IWebDataReaderProvider * readers now able to read single entities
This commit is contained in:
committed by
Mathew Sutcliffe
parent
33330394a9
commit
07c6370819
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/databasereader.h"
|
||||
#include "blackmisc/network/webdataservicesprovider.h"
|
||||
#include "blackmisc/aviation/liverylist.h"
|
||||
#include "blackmisc/simulation/distributorlist.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
@@ -38,6 +39,18 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
BlackMisc::Aviation::CLiveryList getLiveries() const;
|
||||
|
||||
//! Get aircraft livery for code
|
||||
//! \threadsafe
|
||||
BlackMisc::Aviation::CLivery getLiveryForCombinedCode(const QString &combinedCode) const;
|
||||
|
||||
//! Get aircraft livery for id
|
||||
//! \threadsafe
|
||||
BlackMisc::Aviation::CLivery getLiveryForDbKey(int id) const;
|
||||
|
||||
//! Best match specified by livery
|
||||
//! \threadsafe
|
||||
BlackMisc::Aviation::CLivery smartLiverySelector(const BlackMisc::Aviation::CLivery &livery) const;
|
||||
|
||||
//! Get distributors (of models)
|
||||
//! \threadsafe
|
||||
BlackMisc::Simulation::CDistributorList getDistributors() const;
|
||||
@@ -46,6 +59,14 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
BlackMisc::Simulation::CAircraftModelList getModels() const;
|
||||
|
||||
//! Get model for string
|
||||
//! \threadsafe
|
||||
BlackMisc::Simulation::CAircraftModel getModelForModelString(const QString &modelString) const;
|
||||
|
||||
//! Get model for designator/combined code
|
||||
//! \threadsafe
|
||||
BlackMisc::Simulation::CAircraftModelList getModelsForAircraftDesignatorAndLiveryCombinedCode(const QString &aircraftDesignator, const QString &combinedCode);
|
||||
|
||||
//! Get aircraft liveries count
|
||||
//! \threadsafe
|
||||
int getLiveriesCount() const;
|
||||
@@ -54,25 +75,27 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
int getDistributorsCount() const;
|
||||
|
||||
//! Best match specified by distributor
|
||||
//! \threadsafe
|
||||
BlackMisc::Simulation::CDistributor smartDistributorSelector(const BlackMisc::Simulation::CDistributor &distributor) const;
|
||||
|
||||
//! Get models count
|
||||
//! \threadsafe
|
||||
int getModelsCount() const;
|
||||
|
||||
//! All data read
|
||||
bool allRead() const;
|
||||
//! All data read?
|
||||
//! \threadsafe
|
||||
bool areAllDataRead() const;
|
||||
|
||||
//! Can connect?
|
||||
virtual bool canConnect(QString &message) const override;
|
||||
|
||||
//! \copydoc CDatabaseReader::canConnect()
|
||||
using CDatabaseReader::canConnect;
|
||||
|
||||
signals:
|
||||
//! Liveries have been read
|
||||
void readLiveries(int number);
|
||||
|
||||
//! Distributors have been read
|
||||
void readDistributors(int number);
|
||||
|
||||
//! Models have been read
|
||||
void readModels(int number);
|
||||
|
||||
//! All data read
|
||||
void readAll();
|
||||
//! Combined read signal
|
||||
void readData(BlackMisc::Network::CDbFlags::Entity entity, BlackMisc::Network::CDbFlags::ReadState state, int number);
|
||||
|
||||
private slots:
|
||||
//! Liveries have been read
|
||||
@@ -85,7 +108,7 @@ namespace BlackCore
|
||||
void ps_parseModelData(QNetworkReply *nwReply);
|
||||
|
||||
//! Read / re-read data file
|
||||
void ps_read();
|
||||
void ps_read(BlackMisc::Network::CDbFlags::Entity entity = BlackMisc::Network::CDbFlags::DistributorLiveryModel);
|
||||
|
||||
private:
|
||||
QNetworkAccessManager *m_networkManagerLivery = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user