mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #889, log categories
This commit is contained in:
committed by
Mathew Sutcliffe
parent
2c2a043e40
commit
ff0c37ff58
@@ -41,6 +41,12 @@ namespace BlackMisc
|
||||
this->gracefulShutdown();
|
||||
}
|
||||
|
||||
const CLogCategoryList &IAircraftModelLoader::getLogCategories()
|
||||
{
|
||||
static const CLogCategoryList cats({ CLogCategory::modelLoader() });
|
||||
return cats;
|
||||
}
|
||||
|
||||
CStatusMessage IAircraftModelLoader::setCachedModels(const CAircraftModelList &models, const CSimulatorInfo &simulator)
|
||||
{
|
||||
const CSimulatorInfo sim = simulator.isSingleSimulator() ? simulator : this->getSimulator(); // support default value
|
||||
|
||||
@@ -73,6 +73,9 @@ namespace BlackMisc
|
||||
//! \remark this has to be a abstarct, as DB handling is subject of BlackCore
|
||||
using ModelConsolidation = std::function<int (BlackMisc::Simulation::CAircraftModelList &, bool)>;
|
||||
|
||||
//! Log categories
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
|
||||
//! Start the loading process from disk.
|
||||
//! Optional DB models can be passed and used for data consolidation.
|
||||
void startLoading(LoadMode mode = InBackgroundWithCache, const ModelConsolidation &modelConsolidation = {}, const QString &directory = {});
|
||||
|
||||
@@ -126,6 +126,12 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
const CLogCategoryList &CModelCaches::getLogCategories()
|
||||
{
|
||||
static const CLogCategoryList l({ CLogCategory::modelCache() });
|
||||
return l;
|
||||
}
|
||||
|
||||
CAircraftModelList CModelCaches::getCachedModels(const CSimulatorInfo &simulator) const
|
||||
{
|
||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
||||
@@ -253,6 +259,12 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
const CLogCategoryList &CModelSetCaches::getLogCategories()
|
||||
{
|
||||
static const CLogCategoryList l({ CLogCategory::modelSetCache() });
|
||||
return l;
|
||||
}
|
||||
|
||||
CAircraftModelList CModelSetCaches::getCachedModels(const CSimulatorInfo &simulator) const
|
||||
{
|
||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
||||
|
||||
@@ -234,6 +234,9 @@ namespace BlackMisc
|
||||
//! Construtor
|
||||
CModelCaches(bool synchronizeCache, QObject *parent = nullptr);
|
||||
|
||||
//! Log categories
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
|
||||
//! \name Interface implementations
|
||||
//! @{
|
||||
virtual CAircraftModelList getCachedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator) const override;
|
||||
@@ -270,6 +273,9 @@ namespace BlackMisc
|
||||
//! Construtor
|
||||
CModelSetCaches(bool synchronizeCache, QObject *parent = nullptr);
|
||||
|
||||
//! Log categories
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
|
||||
//! \name Interface implementations
|
||||
//! @{
|
||||
virtual CAircraftModelList getCachedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator) const override;
|
||||
|
||||
Reference in New Issue
Block a user