##// END OF EJS Templates
Makes the connection between Variable controller and Visualization controller...
Alexandre Leroux -
r170:a3d07f8af710
parent child
Show More
@@ -3,6 +3,8
3 3
4 4 #include <Common/spimpl.h>
5 5
6 #include <QObject>
7
6 8 class IDataSeries;
7 9 class QString;
8 10
@@ -24,4 +26,7 private:
24 26 spimpl::unique_impl_ptr<VariablePrivate> impl;
25 27 };
26 28
29 // Required for using shared_ptr in signals/slots
30 Q_DECLARE_METATYPE(std::shared_ptr<Variable>)
31
27 32 #endif // SCIQLOP_VARIABLE_H
@@ -10,6 +10,7
10 10 Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationController)
11 11
12 12 class DataSourceItem;
13 class Variable;
13 14
14 15 /**
15 16 * @brief The VisualizationController class aims to make the link between SciQlop and its plugins.
@@ -25,6 +26,9 public:
25 26 virtual ~VisualizationController();
26 27
27 28 public slots:
29 /// Slot called when a variable has been created in SciQlop
30 void onVariableCreated(std::shared_ptr<Variable> variable) noexcept;
31
28 32 /// Manage init/end of the controller
29 33 void initialize();
30 34 void finalize();
@@ -1,5 +1,7
1 1 #include <Visualization/VisualizationController.h>
2 2
3 #include <Variable/Variable.h>
4
3 5 #include <QMutex>
4 6 #include <QThread>
5 7
@@ -27,6 +29,12 VisualizationController::~VisualizationController()
27 29 this->waitForFinish();
28 30 }
29 31
32 void VisualizationController::onVariableCreated(std::shared_ptr<Variable> variable) noexcept
33 {
34 /// @todo ALX : make new graph for the variable
35 qCDebug(LOG_VisualizationController()) << "new variable to display";
36 }
37
30 38 void VisualizationController::initialize()
31 39 {
32 40 qCDebug(LOG_VisualizationController()) << tr("VisualizationController init")
@@ -3,6 +3,7
3 3 #include <Data/IDataProvider.h>
4 4 #include <DataSource/DataSourceController.h>
5 5 #include <QThread>
6 #include <Variable/Variable.h>
6 7 #include <Variable/VariableController.h>
7 8 #include <Visualization/VisualizationController.h>
8 9
@@ -26,6 +27,12 public:
26 27 m_VariableController.get(),
27 28 SLOT(createVariable(const QString &, std::shared_ptr<IDataProvider>)));
28 29
30 // VariableController <-> VisualizationController
31 qRegisterMetaType<std::shared_ptr<Variable> >();
32 connect(m_VariableController.get(), SIGNAL(variableCreated(std::shared_ptr<Variable>)),
33 m_VisualizationController.get(),
34 SLOT(onVariableCreated(std::shared_ptr<Variable>)));
35
29 36 m_DataSourceController->moveToThread(&m_DataSourceControllerThread);
30 37 m_VariableController->moveToThread(&m_VariableControllerThread);
31 38 m_VisualizationController->moveToThread(&m_VisualizationControllerThread);
@@ -73,7 +80,6 SqpApplication::SqpApplication(int &argc, char **argv)
73 80 connect(&impl->m_VisualizationControllerThread, &QThread::finished,
74 81 impl->m_VisualizationController.get(), &VisualizationController::finalize);
75 82
76
77 83 impl->m_DataSourceControllerThread.start();
78 84 impl->m_VariableControllerThread.start();
79 85 impl->m_VisualizationControllerThread.start();
General Comments 0
You need to be logged in to leave comments. Login now