mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Ref T292, Ref T285 background updater improvements
* less cycles * message history * more detailed status messages
This commit is contained in:
@@ -16,8 +16,10 @@
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackmisc/simulation/data/modelcaches.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
#include "blackmisc/worker.h"
|
||||
#include <QMap>
|
||||
#include <QReadWriteLock>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
@@ -35,6 +37,10 @@ namespace BlackCore
|
||||
//! Constructor
|
||||
CBackgroundDataUpdater(QObject *owner);
|
||||
|
||||
//! The message history
|
||||
//! \threadsafe
|
||||
BlackMisc::CStatusMessageList getMessageHistory() const;
|
||||
|
||||
signals:
|
||||
//! Consolidation
|
||||
void consolidating(bool running);
|
||||
@@ -43,10 +49,12 @@ namespace BlackCore
|
||||
int m_cycle = 0; //!< cycle
|
||||
bool m_inWork = false; //!< indicates a running update
|
||||
bool m_updatePublishedModels = true; //!< update when models have been updated
|
||||
mutable QReadWriteLock m_lockMsg; //!< lock snapshot
|
||||
|
||||
BlackMisc::Simulation::Data::CModelCaches m_modelCaches { false, this }; //!< caches
|
||||
BlackMisc::Simulation::Data::CModelCaches m_modelCaches { false, this }; //!< caches
|
||||
BlackMisc::Simulation::Data::CModelSetCaches m_modelSetCaches { false, this }; //!< caches
|
||||
QMap<QString, QDateTime> m_syncedModelsLatestChange; //! timestamp per cache
|
||||
QMap<QString, QDateTime> m_syncedModelsLatestChange; //! timestamp per cache when last synced
|
||||
BlackMisc::CStatusMessageList m_messageHistory;
|
||||
|
||||
//! Do the update checks
|
||||
void doWork();
|
||||
@@ -55,17 +63,22 @@ namespace BlackCore
|
||||
void triggerInfoReads();
|
||||
|
||||
//! Sync the model cache, normally model set or simulator models cache
|
||||
//! \remark if no DB models are passed all DB models are used
|
||||
void syncModelOrModelSetCacheWithDbData(BlackMisc::Simulation::Data::IMultiSimulatorModelCaches &cache,
|
||||
const BlackMisc::Simulation::CAircraftModelList &dbModelsConsidered = {});
|
||||
|
||||
//! Sync DB entity
|
||||
void syncDbEntity(BlackMisc::Network::CEntityFlags::Entity entity) const;
|
||||
void syncDbEntity(BlackMisc::Network::CEntityFlags::Entity entity);
|
||||
|
||||
//! Still enabled etc.
|
||||
bool doWorkCheck() const;
|
||||
|
||||
//! Models have been published
|
||||
void onModelsPublished(const BlackMisc::Simulation::CAircraftModelList &modelsPublished, bool directWrite);
|
||||
|
||||
//! Add history message
|
||||
//! \threadsafe
|
||||
void addHistory(const BlackMisc::CStatusMessage &msg);
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user