@@ -89,6 +89,8 signals: | |||||
89 | /// validated, canceled, or failed) |
|
89 | /// validated, canceled, or failed) | |
90 | void acquisitionFinished(); |
|
90 | void acquisitionFinished(); | |
91 |
|
91 | |||
|
92 | void variableAdded(const std::shared_ptr<Variable> &variable); | |||
|
93 | ||||
92 | public slots: |
|
94 | public slots: | |
93 | /// Request the data loading of the variable whithin range |
|
95 | /// Request the data loading of the variable whithin range | |
94 | void onRequestDataLoading(QVector<std::shared_ptr<Variable> > variables, const SqpRange &range, |
|
96 | void onRequestDataLoading(QVector<std::shared_ptr<Variable> > variables, const SqpRange &range, |
@@ -373,6 +373,8 VariableController::createVariable(const QString &name, const QVariantHash &meta | |||||
373 | // impl->processRequest(newVariable, range, varRequestId); |
|
373 | // impl->processRequest(newVariable, range, varRequestId); | |
374 | // impl->updateVariableRequest(varRequestId); |
|
374 | // impl->updateVariableRequest(varRequestId); | |
375 |
|
375 | |||
|
376 | emit variableAdded(newVariable); | |||
|
377 | ||||
376 | return newVariable; |
|
378 | return newVariable; | |
377 | } |
|
379 | } | |
378 |
|
380 |
@@ -375,10 +375,15 void VisualizationTabWidget::VisualizationTabWidgetPrivate::dropProducts( | |||||
375 | return; |
|
375 | return; | |
376 | } |
|
376 | } | |
377 |
|
377 | |||
|
378 | auto context = new QObject{tabWidget}; | |||
|
379 | connect(&sqpApp->variableController(), &VariableController::variableAdded, context, | |||
|
380 | [this, index, tabWidget, context](auto variable) { | |||
|
381 | tabWidget->createZone({variable}, index); | |||
|
382 | delete context; // removes the connection | |||
|
383 | }, | |||
|
384 | Qt::QueuedConnection); | |||
|
385 | ||||
378 | auto productData = productsMetaData.first().toHash(); |
|
386 | auto productData = productsMetaData.first().toHash(); | |
379 | QMetaObject::invokeMethod(&sqpApp->dataSourceController(), "requestVariable", |
|
387 | QMetaObject::invokeMethod(&sqpApp->dataSourceController(), "requestVariable", | |
380 | Qt::QueuedConnection, Q_ARG(QVariantHash, productData)); |
|
388 | Qt::QueuedConnection, Q_ARG(QVariantHash, productData)); | |
381 |
|
||||
382 |
|
||||
383 | // TODO: add graph |
|
|||
384 | } |
|
389 | } |
@@ -516,6 +516,14 void VisualizationZoneWidget::dropMimeDataOnGraph(VisualizationDragWidget *dragW | |||||
516 | auto products = sqpApp->dataSourceController().productsDataForMimeData( |
|
516 | auto products = sqpApp->dataSourceController().productsDataForMimeData( | |
517 | mimeData->data(MIME_TYPE_PRODUCT_LIST)); |
|
517 | mimeData->data(MIME_TYPE_PRODUCT_LIST)); | |
518 |
|
518 | |||
|
519 | auto context = new QObject{this}; | |||
|
520 | connect(&sqpApp->variableController(), &VariableController::variableAdded, context, | |||
|
521 | [this, graphWidget, context](auto variable) { | |||
|
522 | graphWidget->addVariable(variable, graphWidget->graphRange()); | |||
|
523 | delete context; // removes the connection | |||
|
524 | }, | |||
|
525 | Qt::QueuedConnection); | |||
|
526 | ||||
519 | auto productData = products.first().toHash(); |
|
527 | auto productData = products.first().toHash(); | |
520 | QMetaObject::invokeMethod(&sqpApp->dataSourceController(), "requestVariable", |
|
528 | QMetaObject::invokeMethod(&sqpApp->dataSourceController(), "requestVariable", | |
521 | Qt::QueuedConnection, Q_ARG(QVariantHash, productData)); |
|
529 | Qt::QueuedConnection, Q_ARG(QVariantHash, productData)); | |
@@ -630,10 +638,15 void VisualizationZoneWidget::VisualizationZoneWidgetPrivate::dropProducts( | |||||
630 | return; |
|
638 | return; | |
631 | } |
|
639 | } | |
632 |
|
640 | |||
|
641 | auto context = new QObject{zoneWidget}; | |||
|
642 | connect(&sqpApp->variableController(), &VariableController::variableAdded, context, | |||
|
643 | [this, index, zoneWidget, context](auto variable) { | |||
|
644 | zoneWidget->createGraph(variable, index); | |||
|
645 | delete context; // removes the connection | |||
|
646 | }, | |||
|
647 | Qt::QueuedConnection); | |||
|
648 | ||||
633 | auto productData = productsData.first().toHash(); |
|
649 | auto productData = productsData.first().toHash(); | |
634 | QMetaObject::invokeMethod(&sqpApp->dataSourceController(), "requestVariable", |
|
650 | QMetaObject::invokeMethod(&sqpApp->dataSourceController(), "requestVariable", | |
635 | Qt::QueuedConnection, Q_ARG(QVariantHash, productData)); |
|
651 | Qt::QueuedConnection, Q_ARG(QVariantHash, productData)); | |
636 |
|
||||
637 |
|
||||
638 | // TODO: add graph |
|
|||
639 | } |
|
652 | } |
General Comments 0
You need to be logged in to leave comments.
Login now