mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
refs #614, moved model set cache and matcher to simulator common class
* removed from FS common class * formatting
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "simulatorfscommon.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/simulation/modelmappingsprovider.h"
|
||||
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Simulation;
|
||||
@@ -32,15 +31,8 @@ namespace BlackSimPlugin
|
||||
Weather::IWeatherGridProvider *weatherGridProvider,
|
||||
QObject *parent) :
|
||||
CSimulatorCommon(info, ownAircraftProvider, renderedAircraftProvider, pluginStorageProvider, weatherGridProvider, parent),
|
||||
m_fsuipc(new CFsuipc()),
|
||||
m_modelMatcher(CAircraftMatcher::AllModes, this)
|
||||
{
|
||||
// init mapper
|
||||
CSimulatorInfo sim(info.getIdentifier());
|
||||
this->m_modelMatcher.setModelMappingProvider(
|
||||
std::make_unique<CachedModelSetProvider>(sim, this)
|
||||
);
|
||||
}
|
||||
m_fsuipc(new CFsuipc())
|
||||
{ }
|
||||
|
||||
CSimulatorFsCommon::~CSimulatorFsCommon() { }
|
||||
|
||||
@@ -101,12 +93,7 @@ namespace BlackSimPlugin
|
||||
|
||||
CAircraftModelList CSimulatorFsCommon::getInstalledModels() const
|
||||
{
|
||||
return m_modelMatcher.getMatchingModels();
|
||||
}
|
||||
|
||||
void CSimulatorFsCommon::reloadInstalledModels()
|
||||
{
|
||||
this->m_modelMatcher.reload();
|
||||
return m_modelMatcher.getModelSet();
|
||||
}
|
||||
|
||||
CPixmap CSimulatorFsCommon::iconForModel(const QString &modelString) const
|
||||
|
||||
@@ -58,9 +58,6 @@ namespace BlackSimPlugin
|
||||
//! \copydoc BlackCore::ISimulator::getInstalledModels
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getInstalledModels() const override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::reloadInstalledModels
|
||||
virtual void reloadInstalledModels() override;
|
||||
|
||||
//! \copydoc BlackCore::IContextSimulator::iconForModel
|
||||
virtual BlackMisc::CPixmap iconForModel(const QString &modelString) const override;
|
||||
|
||||
@@ -95,9 +92,6 @@ namespace BlackSimPlugin
|
||||
BlackMisc::Aviation::CComSystem m_simCom2; //!< cockpit COM2 state in simulator
|
||||
BlackMisc::Aviation::CTransponder m_simTransponder; //!< cockpit xpdr state in simulator
|
||||
|
||||
// parser / matcher
|
||||
BlackMisc::Simulation::CAircraftMatcher m_modelMatcher; //!< Model matcher
|
||||
|
||||
//! Set own model
|
||||
void setOwnAircraftModel(const BlackMisc::Simulation::CAircraftModel &model);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user