@@ -3,6 +3,8 | |||||
3 |
|
3 | |||
4 | #include <Common/spimpl.h> |
|
4 | #include <Common/spimpl.h> | |
5 |
|
5 | |||
|
6 | #include <QObject> | |||
|
7 | ||||
6 | class IDataSeries; |
|
8 | class IDataSeries; | |
7 | class QString; |
|
9 | class QString; | |
8 |
|
10 | |||
@@ -24,4 +26,7 private: | |||||
24 | spimpl::unique_impl_ptr<VariablePrivate> impl; |
|
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 | #endif // SCIQLOP_VARIABLE_H |
|
32 | #endif // SCIQLOP_VARIABLE_H |
@@ -10,6 +10,7 | |||||
10 | Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationController) |
|
10 | Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationController) | |
11 |
|
11 | |||
12 | class DataSourceItem; |
|
12 | class DataSourceItem; | |
|
13 | class Variable; | |||
13 |
|
14 | |||
14 | /** |
|
15 | /** | |
15 | * @brief The VisualizationController class aims to make the link between SciQlop and its plugins. |
|
16 | * @brief The VisualizationController class aims to make the link between SciQlop and its plugins. | |
@@ -25,6 +26,9 public: | |||||
25 | virtual ~VisualizationController(); |
|
26 | virtual ~VisualizationController(); | |
26 |
|
27 | |||
27 | public slots: |
|
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 | /// Manage init/end of the controller |
|
32 | /// Manage init/end of the controller | |
29 | void initialize(); |
|
33 | void initialize(); | |
30 | void finalize(); |
|
34 | void finalize(); |
@@ -1,5 +1,7 | |||||
1 | #include <Visualization/VisualizationController.h> |
|
1 | #include <Visualization/VisualizationController.h> | |
2 |
|
2 | |||
|
3 | #include <Variable/Variable.h> | |||
|
4 | ||||
3 | #include <QMutex> |
|
5 | #include <QMutex> | |
4 | #include <QThread> |
|
6 | #include <QThread> | |
5 |
|
7 | |||
@@ -27,6 +29,12 VisualizationController::~VisualizationController() | |||||
27 | this->waitForFinish(); |
|
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 | void VisualizationController::initialize() |
|
38 | void VisualizationController::initialize() | |
31 | { |
|
39 | { | |
32 | qCDebug(LOG_VisualizationController()) << tr("VisualizationController init") |
|
40 | qCDebug(LOG_VisualizationController()) << tr("VisualizationController init") |
@@ -3,6 +3,7 | |||||
3 | #include <Data/IDataProvider.h> |
|
3 | #include <Data/IDataProvider.h> | |
4 | #include <DataSource/DataSourceController.h> |
|
4 | #include <DataSource/DataSourceController.h> | |
5 | #include <QThread> |
|
5 | #include <QThread> | |
|
6 | #include <Variable/Variable.h> | |||
6 | #include <Variable/VariableController.h> |
|
7 | #include <Variable/VariableController.h> | |
7 | #include <Visualization/VisualizationController.h> |
|
8 | #include <Visualization/VisualizationController.h> | |
8 |
|
9 | |||
@@ -26,6 +27,12 public: | |||||
26 | m_VariableController.get(), |
|
27 | m_VariableController.get(), | |
27 | SLOT(createVariable(const QString &, std::shared_ptr<IDataProvider>))); |
|
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 | m_DataSourceController->moveToThread(&m_DataSourceControllerThread); |
|
36 | m_DataSourceController->moveToThread(&m_DataSourceControllerThread); | |
30 | m_VariableController->moveToThread(&m_VariableControllerThread); |
|
37 | m_VariableController->moveToThread(&m_VariableControllerThread); | |
31 | m_VisualizationController->moveToThread(&m_VisualizationControllerThread); |
|
38 | m_VisualizationController->moveToThread(&m_VisualizationControllerThread); | |
@@ -73,7 +80,6 SqpApplication::SqpApplication(int &argc, char **argv) | |||||
73 | connect(&impl->m_VisualizationControllerThread, &QThread::finished, |
|
80 | connect(&impl->m_VisualizationControllerThread, &QThread::finished, | |
74 | impl->m_VisualizationController.get(), &VisualizationController::finalize); |
|
81 | impl->m_VisualizationController.get(), &VisualizationController::finalize); | |
75 |
|
82 | |||
76 |
|
||||
77 | impl->m_DataSourceControllerThread.start(); |
|
83 | impl->m_DataSourceControllerThread.start(); | |
78 | impl->m_VariableControllerThread.start(); |
|
84 | impl->m_VariableControllerThread.start(); | |
79 | impl->m_VisualizationControllerThread.start(); |
|
85 | impl->m_VisualizationControllerThread.start(); |
General Comments 0
You need to be logged in to leave comments.
Login now