##// END OF EJS Templates
Activate graph mode + create variable in selected zone...
trabillard -
r1290:d90cec6b40ba
parent child
Show More
@@ -6,10 +6,15
6 #include <Catalogue/CatalogueExplorerHelper.h>
6 #include <Catalogue/CatalogueExplorerHelper.h>
7 #include <CatalogueDao.h>
7 #include <CatalogueDao.h>
8 #include <DBCatalogue.h>
8 #include <DBCatalogue.h>
9 #include <DBEventProduct.h>
10 #include <DataSource/DataSourceController.h>
9 #include <SqpApplication.h>
11 #include <SqpApplication.h>
12 #include <Variable/Variable.h>
13 #include <Variable/VariableController.h>
10 #include <Visualization/VisualizationTabWidget.h>
14 #include <Visualization/VisualizationTabWidget.h>
11 #include <Visualization/VisualizationWidget.h>
15 #include <Visualization/VisualizationWidget.h>
12 #include <Visualization/VisualizationZoneWidget.h>
16 #include <Visualization/VisualizationZoneWidget.h>
17 #include <Visualization/VisualizationGraphWidget.h>
13
18
14 #include <QDialog>
19 #include <QDialog>
15 #include <QDialogButtonBox>
20 #include <QDialogButtonBox>
@@ -28,6 +33,7 struct CatalogueEventsWidget::CatalogueEventsWidgetPrivate {
28 QString m_ZoneForGraphMode;
33 QString m_ZoneForGraphMode;
29 QVector<std::shared_ptr<DBCatalogue> > m_DisplayedCatalogues;
34 QVector<std::shared_ptr<DBCatalogue> > m_DisplayedCatalogues;
30 bool m_AllEventDisplayed = false;
35 bool m_AllEventDisplayed = false;
36 QVector<VisualizationGraphWidget *> m_CustomGraphs;
31
37
32 VisualizationWidget *m_VisualizationWidget = nullptr;
38 VisualizationWidget *m_VisualizationWidget = nullptr;
33
39
@@ -187,7 +193,29 struct CatalogueEventsWidget::CatalogueEventsWidgetPrivate {
187 if (m_VisualizationWidget) {
193 if (m_VisualizationWidget) {
188 if (auto tab = m_VisualizationWidget->currentTabWidget()) {
194 if (auto tab = m_VisualizationWidget->currentTabWidget()) {
189 if (auto zone = tab->getZoneWithName(m_ZoneForGraphMode)) {
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 else {
221 else {
@@ -85,9 +85,6
85 </item>
85 </item>
86 <item>
86 <item>
87 <widget class="QToolButton" name="btnChart">
87 <widget class="QToolButton" name="btnChart">
88 <property name="enabled">
89 <bool>false</bool>
90 </property>
91 <property name="text">
88 <property name="text">
92 <string>G</string>
89 <string>G</string>
93 </property>
90 </property>
General Comments 0
You need to be logged in to leave comments. Login now