refs #614, moved model set cache and matcher to simulator common class

* removed from FS common class
* formatting
This commit is contained in:
Klaus Basan
2016-04-04 12:57:40 +02:00
parent f3ef7ad7ea
commit aa6370c325
6 changed files with 30 additions and 107 deletions

View File

@@ -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

View File

@@ -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);