mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Ref T246, function to display model count and timestamp of model/set caches
This commit is contained in:
@@ -281,6 +281,16 @@ namespace BlackMisc
|
||||
return m_caches.getInfoStringFsFamily();
|
||||
}
|
||||
|
||||
QString IAircraftModelLoader::getModelCacheCountAndTimestamp() const
|
||||
{
|
||||
return m_caches.getCacheCountAndTimestamp(this->getSimulator());
|
||||
}
|
||||
|
||||
QString IAircraftModelLoader::getModelCacheCountAndTimestamp(const CSimulatorInfo &simulator) const
|
||||
{
|
||||
return m_caches.getCacheCountAndTimestamp(simulator);
|
||||
}
|
||||
|
||||
CSpecializedSimulatorSettings IAircraftModelLoader::getCurrentSimulatorSettings() const
|
||||
{
|
||||
return m_settings.getSpecializedSettings(this->getSimulator());
|
||||
|
||||
@@ -150,6 +150,12 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Simulation::Data::CModelCaches::getInfoStringFsFamily
|
||||
QString getModelCacheInfoStringFsFamily() const;
|
||||
|
||||
//! \copydoc BlackMisc::Simulation::Data::CModelCaches::getCacheCountAndTimestamp
|
||||
QString getModelCacheCountAndTimestamp() const;
|
||||
|
||||
//! \copydoc BlackMisc::Simulation::Data::CModelCaches::getCacheCountAndTimestamp
|
||||
QString getModelCacheCountAndTimestamp(const CSimulatorInfo &simulator) const;
|
||||
|
||||
//! \copydoc BlackMisc::Simulation::Data::IMultiSimulatorModelCaches::synchronizeCache
|
||||
void synchronizeModelCache(const CSimulatorInfo &simulator);
|
||||
|
||||
|
||||
@@ -160,5 +160,15 @@ namespace BlackMisc
|
||||
{
|
||||
return m_caches.getInfoStringFsFamily();
|
||||
}
|
||||
|
||||
QString CAircraftModelSetLoader::getModelCacheCountAndTimestamp() const
|
||||
{
|
||||
return m_caches.getCacheCountAndTimestamp(this->getSimulator());
|
||||
}
|
||||
|
||||
QString CAircraftModelSetLoader::getModelCacheCountAndTimestamp(const CSimulatorInfo &simulator) const
|
||||
{
|
||||
return m_caches.getCacheCountAndTimestamp(simulator);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace BlackMisc
|
||||
//! The loaded models for given simulator
|
||||
//! \threadsafe
|
||||
//! \remark non-const because it synchronizes cache
|
||||
BlackMisc::Simulation::CAircraftModelList getAircraftModels(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
BlackMisc::Simulation::CAircraftModelList getAircraftModels(const CSimulatorInfo &simulator);
|
||||
|
||||
//! Count of loaded models
|
||||
//! \threadsafe
|
||||
@@ -79,6 +79,7 @@ namespace BlackMisc
|
||||
BlackMisc::Simulation::CAircraftModelList getCachedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator) const;
|
||||
|
||||
//! Current simulator
|
||||
//! \threadsafe
|
||||
CSimulatorInfo getSimulator() const;
|
||||
|
||||
//! Supported simulators as string
|
||||
@@ -103,6 +104,12 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Simulation::Data::CModelCaches::getInfoStringFsFamily
|
||||
QString getInfoStringFsFamily() const;
|
||||
|
||||
//! \copydoc BlackMisc::Simulation::Data::CModelCaches::getCacheCountAndTimestamp
|
||||
QString getModelCacheCountAndTimestamp() const;
|
||||
|
||||
//! \copydoc BlackMisc::Simulation::Data::CModelCaches::getCacheCountAndTimestamp
|
||||
QString getModelCacheCountAndTimestamp(const CSimulatorInfo &simulator) const;
|
||||
|
||||
//! \name Implementations of the models interfaces
|
||||
//! @{
|
||||
virtual void setModels(const BlackMisc::Simulation::CAircraftModelList &models) override { this->setCachedModels(models, this->getSimulator()); }
|
||||
|
||||
@@ -38,6 +38,12 @@ namespace BlackMisc
|
||||
return is.arg(this->getCachedModelsCount(CSimulatorInfo::FSX)).arg(this->getCachedModelsCount(CSimulatorInfo::P3D)).arg(this->getCachedModelsCount(CSimulatorInfo::FS9));
|
||||
}
|
||||
|
||||
QString IMultiSimulatorModelCaches::getCacheCountAndTimestamp(const CSimulatorInfo &simulator) const
|
||||
{
|
||||
static const QString s("%1 models, ts: %2");
|
||||
return s.arg(this->getCachedModelsCount(simulator)).arg(this->getCacheTimestamp(simulator).toString("yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
|
||||
void IMultiSimulatorModelCaches::onLastSelectionChanged()
|
||||
{
|
||||
this->synchronizeCurrentCache();
|
||||
|
||||
@@ -238,6 +238,9 @@ namespace BlackMisc
|
||||
//! Info string without XPlane (FSX,P3D, FS9)
|
||||
QString getInfoStringFsFamily() const;
|
||||
|
||||
//! Cache count and timestamp
|
||||
QString getCacheCountAndTimestamp(const CSimulatorInfo &simulator) const;
|
||||
|
||||
//! Descriptive text
|
||||
virtual QString getDescription() const = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user