##// END OF EJS Templates
Activate graph mode + create variable in selected zone...
trabillard -
r1344:d90cec6b40ba
parent child
Show More
@@ -6,10 +6,15
6 6 #include <Catalogue/CatalogueExplorerHelper.h>
7 7 #include <CatalogueDao.h>
8 8 #include <DBCatalogue.h>
9 #include <DBEventProduct.h>
10 #include <DataSource/DataSourceController.h>
9 11 #include <SqpApplication.h>
12 #include <Variable/Variable.h>
13 #include <Variable/VariableController.h>
10 14 #include <Visualization/VisualizationTabWidget.h>
11 15 #include <Visualization/VisualizationWidget.h>
12 16 #include <Visualization/VisualizationZoneWidget.h>
17 #include <Visualization/VisualizationGraphWidget.h>
13 18
14 19 #include <QDialog>
15 20 #include <QDialogButtonBox>
@@ -28,6 +33,7 struct CatalogueEventsWidget::CatalogueEventsWidgetPrivate {
28 33 QString m_ZoneForGraphMode;
29 34 QVector<std::shared_ptr<DBCatalogue> > m_DisplayedCatalogues;
30 35 bool m_AllEventDisplayed = false;
36 QVector<VisualizationGraphWidget *> m_CustomGraphs;
31 37
32 38 VisualizationWidget *m_VisualizationWidget = nullptr;
33 39
@@ -187,7 +193,29 struct CatalogueEventsWidget::CatalogueEventsWidgetPrivate {
187 193 if (m_VisualizationWidget) {
188 194 if (auto tab = m_VisualizationWidget->currentTabWidget()) {
189 195 if (auto zone = tab->getZoneWithName(m_ZoneForGraphMode)) {
190 // TODO
196
197 for (auto graph : m_CustomGraphs) {
198 graph->close();
199 }
200 m_CustomGraphs.clear();
201
202 for (auto eventProduct : event->getEventProducts()) {
203 auto productId = eventProduct.getProductId();
204
205 auto context = new QObject{treeView};
206 QObject::connect(&sqpApp->variableController(),
207 &VariableController::variableAdded, context,
208 [this, zone, context](auto variable) {
209 auto graph = zone->createGraph(variable);
210 m_CustomGraphs << graph;
211 delete context; // removes the connection
212 },
213 Qt::QueuedConnection);
214
215 QMetaObject::invokeMethod(
216 &sqpApp->dataSourceController(), "requestVariableFromProductIdKey",
217 Qt::QueuedConnection, Q_ARG(QString, productId));
218 }
191 219 }
192 220 }
193 221 else {
@@ -85,9 +85,6
85 85 </item>
86 86 <item>
87 87 <widget class="QToolButton" name="btnChart">
88 <property name="enabled">
89 <bool>false</bool>
90 </property>
91 88 <property name="text">
92 89 <string>G</string>
93 90 </property>
General Comments 0
You need to be logged in to leave comments. Login now