mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
refs #527, changed writer to be able to publish multiple models at once
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/data/globalsetup.h"
|
||||
#include "blackmisc/threadedreader.h"
|
||||
#include "blackmisc/simulation/aircraftmodel.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
|
||||
#include <QNetworkReply>
|
||||
#include <QJsonArray>
|
||||
@@ -33,24 +33,28 @@ namespace BlackCore
|
||||
CDatabaseWriter(const BlackMisc::Network::CUrl &baseUrl, QObject *parent);
|
||||
|
||||
//! Write model to DB
|
||||
BlackMisc::CStatusMessageList asyncWriteModel(const BlackMisc::Simulation::CAircraftModel &model);
|
||||
BlackMisc::CStatusMessageList asyncPublishModels(const BlackMisc::Simulation::CAircraftModelList &models);
|
||||
|
||||
//! Shutdown
|
||||
void gracefulShutdown();
|
||||
|
||||
signals:
|
||||
//! Published models, the response to \sa asyncPublishModels
|
||||
void published(const BlackMisc::Simulation::CAircraftModelList &modelsPublished, const BlackMisc::Simulation::CAircraftModelList &modelsSkipped, const BlackMisc::CStatusMessageList &messages);
|
||||
|
||||
private slots:
|
||||
//! Post response
|
||||
void ps_postResponse(QNetworkReply *nwReplyPtr);
|
||||
|
||||
private:
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
BlackMisc::Network::CUrl m_modelUrl;
|
||||
BlackMisc::Network::CUrl m_modelPublishUrl;
|
||||
QNetworkAccessManager *m_networkManager = nullptr;
|
||||
QNetworkReply *m_pendingReply = nullptr;
|
||||
bool m_shutdown = false;
|
||||
|
||||
//! URL model web service
|
||||
static BlackMisc::Network::CUrl getModelWriteUrl(const BlackMisc::Network::CUrl &baseUrl);
|
||||
static BlackMisc::Network::CUrl getModelPublishUrl(const BlackMisc::Network::CUrl &baseUrl);
|
||||
|
||||
//! Split data array
|
||||
static QList<QByteArray> splitData(const QByteArray &data, int size);
|
||||
|
||||
Reference in New Issue
Block a user