refs #907, model interface

* extended interface, function to get simulator
* made CDbMappingComponentAware an interface
* public getMappingComponent
This commit is contained in:
Klaus Basan
2017-03-09 22:47:17 +01:00
committed by Mathew Sutcliffe
parent 1153f70776
commit 60a937b5b6
5 changed files with 25 additions and 8 deletions

View File

@@ -36,6 +36,7 @@ namespace BlackGui
public BlackCore::IProgressIndicator
{
Q_OBJECT
Q_INTERFACES(BlackGui::Components::CDbMappingComponentAware)
public:
//! Current state of this component
@@ -50,7 +51,7 @@ namespace BlackGui
explicit CDbAutoSimulatorStashingComponent(QWidget *parent = nullptr);
//! Destructor
~CDbAutoSimulatorStashingComponent();
virtual ~CDbAutoSimulatorStashingComponent();
//! At least run once and completed
bool isCompleted() const { return m_state == Completed; }

View File

@@ -45,6 +45,7 @@ namespace BlackGui
public BlackCore::IProgressIndicator
{
Q_OBJECT
Q_INTERFACES(BlackGui::Components::CDbMappingComponentAware)
public:
//! Current state of this component
@@ -62,7 +63,7 @@ namespace BlackGui
explicit CDbAutoStashingComponent(QWidget *parent = nullptr);
//! Destructor
~CDbAutoStashingComponent();
virtual ~CDbAutoStashingComponent();
//! At least run once and completed
bool isCompleted() const { return m_state == Completed; }

View File

@@ -13,8 +13,7 @@
#define BLACKGUI_COMPONENTS_DBMAPPINGCOMPONENTAWARE_H
#include "blackgui/blackguiexport.h"
class QObject;
#include <QObject>
namespace BlackGui
{
@@ -29,16 +28,19 @@ namespace BlackGui
//! Set the corresponding component
virtual void setMappingComponent(CDbMappingComponent *component);
//! Get the mapping component
CDbMappingComponent *getMappingComponent() const { return m_mappingComponent; }
protected:
//! Constructor
CDbMappingComponentAware(QObject *parent);
//! Get the mapping component
CDbMappingComponent *getMappingComponent() const { return m_mappingComponent; }
private :
CDbMappingComponent *m_mappingComponent = nullptr; //!< reference to component
};
} // ns
} // ns
Q_DECLARE_INTERFACE(BlackGui::Components::CDbMappingComponentAware, "org.swift-project.blackgui.components.dbmappingcomponentaware")
#endif // guard

View File

@@ -49,13 +49,16 @@ namespace BlackGui
public BlackMisc::Simulation::IModelsSetable,
public BlackMisc::Simulation::IModelsUpdatable,
public BlackMisc::Simulation::IModelsPerSimulatorSetable,
public BlackMisc::Simulation::IModelsPerSimulatorUpdatable
public BlackMisc::Simulation::IModelsPerSimulatorUpdatable,
public BlackMisc::Simulation::ISimulatorSelectable
{
Q_OBJECT
Q_INTERFACES(BlackGui::Components::CDbMappingComponentAware)
Q_INTERFACES(BlackMisc::Simulation::IModelsSetable)
Q_INTERFACES(BlackMisc::Simulation::IModelsUpdatable)
Q_INTERFACES(BlackMisc::Simulation::IModelsPerSimulatorSetable)
Q_INTERFACES(BlackMisc::Simulation::IModelsPerSimulatorUpdatable)
Q_INTERFACES(BlackMisc::Simulation::ISimulatorSelectable)
public:
//! Constructor
@@ -91,6 +94,7 @@ namespace BlackGui
virtual void updateModels(const BlackMisc::Simulation::CAircraftModelList &models) override { this->replaceOrAddModelSet(models, this->getModelSetSimulator()); }
virtual void setModels(const BlackMisc::Simulation::CAircraftModelList &models, const BlackMisc::Simulation::CSimulatorInfo &simulator) override { this->setModelSet(models, simulator); }
virtual void updateModels(const BlackMisc::Simulation::CAircraftModelList &models, const BlackMisc::Simulation::CSimulatorInfo &simulator) override { this->replaceOrAddModelSet(models, simulator); }
virtual BlackMisc::Simulation::CSimulatorInfo getSelectedSimulator() const override { return this->getModelSetSimulator(); }
//! @}
public slots: