Auto status change to "Under Review"
@@ -1,142 +1,146 | |||
|
1 | 1 | #include "SqpApplication.h" |
|
2 | 2 | |
|
3 | 3 | #include <Data/IDataProvider.h> |
|
4 | 4 | #include <DataSource/DataSourceController.h> |
|
5 | 5 | #include <Network/NetworkController.h> |
|
6 | 6 | #include <QThread> |
|
7 | 7 | #include <Time/TimeController.h> |
|
8 | 8 | #include <Variable/Variable.h> |
|
9 | 9 | #include <Variable/VariableController.h> |
|
10 | 10 | #include <Visualization/VisualizationController.h> |
|
11 | 11 | |
|
12 | 12 | Q_LOGGING_CATEGORY(LOG_SqpApplication, "SqpApplication") |
|
13 | 13 | |
|
14 | 14 | class SqpApplication::SqpApplicationPrivate { |
|
15 | 15 | public: |
|
16 | 16 | SqpApplicationPrivate() |
|
17 | 17 | : m_DataSourceController{std::make_unique<DataSourceController>()}, |
|
18 | 18 | m_NetworkController{std::make_unique<NetworkController>()}, |
|
19 | 19 | m_TimeController{std::make_unique<TimeController>()}, |
|
20 | 20 | m_VariableController{std::make_unique<VariableController>()}, |
|
21 | 21 | m_VisualizationController{std::make_unique<VisualizationController>()} |
|
22 | 22 | { |
|
23 | 23 | // /////////////////////////////// // |
|
24 | 24 | // Connections between controllers // |
|
25 | 25 | // /////////////////////////////// // |
|
26 | 26 | |
|
27 | 27 | // VariableController <-> DataSourceController |
|
28 | 28 | connect(m_DataSourceController.get(), |
|
29 | 29 | SIGNAL(variableCreationRequested(const QString &, const QVariantHash &, |
|
30 | 30 | std::shared_ptr<IDataProvider>)), |
|
31 | 31 | m_VariableController.get(), |
|
32 | 32 | SLOT(createVariable(const QString &, const QVariantHash &, |
|
33 | 33 | std::shared_ptr<IDataProvider>))); |
|
34 | 34 | |
|
35 | 35 | // VariableController <-> VisualizationController |
|
36 | 36 | connect(m_VariableController.get(), |
|
37 | 37 | SIGNAL(variableAboutToBeDeleted(std::shared_ptr<Variable>)), |
|
38 | 38 | m_VisualizationController.get(), |
|
39 | 39 | SIGNAL(variableAboutToBeDeleted(std::shared_ptr<Variable>)), Qt::DirectConnection); |
|
40 | 40 | |
|
41 | 41 | |
|
42 | 42 | m_DataSourceController->moveToThread(&m_DataSourceControllerThread); |
|
43 | m_DataSourceControllerThread.setObjectName("DataSourceControllerThread"); | |
|
43 | 44 | m_NetworkController->moveToThread(&m_NetworkControllerThread); |
|
45 | m_NetworkControllerThread.setObjectName("NetworkControllerThread"); | |
|
44 | 46 | m_VariableController->moveToThread(&m_VariableControllerThread); |
|
47 | m_VariableControllerThread.setObjectName("VariableControllerThread"); | |
|
45 | 48 | m_VisualizationController->moveToThread(&m_VisualizationControllerThread); |
|
49 | m_VisualizationControllerThread.setObjectName("VsualizationControllerThread"); | |
|
46 | 50 | |
|
47 | 51 | |
|
48 | 52 | // Additionnal init |
|
49 | 53 | m_VariableController->setTimeController(m_TimeController.get()); |
|
50 | 54 | } |
|
51 | 55 | |
|
52 | 56 | virtual ~SqpApplicationPrivate() |
|
53 | 57 | { |
|
54 | 58 | qCInfo(LOG_SqpApplication()) << tr("SqpApplicationPrivate destruction"); |
|
55 | 59 | m_DataSourceControllerThread.quit(); |
|
56 | 60 | m_DataSourceControllerThread.wait(); |
|
57 | 61 | |
|
58 | 62 | m_NetworkControllerThread.quit(); |
|
59 | 63 | m_NetworkControllerThread.wait(); |
|
60 | 64 | |
|
61 | 65 | m_VariableControllerThread.quit(); |
|
62 | 66 | m_VariableControllerThread.wait(); |
|
63 | 67 | |
|
64 | 68 | m_VisualizationControllerThread.quit(); |
|
65 | 69 | m_VisualizationControllerThread.wait(); |
|
66 | 70 | } |
|
67 | 71 | |
|
68 | 72 | std::unique_ptr<DataSourceController> m_DataSourceController; |
|
69 | 73 | std::unique_ptr<VariableController> m_VariableController; |
|
70 | 74 | std::unique_ptr<TimeController> m_TimeController; |
|
71 | 75 | std::unique_ptr<NetworkController> m_NetworkController; |
|
72 | 76 | std::unique_ptr<VisualizationController> m_VisualizationController; |
|
73 | 77 | QThread m_DataSourceControllerThread; |
|
74 | 78 | QThread m_NetworkControllerThread; |
|
75 | 79 | QThread m_VariableControllerThread; |
|
76 | 80 | QThread m_VisualizationControllerThread; |
|
77 | 81 | }; |
|
78 | 82 | |
|
79 | 83 | |
|
80 | 84 | SqpApplication::SqpApplication(int &argc, char **argv) |
|
81 | 85 | : QApplication{argc, argv}, impl{spimpl::make_unique_impl<SqpApplicationPrivate>()} |
|
82 | 86 | { |
|
83 | 87 | qCDebug(LOG_SqpApplication()) << tr("SqpApplication construction") << QThread::currentThread(); |
|
84 | 88 | |
|
85 | 89 | connect(&impl->m_DataSourceControllerThread, &QThread::started, |
|
86 | 90 | impl->m_DataSourceController.get(), &DataSourceController::initialize); |
|
87 | 91 | connect(&impl->m_DataSourceControllerThread, &QThread::finished, |
|
88 | 92 | impl->m_DataSourceController.get(), &DataSourceController::finalize); |
|
89 | 93 | |
|
90 | 94 | connect(&impl->m_NetworkControllerThread, &QThread::started, impl->m_NetworkController.get(), |
|
91 | 95 | &NetworkController::initialize); |
|
92 | 96 | connect(&impl->m_NetworkControllerThread, &QThread::finished, impl->m_NetworkController.get(), |
|
93 | 97 | &NetworkController::finalize); |
|
94 | 98 | |
|
95 | 99 | connect(&impl->m_VariableControllerThread, &QThread::started, impl->m_VariableController.get(), |
|
96 | 100 | &VariableController::initialize); |
|
97 | 101 | connect(&impl->m_VariableControllerThread, &QThread::finished, impl->m_VariableController.get(), |
|
98 | 102 | &VariableController::finalize); |
|
99 | 103 | |
|
100 | 104 | connect(&impl->m_VisualizationControllerThread, &QThread::started, |
|
101 | 105 | impl->m_VisualizationController.get(), &VisualizationController::initialize); |
|
102 | 106 | connect(&impl->m_VisualizationControllerThread, &QThread::finished, |
|
103 | 107 | impl->m_VisualizationController.get(), &VisualizationController::finalize); |
|
104 | 108 | |
|
105 | 109 | impl->m_DataSourceControllerThread.start(); |
|
106 | 110 | impl->m_NetworkControllerThread.start(); |
|
107 | 111 | impl->m_VariableControllerThread.start(); |
|
108 | 112 | impl->m_VisualizationControllerThread.start(); |
|
109 | 113 | } |
|
110 | 114 | |
|
111 | 115 | SqpApplication::~SqpApplication() |
|
112 | 116 | { |
|
113 | 117 | } |
|
114 | 118 | |
|
115 | 119 | void SqpApplication::initialize() |
|
116 | 120 | { |
|
117 | 121 | } |
|
118 | 122 | |
|
119 | 123 | DataSourceController &SqpApplication::dataSourceController() noexcept |
|
120 | 124 | { |
|
121 | 125 | return *impl->m_DataSourceController; |
|
122 | 126 | } |
|
123 | 127 | |
|
124 | 128 | NetworkController &SqpApplication::networkController() noexcept |
|
125 | 129 | { |
|
126 | 130 | return *impl->m_NetworkController; |
|
127 | 131 | } |
|
128 | 132 | |
|
129 | 133 | TimeController &SqpApplication::timeController() noexcept |
|
130 | 134 | { |
|
131 | 135 | return *impl->m_TimeController; |
|
132 | 136 | } |
|
133 | 137 | |
|
134 | 138 | VariableController &SqpApplication::variableController() noexcept |
|
135 | 139 | { |
|
136 | 140 | return *impl->m_VariableController; |
|
137 | 141 | } |
|
138 | 142 | |
|
139 | 143 | VisualizationController &SqpApplication::visualizationController() noexcept |
|
140 | 144 | { |
|
141 | 145 | return *impl->m_VisualizationController; |
|
142 | 146 | } |
General Comments 3
Pull request updated. Auto status change to "Under Review"
Changed commits: * 3 added * 0 removed Changed files: * A plugins/amda/tests-resources/TestAmdaResultParser/FileNotFound.txt * M gui/src/Visualization/operations/RescaleAxeOperation.cpp * M app/src/MainWindow.cpp * M core/include/Data/IDataProvider.h * M core/include/DataSource/DataSourceItemAction.h * M core/include/Variable/VariableController.h * M core/include/Variable/VariableModel.h * M core/include/Visualization/VisualizationController.h * M core/src/Network/NetworkController.cpp * M core/src/Variable/Variable.cpp * M core/src/Variable/VariableController.cpp * M core/src/Variable/VariableModel.cpp * M gui/include/Visualization/VisualizationGraphWidget.h * M gui/include/Visualization/VisualizationWidget.h * M gui/src/SqpApplication.cpp * M gui/src/Variable/VariableInspectorWidget.cpp * M gui/src/Visualization/VisualizationGraphHelper.cpp * M gui/src/Visualization/VisualizationGraphWidget.cpp * M gui/src/Visualization/VisualizationWidget.cpp * M gui/src/Visualization/VisualizationZoneWidget.cpp * M plugins/amda/include/AmdaProvider.h * M plugins/amda/src/AmdaProvider.cpp * M plugins/amda/src/AmdaResultParser.cpp * M plugins/amda/tests/TestAmdaResultParser.cpp * M plugins/mockplugin/include/CosinusProvider.h * M plugins/mockplugin/src/CosinusProvider.cpp * R COPYING * R app/ui/MainWindow.ui * R cmake/sciqlop_package_qt.cmake * R core/include/Common/MetaTypes.h * R core/include/Data/ArrayData.h * R core/include/Data/DataProviderParameters.h * R core/include/Data/DataSeries.h * R core/include/Data/IDataSeries.h * R core/include/Data/ScalarSeries.h * R core/include/Data/SqpDateTime.h * R core/include/Network/NetworkController.h * R core/include/Plugin/PluginManager.h * R core/include/Time/TimeController.h * R core/include/Variable/Variable.h * R core/include/Variable/VariableCacheController.h * R core/src/Data/ScalarSeries.cpp * R core/src/DataSource/DataSourceItemAction.cpp * R core/src/Plugin/PluginManager.cpp * R core/src/Time/TimeController.cpp * R core/src/Variable/VariableCacheController.cpp * R core/src/Visualization/VisualizationController.cpp * R core/tests/Variable/TestVariableCacheController.cpp * R gui/include/DataSource/DataSourceTreeWidgetItem.h * R gui/include/DataSource/DataSourceWidget.h * R gui/include/SidePane/SqpSidePane.h * R gui/include/TimeWidget/TimeWidget.h * R gui/include/Variable/VariableInspectorWidget.h * R gui/include/Variable/VariableMenuHeaderWidget.h * R gui/include/Visualization/IVariableContainer.h * R gui/include/Visualization/IVisualizationWidget.h * R gui/include/Visualization/IVisualizationWidgetVisitor.h * R gui/include/Visualization/VisualizationGraphHelper.h * R gui/include/Visualization/VisualizationTabWidget.h * R gui/include/Visualization/VisualizationZoneWidget.h * R gui/include/Visualization/operations/GenerateVariableMenuOperation.h * R gui/include/Visualization/operations/MenuBuilder.h * R gui/include/Visualization/operations/RemoveVariableOperation.h * R gui/include/Visualization/qcustomplot.h * R gui/resources/icones/dataSourceComponent.png * R gui/resources/icones/dataSourceNode.png * R gui/resources/icones/dataSourceProduct.png * R gui/resources/icones/dataSourceRoot.png * R gui/resources/icones/delete.png * R gui/resources/icones/next.png * R gui/resources/icones/openInspector.png * R gui/resources/icones/plot.png * R gui/resources/icones/previous.png * R gui/resources/icones/sciqlop2PNG_1024.png * R gui/resources/icones/unplot.png * R gui/resources/sqpguiresources.qrc * R gui/src/DataSource/DataSourceTreeWidgetItem.cpp * R gui/src/DataSource/DataSourceWidget.cpp * R gui/src/SidePane/SqpSidePane.cpp * R gui/src/TimeWidget/TimeWidget.cpp * R gui/src/Variable/VariableMenuHeaderWidget.cpp * R gui/src/Visualization/VisualizationTabWidget.cpp * R gui/src/Visualization/operations/GenerateVariableMenuOperation.cpp * R gui/src/Visualization/operations/MenuBuilder.cpp * R gui/src/Visualization/operations/RemoveVariableOperation.cpp * R gui/src/Visualization/qcustomplot.cpp * R gui/ui/DataSource/DataSourceWidget.ui * R gui/ui/SidePane/SqpSidePane.ui * R gui/ui/TimeWidget/TimeWidget.ui * R gui/ui/Variable/VariableInspectorWidget.ui * R gui/ui/Variable/VariableMenuHeaderWidget.ui * R gui/ui/Visualization/VisualizationGraphWidget.ui * R gui/ui/Visualization/VisualizationTabWidget.ui * R gui/ui/Visualization/VisualizationWidget.ui * R gui/ui/Visualization/VisualizationZoneWidget.ui * R gui/vera-exclusions/exclusions.txt * R plugin/CMakeLists.txt * R plugin/cmake/Findsciqlop-plugin.cmake * R plugin/include/Plugin/IPlugin.h * R plugins/amda/CMakeLists.txt * R plugins/amda/cmake/Findsciqlop-amda.cmake * R plugins/amda/include/AmdaDefs.h * R plugins/amda/include/AmdaGlobal.h * R plugins/amda/include/AmdaParser.h * R plugins/amda/include/AmdaPlugin.h * R plugins/amda/include/AmdaResultParser.h * R plugins/amda/resources/amda.json * R plugins/amda/resources/amdaresources.qrc * R plugins/amda/resources/samples/AmdaSample.json * R plugins/amda/src/AmdaDefs.cpp * R plugins/amda/src/AmdaParser.cpp * R plugins/amda/src/AmdaPlugin.cpp * R plugins/amda/tests-resources/TestAmdaParser/TwoRootsFile.json * R plugins/amda/tests-resources/TestAmdaParser/ValidFile1.json * R plugins/amda/tests-resources/TestAmdaParser/WrongRootKey.json * R plugins/amda/tests-resources/TestAmdaParser/WrongRootType.json * R plugins/amda/tests-resources/TestAmdaResultParser/NaNValue.txt * R plugins/amda/tests-resources/TestAmdaResultParser/NoUnit.txt * R plugins/amda/tests-resources/TestAmdaResultParser/TooManyValues.txt * R plugins/amda/tests-resources/TestAmdaResultParser/ValidScalar1.txt * R plugins/amda/tests-resources/TestAmdaResultParser/WrongDate.txt * R plugins/amda/tests-resources/TestAmdaResultParser/WrongUnit.txt * R plugins/amda/tests-resources/TestAmdaResultParser/WrongValue.txt * R plugins/amda/tests/TestAmdaParser.cpp * R plugins/mockplugin/CMakeLists.txt * R plugins/mockplugin/cmake/Findsciqlop-mockplugin.cmake * R plugins/mockplugin/include/MockPlugin.h * R plugins/mockplugin/include/MockPluginGlobal.h * R plugins/mockplugin/resources/mockplugin.json * R plugins/mockplugin/src/MockPlugin.cpp * R README.md * R app/CMakeLists.txt * R app/include/MainWindow.h * R app/src/Main.cpp * R app/vera-exclusions/exclusions.txt * R cmake/sciqlop.cmake * R cmake/sciqlop_applications.cmake * R cmake/sciqlop_package.cmake * R cmake/sciqlop_params.cmake * R core/CMakeLists.txt * R core/include/Common/spimpl.h * R core/include/DataSource/DataSourceController.h * R core/include/DataSource/DataSourceItem.h * R core/src/DataSource/DataSourceController.cpp * R core/src/DataSource/DataSourceItem.cpp * R core/tests/DataSource/TestDataSourceController.cpp * R core/vera-exclusions/exclusions.txt * R formatting/cmake/use_clangformat.cmake * R formatting/vera-exclusions/exclusions.txt * R gui/CMakeLists.txt * R gui/include/SqpApplication.h * R LICENSE * R app/src/mainwindow.cpp * R app/src/mainwindow.ui
Status change > Approved
You need to be logged in to leave comments.
Login now