##// END OF EJS Templates
Integrates the drag&drop classes into the existing visualization classes.
trabillard -
r842:5f082699d3e8
parent child
Show More
@@ -1,97 +1,107
1 #ifndef SCIQLOP_VISUALIZATIONGRAPHWIDGET_H
1 #ifndef SCIQLOP_VISUALIZATIONGRAPHWIDGET_H
2 #define SCIQLOP_VISUALIZATIONGRAPHWIDGET_H
2 #define SCIQLOP_VISUALIZATIONGRAPHWIDGET_H
3
3
4 #include "Visualization/IVisualizationWidget.h"
4 #include "Visualization/IVisualizationWidget.h"
5 #include "Visualization/VisualizationDragWidget.h"
5
6
6 #include <QLoggingCategory>
7 #include <QLoggingCategory>
7 #include <QWidget>
8 #include <QWidget>
8
9
9 #include <memory>
10 #include <memory>
10
11
11 #include <Common/spimpl.h>
12 #include <Common/spimpl.h>
12
13
13 Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationGraphWidget)
14 Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationGraphWidget)
14
15
15 class QCPRange;
16 class QCPRange;
16 class QCustomPlot;
17 class QCustomPlot;
17 class SqpRange;
18 class SqpRange;
18 class Variable;
19 class Variable;
20 class VisualizationZoneWidget;
19
21
20 namespace Ui {
22 namespace Ui {
21 class VisualizationGraphWidget;
23 class VisualizationGraphWidget;
22 } // namespace Ui
24 } // namespace Ui
23
25
24 class VisualizationGraphWidget : public QWidget, public IVisualizationWidget {
26 class VisualizationGraphWidget : public VisualizationDragWidget, public IVisualizationWidget {
25 Q_OBJECT
27 Q_OBJECT
26
28
27 friend class QCustomPlotSynchronizer;
29 friend class QCustomPlotSynchronizer;
28 friend class VisualizationGraphRenderingDelegate;
30 friend class VisualizationGraphRenderingDelegate;
29
31
30 public:
32 public:
31 explicit VisualizationGraphWidget(const QString &name = {}, QWidget *parent = 0);
33 explicit VisualizationGraphWidget(const QString &name = {}, QWidget *parent = 0);
32 virtual ~VisualizationGraphWidget();
34 virtual ~VisualizationGraphWidget();
33
35
36 VisualizationZoneWidget* parentZoneWidget() const noexcept;
37
34 /// If acquisition isn't enable, requestDataLoading signal cannot be emit
38 /// If acquisition isn't enable, requestDataLoading signal cannot be emit
35 void enableAcquisition(bool enable);
39 void enableAcquisition(bool enable);
36
40
37 void addVariable(std::shared_ptr<Variable> variable, SqpRange range);
41 void addVariable(std::shared_ptr<Variable> variable, SqpRange range);
38
42
39 /// Removes a variable from the graph
43 /// Removes a variable from the graph
40 void removeVariable(std::shared_ptr<Variable> variable) noexcept;
44 void removeVariable(std::shared_ptr<Variable> variable) noexcept;
41
45
46 /// Returns the list of all variables used in the graph
47 QList<std::shared_ptr<Variable>> variables() const;
48
42 void setYRange(const SqpRange &range);
49 void setYRange(const SqpRange &range);
43 SqpRange graphRange() const noexcept;
50 SqpRange graphRange() const noexcept;
44 void setGraphRange(const SqpRange &range);
51 void setGraphRange(const SqpRange &range);
45
52
46 // IVisualizationWidget interface
53 // IVisualizationWidget interface
47 void accept(IVisualizationWidgetVisitor *visitor) override;
54 void accept(IVisualizationWidgetVisitor *visitor) override;
48 bool canDrop(const Variable &variable) const override;
55 bool canDrop(const Variable &variable) const override;
49 bool contains(const Variable &variable) const override;
56 bool contains(const Variable &variable) const override;
50 QString name() const override;
57 QString name() const override;
51
58
59 // VisualisationDragWidget
60 QMimeData* mimeData() const override;
61 bool isDragAllowed() const override;
52
62
53 signals:
63 signals:
54 void synchronize(const SqpRange &range, const SqpRange &oldRange);
64 void synchronize(const SqpRange &range, const SqpRange &oldRange);
55 void requestDataLoading(QVector<std::shared_ptr<Variable> > variable, const SqpRange &range,
65 void requestDataLoading(QVector<std::shared_ptr<Variable> > variable, const SqpRange &range,
56 bool synchronise);
66 bool synchronise);
57
67
58 /// Signal emitted when the variable is about to be removed from the graph
68 /// Signal emitted when the variable is about to be removed from the graph
59 void variableAboutToBeRemoved(std::shared_ptr<Variable> var);
69 void variableAboutToBeRemoved(std::shared_ptr<Variable> var);
60 /// Signal emitted when the variable has been added to the graph
70 /// Signal emitted when the variable has been added to the graph
61 void variableAdded(std::shared_ptr<Variable> var);
71 void variableAdded(std::shared_ptr<Variable> var);
62
72
63 protected:
73 protected:
64 void closeEvent(QCloseEvent *event) override;
74 void closeEvent(QCloseEvent *event) override;
65 void enterEvent(QEvent *event) override;
75 void enterEvent(QEvent *event) override;
66 void leaveEvent(QEvent *event) override;
76 void leaveEvent(QEvent *event) override;
67
77
68 QCustomPlot &plot() noexcept;
78 QCustomPlot &plot() noexcept;
69
79
70 private:
80 private:
71 Ui::VisualizationGraphWidget *ui;
81 Ui::VisualizationGraphWidget *ui;
72
82
73 class VisualizationGraphWidgetPrivate;
83 class VisualizationGraphWidgetPrivate;
74 spimpl::unique_impl_ptr<VisualizationGraphWidgetPrivate> impl;
84 spimpl::unique_impl_ptr<VisualizationGraphWidgetPrivate> impl;
75
85
76 private slots:
86 private slots:
77 /// Slot called when right clicking on the graph (displays a menu)
87 /// Slot called when right clicking on the graph (displays a menu)
78 void onGraphMenuRequested(const QPoint &pos) noexcept;
88 void onGraphMenuRequested(const QPoint &pos) noexcept;
79
89
80 /// Rescale the X axe to range parameter
90 /// Rescale the X axe to range parameter
81 void onRangeChanged(const QCPRange &t1, const QCPRange &t2);
91 void onRangeChanged(const QCPRange &t1, const QCPRange &t2);
82
92
83 /// Slot called when a mouse move was made
93 /// Slot called when a mouse move was made
84 void onMouseMove(QMouseEvent *event) noexcept;
94 void onMouseMove(QMouseEvent *event) noexcept;
85 /// Slot called when a mouse wheel was made, to perform some processing before the zoom is done
95 /// Slot called when a mouse wheel was made, to perform some processing before the zoom is done
86 void onMouseWheel(QWheelEvent *event) noexcept;
96 void onMouseWheel(QWheelEvent *event) noexcept;
87 /// Slot called when a mouse press was made, to activate the calibration of a graph
97 /// Slot called when a mouse press was made, to activate the calibration of a graph
88 void onMousePress(QMouseEvent *event) noexcept;
98 void onMousePress(QMouseEvent *event) noexcept;
89 /// Slot called when a mouse release was made, to deactivate the calibration of a graph
99 /// Slot called when a mouse release was made, to deactivate the calibration of a graph
90 void onMouseRelease(QMouseEvent *event) noexcept;
100 void onMouseRelease(QMouseEvent *event) noexcept;
91
101
92 void onDataCacheVariableUpdated();
102 void onDataCacheVariableUpdated();
93
103
94 void onUpdateVarDisplaying(std::shared_ptr<Variable> variable, const SqpRange &range);
104 void onUpdateVarDisplaying(std::shared_ptr<Variable> variable, const SqpRange &range);
95 };
105 };
96
106
97 #endif // SCIQLOP_VISUALIZATIONGRAPHWIDGET_H
107 #endif // SCIQLOP_VISUALIZATIONGRAPHWIDGET_H
@@ -1,57 +1,72
1 #ifndef SCIQLOP_VISUALIZATIONTABWIDGET_H
1 #ifndef SCIQLOP_VISUALIZATIONTABWIDGET_H
2 #define SCIQLOP_VISUALIZATIONTABWIDGET_H
2 #define SCIQLOP_VISUALIZATIONTABWIDGET_H
3
3
4 #include "Visualization/IVisualizationWidget.h"
4 #include "Visualization/IVisualizationWidget.h"
5
5
6 #include <Common/spimpl.h>
6 #include <Common/spimpl.h>
7
7
8 #include <QLoggingCategory>
8 #include <QLoggingCategory>
9 #include <QWidget>
9 #include <QWidget>
10 #include <QMimeData>
10
11
11 Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationTabWidget)
12 Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationTabWidget)
12
13
13 class Variable;
14 class Variable;
14 class VisualizationZoneWidget;
15 class VisualizationZoneWidget;
15
16
16 namespace Ui {
17 namespace Ui {
17 class VisualizationTabWidget;
18 class VisualizationTabWidget;
18 } // namespace Ui
19 } // namespace Ui
19
20
20 class VisualizationTabWidget : public QWidget, public IVisualizationWidget {
21 class VisualizationTabWidget : public QWidget, public IVisualizationWidget {
21 Q_OBJECT
22 Q_OBJECT
22
23
23 public:
24 public:
24 explicit VisualizationTabWidget(const QString &name = {}, QWidget *parent = 0);
25 explicit VisualizationTabWidget(const QString &name = {}, QWidget *parent = 0);
25 virtual ~VisualizationTabWidget();
26 virtual ~VisualizationTabWidget();
26
27
27 /// Add a zone widget
28 /// Add a zone widget
28 void addZone(VisualizationZoneWidget *zoneWidget);
29 void addZone(VisualizationZoneWidget *zoneWidget);
29
30
31 void insertZone(int index, VisualizationZoneWidget *zoneWidget);
32
30 /**
33 /**
31 * Creates a zone using a variable. The variable will be displayed in a new graph of the new
34 * Creates a zone using a variable. The variable will be displayed in a new graph of the new
32 * zone.
35 * zone. The zone is added at the end.
33 * @param variable the variable for which to create the zone
36 * @param variable the variable for which to create the zone
34 * @return the pointer to the created zone
37 * @return the pointer to the created zone
35 */
38 */
36 VisualizationZoneWidget *createZone(std::shared_ptr<Variable> variable);
39 VisualizationZoneWidget *createZone(std::shared_ptr<Variable> variable);
37
40
41 /**
42 * Creates a zone using a list of variables. The variables will be displayed in a new graph of the new
43 * zone. The zone is inserted at the specified index.
44 * @param variables the variables for which to create the zone
45 * @param index The index where the zone should be inserted in the layout
46 * @return the pointer to the created zone
47 */
48 VisualizationZoneWidget *createZone(const QList<std::shared_ptr<Variable>>& variables, int index);
49
38 // IVisualizationWidget interface
50 // IVisualizationWidget interface
39 void accept(IVisualizationWidgetVisitor *visitor) override;
51 void accept(IVisualizationWidgetVisitor *visitor) override;
40 bool canDrop(const Variable &variable) const override;
52 bool canDrop(const Variable &variable) const override;
41 bool contains(const Variable &variable) const override;
53 bool contains(const Variable &variable) const override;
42 QString name() const override;
54 QString name() const override;
43
55
44 protected:
56 protected:
45 void closeEvent(QCloseEvent *event) override;
57 void closeEvent(QCloseEvent *event) override;
46
58
47 private:
59 private:
48 /// @return the layout of tab in which zones are added
60 /// @return the layout of tab in which zones are added
49 QLayout &tabLayout() const noexcept;
61 QLayout &tabLayout() const noexcept;
50
62
51 Ui::VisualizationTabWidget *ui;
63 Ui::VisualizationTabWidget *ui;
52
64
53 class VisualizationTabWidgetPrivate;
65 class VisualizationTabWidgetPrivate;
54 spimpl::unique_impl_ptr<VisualizationTabWidgetPrivate> impl;
66 spimpl::unique_impl_ptr<VisualizationTabWidgetPrivate> impl;
67
68 private slots:
69 void dropMimeData(int index, const QMimeData *mimeData);
55 };
70 };
56
71
57 #endif // SCIQLOP_VISUALIZATIONTABWIDGET_H
72 #endif // SCIQLOP_VISUALIZATIONTABWIDGET_H
@@ -1,60 +1,89
1 #ifndef SCIQLOP_VISUALIZATIONZONEWIDGET_H
1 #ifndef SCIQLOP_VISUALIZATIONZONEWIDGET_H
2 #define SCIQLOP_VISUALIZATIONZONEWIDGET_H
2 #define SCIQLOP_VISUALIZATIONZONEWIDGET_H
3
3
4 #include "Visualization/IVisualizationWidget.h"
4 #include "Visualization/IVisualizationWidget.h"
5 #include "Visualization/VisualizationDragWidget.h"
5
6
6 #include <QLoggingCategory>
7 #include <QLoggingCategory>
7 #include <QWidget>
8 #include <QWidget>
8
9
9 #include <memory>
10 #include <memory>
10
11
11 #include <Common/spimpl.h>
12 #include <Common/spimpl.h>
12
13
13 Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationZoneWidget)
14 Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationZoneWidget)
14
15
15 namespace Ui {
16 namespace Ui {
16 class VisualizationZoneWidget;
17 class VisualizationZoneWidget;
17 } // Ui
18 } // Ui
18
19
19 class Variable;
20 class Variable;
20 class VisualizationGraphWidget;
21 class VisualizationGraphWidget;
21
22
22 class VisualizationZoneWidget : public QWidget, public IVisualizationWidget {
23 class VisualizationZoneWidget : public VisualizationDragWidget, public IVisualizationWidget {
23 Q_OBJECT
24 Q_OBJECT
24
25
25 public:
26 public:
26 explicit VisualizationZoneWidget(const QString &name = {}, QWidget *parent = 0);
27 explicit VisualizationZoneWidget(const QString &name = {}, QWidget *parent = 0);
27 virtual ~VisualizationZoneWidget();
28 virtual ~VisualizationZoneWidget();
28
29
29 /// Add a graph widget
30 /// Adds a graph widget
30 void addGraph(VisualizationGraphWidget *graphWidget);
31 void addGraph(VisualizationGraphWidget *graphWidget);
31
32
33 /// Inserts a graph widget
34 void insertGraph(int index, VisualizationGraphWidget *graphWidget);
35
32 /**
36 /**
33 * Creates a graph using a variable. The variable will be displayed in the new graph.
37 * Creates a graph using a variable. The variable will be displayed in the new graph.
38 * The graph is added at the end.
34 * @param variable the variable for which to create the graph
39 * @param variable the variable for which to create the graph
35 * @return the pointer to the created graph
40 * @return the pointer to the created graph
36 */
41 */
37 VisualizationGraphWidget *createGraph(std::shared_ptr<Variable> variable);
42 VisualizationGraphWidget *createGraph(std::shared_ptr<Variable> variable);
38
43
44 /**
45 * Creates a graph using a variable. The variable will be displayed in the new graph.
46 * The graph is inserted at the specified index.
47 * @param variable the variable for which to create the graph
48 * @param index The index where the graph should be inserted in the layout
49 * @return the pointer to the created graph
50 */
51 VisualizationGraphWidget *createGraph(std::shared_ptr<Variable> variable, int index);
52
53 /**
54 * Creates a graph using a list of variables. The variables will be displayed in the new graph.
55 * The graph is inserted at the specified index.
56 * @param variables List of variables to be added to the graph
57 * @param index The index where the graph should be inserted in the layout
58 * @return the pointer to the created graph
59 */
60 VisualizationGraphWidget *createGraph(const QList<std::shared_ptr<Variable>> variables, int index);
61
39 // IVisualizationWidget interface
62 // IVisualizationWidget interface
40 void accept(IVisualizationWidgetVisitor *visitor) override;
63 void accept(IVisualizationWidgetVisitor *visitor) override;
41 bool canDrop(const Variable &variable) const override;
64 bool canDrop(const Variable &variable) const override;
42 bool contains(const Variable &variable) const override;
65 bool contains(const Variable &variable) const override;
43 QString name() const override;
66 QString name() const override;
44
67
68 // VisualisationDragWidget
69 QMimeData* mimeData() const override;
70 bool isDragAllowed() const override;
71
45 protected:
72 protected:
46 void closeEvent(QCloseEvent *event) override;
73 void closeEvent(QCloseEvent *event) override;
47
74
48 private:
75 private:
49 Ui::VisualizationZoneWidget *ui;
76 Ui::VisualizationZoneWidget *ui;
50
77
51 class VisualizationZoneWidgetPrivate;
78 class VisualizationZoneWidgetPrivate;
52 spimpl::unique_impl_ptr<VisualizationZoneWidgetPrivate> impl;
79 spimpl::unique_impl_ptr<VisualizationZoneWidgetPrivate> impl;
53
80
54 private slots:
81 private slots:
55 void onVariableAdded(std::shared_ptr<Variable> variable);
82 void onVariableAdded(std::shared_ptr<Variable> variable);
56 /// Slot called when a variable is about to be removed from a graph contained in the zone
83 /// Slot called when a variable is about to be removed from a graph contained in the zone
57 void onVariableAboutToBeRemoved(std::shared_ptr<Variable> variable);
84 void onVariableAboutToBeRemoved(std::shared_ptr<Variable> variable);
85
86 void dropMimeData(int index, const QMimeData* mimeData);
58 };
87 };
59
88
60 #endif // SCIQLOP_VISUALIZATIONZONEWIDGET_H
89 #endif // SCIQLOP_VISUALIZATIONZONEWIDGET_H
@@ -1,342 +1,385
1 #include "Visualization/VisualizationGraphWidget.h"
1 #include "Visualization/VisualizationGraphWidget.h"
2 #include "Visualization/IVisualizationWidgetVisitor.h"
2 #include "Visualization/IVisualizationWidgetVisitor.h"
3 #include "Visualization/VisualizationDefs.h"
3 #include "Visualization/VisualizationDefs.h"
4 #include "Visualization/VisualizationGraphHelper.h"
4 #include "Visualization/VisualizationGraphHelper.h"
5 #include "Visualization/VisualizationGraphRenderingDelegate.h"
5 #include "Visualization/VisualizationGraphRenderingDelegate.h"
6 #include "Visualization/VisualizationZoneWidget.h"
6 #include "ui_VisualizationGraphWidget.h"
7 #include "ui_VisualizationGraphWidget.h"
7
8
8 #include <Data/ArrayData.h>
9 #include <Data/ArrayData.h>
9 #include <Data/IDataSeries.h>
10 #include <Data/IDataSeries.h>
10 #include <Settings/SqpSettingsDefs.h>
11 #include <Settings/SqpSettingsDefs.h>
11 #include <SqpApplication.h>
12 #include <SqpApplication.h>
13 #include <DragDropHelper.h>
12 #include <Variable/Variable.h>
14 #include <Variable/Variable.h>
13 #include <Variable/VariableController.h>
15 #include <Variable/VariableController.h>
14
16
15 #include <unordered_map>
17 #include <unordered_map>
16
18
17 Q_LOGGING_CATEGORY(LOG_VisualizationGraphWidget, "VisualizationGraphWidget")
19 Q_LOGGING_CATEGORY(LOG_VisualizationGraphWidget, "VisualizationGraphWidget")
18
20
19 namespace {
21 namespace {
20
22
21 /// Key pressed to enable zoom on horizontal axis
23 /// Key pressed to enable zoom on horizontal axis
22 const auto HORIZONTAL_ZOOM_MODIFIER = Qt::NoModifier;
24 const auto HORIZONTAL_ZOOM_MODIFIER = Qt::NoModifier;
23
25
24 /// Key pressed to enable zoom on vertical axis
26 /// Key pressed to enable zoom on vertical axis
25 const auto VERTICAL_ZOOM_MODIFIER = Qt::ControlModifier;
27 const auto VERTICAL_ZOOM_MODIFIER = Qt::ControlModifier;
26
28
27 } // namespace
29 } // namespace
28
30
29 struct VisualizationGraphWidget::VisualizationGraphWidgetPrivate {
31 struct VisualizationGraphWidget::VisualizationGraphWidgetPrivate {
30
32
31 explicit VisualizationGraphWidgetPrivate(const QString &name)
33 explicit VisualizationGraphWidgetPrivate(const QString &name)
32 : m_Name{name},
34 : m_Name{name},
33 m_DoAcquisition{true},
35 m_DoAcquisition{true},
34 m_IsCalibration{false},
36 m_IsCalibration{false},
35 m_RenderingDelegate{nullptr}
37 m_RenderingDelegate{nullptr}
36 {
38 {
37 }
39 }
38
40
39 QString m_Name;
41 QString m_Name;
40 // 1 variable -> n qcpplot
42 // 1 variable -> n qcpplot
41 std::map<std::shared_ptr<Variable>, PlottablesMap> m_VariableToPlotMultiMap;
43 std::map<std::shared_ptr<Variable>, PlottablesMap> m_VariableToPlotMultiMap;
42 bool m_DoAcquisition;
44 bool m_DoAcquisition;
43 bool m_IsCalibration;
45 bool m_IsCalibration;
44 QCPItemTracer *m_TextTracer;
46 QCPItemTracer *m_TextTracer;
45 /// Delegate used to attach rendering features to the plot
47 /// Delegate used to attach rendering features to the plot
46 std::unique_ptr<VisualizationGraphRenderingDelegate> m_RenderingDelegate;
48 std::unique_ptr<VisualizationGraphRenderingDelegate> m_RenderingDelegate;
47 };
49 };
48
50
49 VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget *parent)
51 VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget *parent)
50 : QWidget{parent},
52 : VisualizationDragWidget{parent},
51 ui{new Ui::VisualizationGraphWidget},
53 ui{new Ui::VisualizationGraphWidget},
52 impl{spimpl::make_unique_impl<VisualizationGraphWidgetPrivate>(name)}
54 impl{spimpl::make_unique_impl<VisualizationGraphWidgetPrivate>(name)}
53 {
55 {
54 ui->setupUi(this);
56 ui->setupUi(this);
55
57
56 // 'Close' options : widget is deleted when closed
58 // 'Close' options : widget is deleted when closed
57 setAttribute(Qt::WA_DeleteOnClose);
59 setAttribute(Qt::WA_DeleteOnClose);
58
60
59 // Set qcpplot properties :
61 // Set qcpplot properties :
60 // - Drag (on x-axis) and zoom are enabled
62 // - Drag (on x-axis) and zoom are enabled
61 // - Mouse wheel on qcpplot is intercepted to determine the zoom orientation
63 // - Mouse wheel on qcpplot is intercepted to determine the zoom orientation
62 ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectItems);
64 ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectItems);
63 ui->widget->axisRect()->setRangeDrag(Qt::Horizontal);
65 ui->widget->axisRect()->setRangeDrag(Qt::Horizontal);
64
66
65 // The delegate must be initialized after the ui as it uses the plot
67 // The delegate must be initialized after the ui as it uses the plot
66 impl->m_RenderingDelegate = std::make_unique<VisualizationGraphRenderingDelegate>(*this);
68 impl->m_RenderingDelegate = std::make_unique<VisualizationGraphRenderingDelegate>(*this);
67
69
68 connect(ui->widget, &QCustomPlot::mousePress, this, &VisualizationGraphWidget::onMousePress);
70 connect(ui->widget, &QCustomPlot::mousePress, this, &VisualizationGraphWidget::onMousePress);
69 connect(ui->widget, &QCustomPlot::mouseRelease, this,
71 connect(ui->widget, &QCustomPlot::mouseRelease, this,
70 &VisualizationGraphWidget::onMouseRelease);
72 &VisualizationGraphWidget::onMouseRelease);
71 connect(ui->widget, &QCustomPlot::mouseMove, this, &VisualizationGraphWidget::onMouseMove);
73 connect(ui->widget, &QCustomPlot::mouseMove, this, &VisualizationGraphWidget::onMouseMove);
72 connect(ui->widget, &QCustomPlot::mouseWheel, this, &VisualizationGraphWidget::onMouseWheel);
74 connect(ui->widget, &QCustomPlot::mouseWheel, this, &VisualizationGraphWidget::onMouseWheel);
73 connect(ui->widget->xAxis, static_cast<void (QCPAxis::*)(const QCPRange &, const QCPRange &)>(
75 connect(ui->widget->xAxis, static_cast<void (QCPAxis::*)(const QCPRange &, const QCPRange &)>(
74 &QCPAxis::rangeChanged),
76 &QCPAxis::rangeChanged),
75 this, &VisualizationGraphWidget::onRangeChanged, Qt::DirectConnection);
77 this, &VisualizationGraphWidget::onRangeChanged, Qt::DirectConnection);
76
78
77 // Activates menu when right clicking on the graph
79 // Activates menu when right clicking on the graph
78 ui->widget->setContextMenuPolicy(Qt::CustomContextMenu);
80 ui->widget->setContextMenuPolicy(Qt::CustomContextMenu);
79 connect(ui->widget, &QCustomPlot::customContextMenuRequested, this,
81 connect(ui->widget, &QCustomPlot::customContextMenuRequested, this,
80 &VisualizationGraphWidget::onGraphMenuRequested);
82 &VisualizationGraphWidget::onGraphMenuRequested);
81
83
82 connect(this, &VisualizationGraphWidget::requestDataLoading, &sqpApp->variableController(),
84 connect(this, &VisualizationGraphWidget::requestDataLoading, &sqpApp->variableController(),
83 &VariableController::onRequestDataLoading);
85 &VariableController::onRequestDataLoading);
84
86
85 connect(&sqpApp->variableController(), &VariableController::updateVarDisplaying, this,
87 connect(&sqpApp->variableController(), &VariableController::updateVarDisplaying, this,
86 &VisualizationGraphWidget::onUpdateVarDisplaying);
88 &VisualizationGraphWidget::onUpdateVarDisplaying);
87 }
89 }
88
90
89
91
90 VisualizationGraphWidget::~VisualizationGraphWidget()
92 VisualizationGraphWidget::~VisualizationGraphWidget()
91 {
93 {
92 delete ui;
94 delete ui;
93 }
95 }
94
96
97 VisualizationZoneWidget *VisualizationGraphWidget::parentZoneWidget() const noexcept
98 {
99 auto parent = parentWidget();
100 do
101 {
102 parent = parent->parentWidget();
note

parent can be null. don"t use do while :)

103 } while (parent != nullptr && !qobject_cast<VisualizationZoneWidget*>(parent));
104
105 return qobject_cast<VisualizationZoneWidget*>(parent);
106 }
107
95 void VisualizationGraphWidget::enableAcquisition(bool enable)
108 void VisualizationGraphWidget::enableAcquisition(bool enable)
96 {
109 {
97 impl->m_DoAcquisition = enable;
110 impl->m_DoAcquisition = enable;
98 }
111 }
99
112
100 void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable, SqpRange range)
113 void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable, SqpRange range)
101 {
114 {
102 // Uses delegate to create the qcpplot components according to the variable
115 // Uses delegate to create the qcpplot components according to the variable
103 auto createdPlottables = VisualizationGraphHelper::create(variable, *ui->widget);
116 auto createdPlottables = VisualizationGraphHelper::create(variable, *ui->widget);
104 impl->m_VariableToPlotMultiMap.insert({variable, std::move(createdPlottables)});
117 impl->m_VariableToPlotMultiMap.insert({variable, std::move(createdPlottables)});
105
118
106 // Set axes properties according to the units of the data series
119 // Set axes properties according to the units of the data series
107 /// @todo : for the moment, no control is performed on the axes: the units and the tickers
120 /// @todo : for the moment, no control is performed on the axes: the units and the tickers
108 /// are fixed for the default x-axis and y-axis of the plot, and according to the new graph
121 /// are fixed for the default x-axis and y-axis of the plot, and according to the new graph
109 auto xAxisUnit = Unit{};
122 auto xAxisUnit = Unit{};
110 auto valuesUnit = Unit{};
123 auto valuesUnit = Unit{};
111
124
112 if (auto dataSeries = variable->dataSeries()) {
125 if (auto dataSeries = variable->dataSeries()) {
113 dataSeries->lockRead();
126 dataSeries->lockRead();
114 xAxisUnit = dataSeries->xAxisUnit();
127 xAxisUnit = dataSeries->xAxisUnit();
115 valuesUnit = dataSeries->valuesUnit();
128 valuesUnit = dataSeries->valuesUnit();
116 dataSeries->unlock();
129 dataSeries->unlock();
117 }
130 }
118 impl->m_RenderingDelegate->setAxesProperties(xAxisUnit, valuesUnit);
131 impl->m_RenderingDelegate->setAxesProperties(xAxisUnit, valuesUnit);
119
132
120 connect(variable.get(), SIGNAL(updated()), this, SLOT(onDataCacheVariableUpdated()));
133 connect(variable.get(), SIGNAL(updated()), this, SLOT(onDataCacheVariableUpdated()));
121
134
122 this->enableAcquisition(false);
135 this->enableAcquisition(false);
123 this->setGraphRange(range);
136 this->setGraphRange(range);
124 this->enableAcquisition(true);
137 this->enableAcquisition(true);
125
138
126 emit requestDataLoading(QVector<std::shared_ptr<Variable> >() << variable, range, false);
139 emit requestDataLoading(QVector<std::shared_ptr<Variable> >() << variable, range, false);
127
140
128 emit variableAdded(variable);
141 emit variableAdded(variable);
129 }
142 }
130
143
131 void VisualizationGraphWidget::removeVariable(std::shared_ptr<Variable> variable) noexcept
144 void VisualizationGraphWidget::removeVariable(std::shared_ptr<Variable> variable) noexcept
132 {
145 {
133 // Each component associated to the variable :
146 // Each component associated to the variable :
134 // - is removed from qcpplot (which deletes it)
147 // - is removed from qcpplot (which deletes it)
135 // - is no longer referenced in the map
148 // - is no longer referenced in the map
136 auto variableIt = impl->m_VariableToPlotMultiMap.find(variable);
149 auto variableIt = impl->m_VariableToPlotMultiMap.find(variable);
137 if (variableIt != impl->m_VariableToPlotMultiMap.cend()) {
150 if (variableIt != impl->m_VariableToPlotMultiMap.cend()) {
138 emit variableAboutToBeRemoved(variable);
151 emit variableAboutToBeRemoved(variable);
139
152
140 auto &plottablesMap = variableIt->second;
153 auto &plottablesMap = variableIt->second;
141
154
142 for (auto plottableIt = plottablesMap.cbegin(), plottableEnd = plottablesMap.cend();
155 for (auto plottableIt = plottablesMap.cbegin(), plottableEnd = plottablesMap.cend();
143 plottableIt != plottableEnd;) {
156 plottableIt != plottableEnd;) {
144 ui->widget->removePlottable(plottableIt->second);
157 ui->widget->removePlottable(plottableIt->second);
145 plottableIt = plottablesMap.erase(plottableIt);
158 plottableIt = plottablesMap.erase(plottableIt);
146 }
159 }
147
160
148 impl->m_VariableToPlotMultiMap.erase(variableIt);
161 impl->m_VariableToPlotMultiMap.erase(variableIt);
149 }
162 }
150
163
151 // Updates graph
164 // Updates graph
152 ui->widget->replot();
165 ui->widget->replot();
153 }
166 }
154
167
168 QList<std::shared_ptr<Variable>> VisualizationGraphWidget::variables() const
169 {
170 auto variables = QList<std::shared_ptr<Variable>>{};
171 for (auto it = std::cbegin(impl->m_VariableToPlotMultiMap); it != std::cend(impl->m_VariableToPlotMultiMap); ++it)
172 {
173 variables << it->first;
174 }
175
176 return variables;
177 }
178
155 void VisualizationGraphWidget::setYRange(const SqpRange &range)
179 void VisualizationGraphWidget::setYRange(const SqpRange &range)
156 {
180 {
157 ui->widget->yAxis->setRange(range.m_TStart, range.m_TEnd);
181 ui->widget->yAxis->setRange(range.m_TStart, range.m_TEnd);
158 }
182 }
159
183
160 SqpRange VisualizationGraphWidget::graphRange() const noexcept
184 SqpRange VisualizationGraphWidget::graphRange() const noexcept
161 {
185 {
162 auto graphRange = ui->widget->xAxis->range();
186 auto graphRange = ui->widget->xAxis->range();
163 return SqpRange{graphRange.lower, graphRange.upper};
187 return SqpRange{graphRange.lower, graphRange.upper};
164 }
188 }
165
189
166 void VisualizationGraphWidget::setGraphRange(const SqpRange &range)
190 void VisualizationGraphWidget::setGraphRange(const SqpRange &range)
167 {
191 {
168 qCDebug(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::setGraphRange START");
192 qCDebug(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::setGraphRange START");
169 ui->widget->xAxis->setRange(range.m_TStart, range.m_TEnd);
193 ui->widget->xAxis->setRange(range.m_TStart, range.m_TEnd);
170 ui->widget->replot();
194 ui->widget->replot();
171 qCDebug(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::setGraphRange END");
195 qCDebug(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::setGraphRange END");
172 }
196 }
173
197
174 void VisualizationGraphWidget::accept(IVisualizationWidgetVisitor *visitor)
198 void VisualizationGraphWidget::accept(IVisualizationWidgetVisitor *visitor)
175 {
199 {
176 if (visitor) {
200 if (visitor) {
177 visitor->visit(this);
201 visitor->visit(this);
178 }
202 }
179 else {
203 else {
180 qCCritical(LOG_VisualizationGraphWidget())
204 qCCritical(LOG_VisualizationGraphWidget())
181 << tr("Can't visit widget : the visitor is null");
205 << tr("Can't visit widget : the visitor is null");
182 }
206 }
183 }
207 }
184
208
185 bool VisualizationGraphWidget::canDrop(const Variable &variable) const
209 bool VisualizationGraphWidget::canDrop(const Variable &variable) const
186 {
210 {
187 /// @todo : for the moment, a graph can always accomodate a variable
211 /// @todo : for the moment, a graph can always accomodate a variable
188 Q_UNUSED(variable);
212 Q_UNUSED(variable);
189 return true;
213 return true;
190 }
214 }
191
215
192 bool VisualizationGraphWidget::contains(const Variable &variable) const
216 bool VisualizationGraphWidget::contains(const Variable &variable) const
193 {
217 {
194 // Finds the variable among the keys of the map
218 // Finds the variable among the keys of the map
195 auto variablePtr = &variable;
219 auto variablePtr = &variable;
196 auto findVariable
220 auto findVariable
197 = [variablePtr](const auto &entry) { return variablePtr == entry.first.get(); };
221 = [variablePtr](const auto &entry) { return variablePtr == entry.first.get(); };
198
222
199 auto end = impl->m_VariableToPlotMultiMap.cend();
223 auto end = impl->m_VariableToPlotMultiMap.cend();
200 auto it = std::find_if(impl->m_VariableToPlotMultiMap.cbegin(), end, findVariable);
224 auto it = std::find_if(impl->m_VariableToPlotMultiMap.cbegin(), end, findVariable);
201 return it != end;
225 return it != end;
202 }
226 }
203
227
204 QString VisualizationGraphWidget::name() const
228 QString VisualizationGraphWidget::name() const
205 {
229 {
206 return impl->m_Name;
230 return impl->m_Name;
207 }
231 }
208
232
233 QMimeData *VisualizationGraphWidget::mimeData() const
234 {
235 auto *mimeData = new QMimeData;
note

auto mimeData

236 mimeData->setData(DragDropHelper::MIME_TYPE_GRAPH, QByteArray());
237
238 return mimeData;
239 }
240
241 bool VisualizationGraphWidget::isDragAllowed() const
242 {
243 return true;
244 }
245
209 void VisualizationGraphWidget::closeEvent(QCloseEvent *event)
246 void VisualizationGraphWidget::closeEvent(QCloseEvent *event)
210 {
247 {
211 Q_UNUSED(event);
248 Q_UNUSED(event);
212
249
213 // Prevents that all variables will be removed from graph when it will be closed
250 // Prevents that all variables will be removed from graph when it will be closed
214 for (auto &variableEntry : impl->m_VariableToPlotMultiMap) {
251 for (auto &variableEntry : impl->m_VariableToPlotMultiMap) {
215 emit variableAboutToBeRemoved(variableEntry.first);
252 emit variableAboutToBeRemoved(variableEntry.first);
216 }
253 }
217 }
254 }
218
255
219 void VisualizationGraphWidget::enterEvent(QEvent *event)
256 void VisualizationGraphWidget::enterEvent(QEvent *event)
220 {
257 {
221 Q_UNUSED(event);
258 Q_UNUSED(event);
222 impl->m_RenderingDelegate->showGraphOverlay(true);
259 impl->m_RenderingDelegate->showGraphOverlay(true);
223 }
260 }
224
261
225 void VisualizationGraphWidget::leaveEvent(QEvent *event)
262 void VisualizationGraphWidget::leaveEvent(QEvent *event)
226 {
263 {
227 Q_UNUSED(event);
264 Q_UNUSED(event);
228 impl->m_RenderingDelegate->showGraphOverlay(false);
265 impl->m_RenderingDelegate->showGraphOverlay(false);
229 }
266 }
230
267
231 QCustomPlot &VisualizationGraphWidget::plot() noexcept
268 QCustomPlot &VisualizationGraphWidget::plot() noexcept
232 {
269 {
233 return *ui->widget;
270 return *ui->widget;
234 }
271 }
235
272
236 void VisualizationGraphWidget::onGraphMenuRequested(const QPoint &pos) noexcept
273 void VisualizationGraphWidget::onGraphMenuRequested(const QPoint &pos) noexcept
237 {
274 {
238 QMenu graphMenu{};
275 QMenu graphMenu{};
239
276
240 // Iterates on variables (unique keys)
277 // Iterates on variables (unique keys)
241 for (auto it = impl->m_VariableToPlotMultiMap.cbegin(),
278 for (auto it = impl->m_VariableToPlotMultiMap.cbegin(),
242 end = impl->m_VariableToPlotMultiMap.cend();
279 end = impl->m_VariableToPlotMultiMap.cend();
243 it != end; it = impl->m_VariableToPlotMultiMap.upper_bound(it->first)) {
280 it != end; it = impl->m_VariableToPlotMultiMap.upper_bound(it->first)) {
244 // 'Remove variable' action
281 // 'Remove variable' action
245 graphMenu.addAction(tr("Remove variable %1").arg(it->first->name()),
282 graphMenu.addAction(tr("Remove variable %1").arg(it->first->name()),
246 [ this, var = it->first ]() { removeVariable(var); });
283 [ this, var = it->first ]() { removeVariable(var); });
247 }
284 }
248
285
249 if (!graphMenu.isEmpty()) {
286 if (!graphMenu.isEmpty()) {
250 graphMenu.exec(QCursor::pos());
287 graphMenu.exec(QCursor::pos());
251 }
288 }
252 }
289 }
253
290
254 void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange &t2)
291 void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange &t2)
255 {
292 {
256 qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: VisualizationGraphWidget::onRangeChanged")
293 qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: VisualizationGraphWidget::onRangeChanged")
257 << QThread::currentThread()->objectName() << "DoAcqui"
294 << QThread::currentThread()->objectName() << "DoAcqui"
258 << impl->m_DoAcquisition;
295 << impl->m_DoAcquisition;
259
296
260 auto graphRange = SqpRange{t1.lower, t1.upper};
297 auto graphRange = SqpRange{t1.lower, t1.upper};
261 auto oldGraphRange = SqpRange{t2.lower, t2.upper};
298 auto oldGraphRange = SqpRange{t2.lower, t2.upper};
262
299
263 if (impl->m_DoAcquisition) {
300 if (impl->m_DoAcquisition) {
264 QVector<std::shared_ptr<Variable> > variableUnderGraphVector;
301 QVector<std::shared_ptr<Variable> > variableUnderGraphVector;
265
302
266 for (auto it = impl->m_VariableToPlotMultiMap.begin(),
303 for (auto it = impl->m_VariableToPlotMultiMap.begin(),
267 end = impl->m_VariableToPlotMultiMap.end();
304 end = impl->m_VariableToPlotMultiMap.end();
268 it != end; it = impl->m_VariableToPlotMultiMap.upper_bound(it->first)) {
305 it != end; it = impl->m_VariableToPlotMultiMap.upper_bound(it->first)) {
269 variableUnderGraphVector.push_back(it->first);
306 variableUnderGraphVector.push_back(it->first);
270 }
307 }
271 emit requestDataLoading(std::move(variableUnderGraphVector), graphRange,
308 emit requestDataLoading(std::move(variableUnderGraphVector), graphRange,
272 !impl->m_IsCalibration);
309 !impl->m_IsCalibration);
273
310
274 if (!impl->m_IsCalibration) {
311 if (!impl->m_IsCalibration) {
275 qCDebug(LOG_VisualizationGraphWidget())
312 qCDebug(LOG_VisualizationGraphWidget())
276 << tr("TORM: VisualizationGraphWidget::Synchronize notify !!")
313 << tr("TORM: VisualizationGraphWidget::Synchronize notify !!")
277 << QThread::currentThread()->objectName() << graphRange << oldGraphRange;
314 << QThread::currentThread()->objectName() << graphRange << oldGraphRange;
278 emit synchronize(graphRange, oldGraphRange);
315 emit synchronize(graphRange, oldGraphRange);
279 }
316 }
280 }
317 }
281 }
318 }
282
319
283 void VisualizationGraphWidget::onMouseMove(QMouseEvent *event) noexcept
320 void VisualizationGraphWidget::onMouseMove(QMouseEvent *event) noexcept
284 {
321 {
285 // Handles plot rendering when mouse is moving
322 // Handles plot rendering when mouse is moving
286 impl->m_RenderingDelegate->onMouseMove(event);
323 impl->m_RenderingDelegate->onMouseMove(event);
324
325 VisualizationDragWidget::mouseMoveEvent(event);
287 }
326 }
288
327
289 void VisualizationGraphWidget::onMouseWheel(QWheelEvent *event) noexcept
328 void VisualizationGraphWidget::onMouseWheel(QWheelEvent *event) noexcept
290 {
329 {
291 auto zoomOrientations = QFlags<Qt::Orientation>{};
330 auto zoomOrientations = QFlags<Qt::Orientation>{};
292
331
293 // Lambda that enables a zoom orientation if the key modifier related to this orientation
332 // Lambda that enables a zoom orientation if the key modifier related to this orientation
294 // has
333 // has
295 // been pressed
334 // been pressed
296 auto enableOrientation
335 auto enableOrientation
297 = [&zoomOrientations, event](const auto &orientation, const auto &modifier) {
336 = [&zoomOrientations, event](const auto &orientation, const auto &modifier) {
298 auto orientationEnabled = event->modifiers().testFlag(modifier);
337 auto orientationEnabled = event->modifiers().testFlag(modifier);
299 zoomOrientations.setFlag(orientation, orientationEnabled);
338 zoomOrientations.setFlag(orientation, orientationEnabled);
300 };
339 };
301 enableOrientation(Qt::Vertical, VERTICAL_ZOOM_MODIFIER);
340 enableOrientation(Qt::Vertical, VERTICAL_ZOOM_MODIFIER);
302 enableOrientation(Qt::Horizontal, HORIZONTAL_ZOOM_MODIFIER);
341 enableOrientation(Qt::Horizontal, HORIZONTAL_ZOOM_MODIFIER);
303
342
304 ui->widget->axisRect()->setRangeZoom(zoomOrientations);
343 ui->widget->axisRect()->setRangeZoom(zoomOrientations);
305 }
344 }
306
345
307 void VisualizationGraphWidget::onMousePress(QMouseEvent *event) noexcept
346 void VisualizationGraphWidget::onMousePress(QMouseEvent *event) noexcept
308 {
347 {
309 impl->m_IsCalibration = event->modifiers().testFlag(Qt::ControlModifier);
348 impl->m_IsCalibration = event->modifiers().testFlag(Qt::ControlModifier);
349
350 plot().setInteraction(QCP::iRangeDrag, !event->modifiers().testFlag(Qt::AltModifier));
351
352 VisualizationDragWidget::mousePressEvent(event);
310 }
353 }
311
354
312 void VisualizationGraphWidget::onMouseRelease(QMouseEvent *event) noexcept
355 void VisualizationGraphWidget::onMouseRelease(QMouseEvent *event) noexcept
313 {
356 {
314 impl->m_IsCalibration = false;
357 impl->m_IsCalibration = false;
315 }
358 }
316
359
317 void VisualizationGraphWidget::onDataCacheVariableUpdated()
360 void VisualizationGraphWidget::onDataCacheVariableUpdated()
318 {
361 {
319 auto graphRange = ui->widget->xAxis->range();
362 auto graphRange = ui->widget->xAxis->range();
320 auto dateTime = SqpRange{graphRange.lower, graphRange.upper};
363 auto dateTime = SqpRange{graphRange.lower, graphRange.upper};
321
364
322 for (auto &variableEntry : impl->m_VariableToPlotMultiMap) {
365 for (auto &variableEntry : impl->m_VariableToPlotMultiMap) {
323 auto variable = variableEntry.first;
366 auto variable = variableEntry.first;
324 qCDebug(LOG_VisualizationGraphWidget())
367 qCDebug(LOG_VisualizationGraphWidget())
325 << "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated S" << variable->range();
368 << "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated S" << variable->range();
326 qCDebug(LOG_VisualizationGraphWidget())
369 qCDebug(LOG_VisualizationGraphWidget())
327 << "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated E" << dateTime;
370 << "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated E" << dateTime;
328 if (dateTime.contains(variable->range()) || dateTime.intersect(variable->range())) {
371 if (dateTime.contains(variable->range()) || dateTime.intersect(variable->range())) {
329 VisualizationGraphHelper::updateData(variableEntry.second, variable->dataSeries(),
372 VisualizationGraphHelper::updateData(variableEntry.second, variable->dataSeries(),
330 variable->range());
373 variable->range());
331 }
374 }
332 }
375 }
333 }
376 }
334
377
335 void VisualizationGraphWidget::onUpdateVarDisplaying(std::shared_ptr<Variable> variable,
378 void VisualizationGraphWidget::onUpdateVarDisplaying(std::shared_ptr<Variable> variable,
336 const SqpRange &range)
379 const SqpRange &range)
337 {
380 {
338 auto it = impl->m_VariableToPlotMultiMap.find(variable);
381 auto it = impl->m_VariableToPlotMultiMap.find(variable);
339 if (it != impl->m_VariableToPlotMultiMap.end()) {
382 if (it != impl->m_VariableToPlotMultiMap.end()) {
340 VisualizationGraphHelper::updateData(it->second, variable->dataSeries(), range);
383 VisualizationGraphHelper::updateData(it->second, variable->dataSeries(), range);
341 }
384 }
342 }
385 }
@@ -1,129 +1,181
1 #include "Visualization/VisualizationTabWidget.h"
1 #include "Visualization/VisualizationTabWidget.h"
2 #include "Visualization/IVisualizationWidgetVisitor.h"
2 #include "Visualization/IVisualizationWidgetVisitor.h"
3 #include "ui_VisualizationTabWidget.h"
3 #include "ui_VisualizationTabWidget.h"
4
4
5 #include "Visualization/VisualizationZoneWidget.h"
5 #include "Visualization/VisualizationZoneWidget.h"
6 #include "Visualization/VisualizationGraphWidget.h"
7
8 #include "SqpApplication.h"
9 #include "DragDropHelper.h"
6
10
7 Q_LOGGING_CATEGORY(LOG_VisualizationTabWidget, "VisualizationTabWidget")
11 Q_LOGGING_CATEGORY(LOG_VisualizationTabWidget, "VisualizationTabWidget")
8
12
9 namespace {
13 namespace {
10
14
11 /// Generates a default name for a new zone, according to the number of zones already displayed in
15 /// Generates a default name for a new zone, according to the number of zones already displayed in
12 /// the tab
16 /// the tab
13 QString defaultZoneName(const QLayout &layout)
17 QString defaultZoneName(const QLayout &layout)
14 {
18 {
15 auto count = 0;
19 auto count = 0;
16 for (auto i = 0; i < layout.count(); ++i) {
20 for (auto i = 0; i < layout.count(); ++i) {
17 if (dynamic_cast<VisualizationZoneWidget *>(layout.itemAt(i)->widget())) {
21 if (dynamic_cast<VisualizationZoneWidget *>(layout.itemAt(i)->widget())) {
18 count++;
22 count++;
19 }
23 }
20 }
24 }
21
25
22 return QObject::tr("Zone %1").arg(count + 1);
26 return QObject::tr("Zone %1").arg(count + 1);
23 }
27 }
24
28
25 /**
29 /**
26 * Applies a function to all zones of the tab represented by its layout
30 * Applies a function to all zones of the tab represented by its layout
27 * @param layout the layout that contains zones
31 * @param layout the layout that contains zones
28 * @param fun the function to apply to each zone
32 * @param fun the function to apply to each zone
29 */
33 */
30 template <typename Fun>
34 template <typename Fun>
31 void processZones(QLayout &layout, Fun fun)
35 void processZones(QLayout &layout, Fun fun)
32 {
36 {
33 for (auto i = 0; i < layout.count(); ++i) {
37 for (auto i = 0; i < layout.count(); ++i) {
34 if (auto item = layout.itemAt(i)) {
38 if (auto item = layout.itemAt(i)) {
35 if (auto visualizationZoneWidget
39 if (auto visualizationZoneWidget
36 = dynamic_cast<VisualizationZoneWidget *>(item->widget())) {
40 = dynamic_cast<VisualizationZoneWidget *>(item->widget())) {
37 fun(*visualizationZoneWidget);
41 fun(*visualizationZoneWidget);
38 }
42 }
39 }
43 }
40 }
44 }
41 }
45 }
42
46
43 } // namespace
47 } // namespace
44
48
45 struct VisualizationTabWidget::VisualizationTabWidgetPrivate {
49 struct VisualizationTabWidget::VisualizationTabWidgetPrivate {
46 explicit VisualizationTabWidgetPrivate(const QString &name) : m_Name{name} {}
50 explicit VisualizationTabWidgetPrivate(const QString &name) : m_Name{name} {}
47
51
48 QString m_Name;
52 QString m_Name;
49 };
53 };
50
54
51 VisualizationTabWidget::VisualizationTabWidget(const QString &name, QWidget *parent)
55 VisualizationTabWidget::VisualizationTabWidget(const QString &name, QWidget *parent)
52 : QWidget{parent},
56 : QWidget{parent},
53 ui{new Ui::VisualizationTabWidget},
57 ui{new Ui::VisualizationTabWidget},
54 impl{spimpl::make_unique_impl<VisualizationTabWidgetPrivate>(name)}
58 impl{spimpl::make_unique_impl<VisualizationTabWidgetPrivate>(name)}
55 {
59 {
56 ui->setupUi(this);
60 ui->setupUi(this);
57
61
62 ui->dragDropContainer->setAcceptedMimeTypes({DragDropHelper::MIME_TYPE_GRAPH, DragDropHelper::MIME_TYPE_ZONE});
63 connect(ui->dragDropContainer, &VisualizationDragDropContainer::dropOccured, this, &VisualizationTabWidget::dropMimeData);
64
58 // Widget is deleted when closed
65 // Widget is deleted when closed
59 setAttribute(Qt::WA_DeleteOnClose);
66 setAttribute(Qt::WA_DeleteOnClose);
60 }
67 }
61
68
62 VisualizationTabWidget::~VisualizationTabWidget()
69 VisualizationTabWidget::~VisualizationTabWidget()
63 {
70 {
64 delete ui;
71 delete ui;
65 }
72 }
66
73
67 void VisualizationTabWidget::addZone(VisualizationZoneWidget *zoneWidget)
74 void VisualizationTabWidget::addZone(VisualizationZoneWidget *zoneWidget)
68 {
75 {
69 tabLayout().addWidget(zoneWidget);
76 ui->dragDropContainer->addDragWidget(zoneWidget);
77 }
78
79 void VisualizationTabWidget::insertZone(int index, VisualizationZoneWidget *zoneWidget)
80 {
81 ui->dragDropContainer->insertDragWidget(index, zoneWidget);
70 }
82 }
71
83
72 VisualizationZoneWidget *VisualizationTabWidget::createZone(std::shared_ptr<Variable> variable)
84 VisualizationZoneWidget *VisualizationTabWidget::createZone(std::shared_ptr<Variable> variable)
73 {
85 {
74 auto zoneWidget = new VisualizationZoneWidget{defaultZoneName(tabLayout()), this};
86 return createZone({variable}, -1);
75 this->addZone(zoneWidget);
87 }
88
89 VisualizationZoneWidget *VisualizationTabWidget::createZone(const QList<std::shared_ptr<Variable> > &variables, int index)
90 {
91 auto zoneWidget = new VisualizationZoneWidget{defaultZoneName(*ui->dragDropContainer->layout()), this};
92 this->insertZone(index, zoneWidget);
76
93
77 // Creates a new graph into the zone
94 // Creates a new graph into the zone
78 zoneWidget->createGraph(variable);
95 zoneWidget->createGraph(variables, index);
79
96
80 return zoneWidget;
97 return zoneWidget;
81 }
98 }
82
99
83 void VisualizationTabWidget::accept(IVisualizationWidgetVisitor *visitor)
100 void VisualizationTabWidget::accept(IVisualizationWidgetVisitor *visitor)
84 {
101 {
85 if (visitor) {
102 if (visitor) {
86 visitor->visitEnter(this);
103 visitor->visitEnter(this);
87
104
88 // Apply visitor to zone children: widgets different from zones are not visited (no action)
105 // Apply visitor to zone children: widgets different from zones are not visited (no action)
89 processZones(tabLayout(), [visitor](VisualizationZoneWidget &zoneWidget) {
106 processZones(tabLayout(), [visitor](VisualizationZoneWidget &zoneWidget) {
90 zoneWidget.accept(visitor);
107 zoneWidget.accept(visitor);
91 });
108 });
92
109
93 visitor->visitLeave(this);
110 visitor->visitLeave(this);
94 }
111 }
95 else {
112 else {
96 qCCritical(LOG_VisualizationTabWidget()) << tr("Can't visit widget : the visitor is null");
113 qCCritical(LOG_VisualizationTabWidget()) << tr("Can't visit widget : the visitor is null");
97 }
114 }
98 }
115 }
99
116
100 bool VisualizationTabWidget::canDrop(const Variable &variable) const
117 bool VisualizationTabWidget::canDrop(const Variable &variable) const
101 {
118 {
102 // A tab can always accomodate a variable
119 // A tab can always accomodate a variable
103 Q_UNUSED(variable);
120 Q_UNUSED(variable);
104 return true;
121 return true;
105 }
122 }
106
123
107 bool VisualizationTabWidget::contains(const Variable &variable) const
124 bool VisualizationTabWidget::contains(const Variable &variable) const
108 {
125 {
109 Q_UNUSED(variable);
126 Q_UNUSED(variable);
110 return false;
127 return false;
111 }
128 }
112
129
113 QString VisualizationTabWidget::name() const
130 QString VisualizationTabWidget::name() const
114 {
131 {
115 return impl->m_Name;
132 return impl->m_Name;
116 }
133 }
117
134
118 void VisualizationTabWidget::closeEvent(QCloseEvent *event)
135 void VisualizationTabWidget::closeEvent(QCloseEvent *event)
119 {
136 {
120 // Closes zones in the tab
137 // Closes zones in the tab
121 processZones(tabLayout(), [](VisualizationZoneWidget &zoneWidget) { zoneWidget.close(); });
138 processZones(tabLayout(), [](VisualizationZoneWidget &zoneWidget) { zoneWidget.close(); });
122
139
123 QWidget::closeEvent(event);
140 QWidget::closeEvent(event);
124 }
141 }
125
142
126 QLayout &VisualizationTabWidget::tabLayout() const noexcept
143 QLayout &VisualizationTabWidget::tabLayout() const noexcept
127 {
144 {
128 return *ui->scrollAreaWidgetContents->layout();
145 return *ui->dragDropContainer->layout();
146 }
147
148 void VisualizationTabWidget::dropMimeData(int index, const QMimeData *mimeData)
149 {
150 auto& helper = sqpApp->dragDropHelper();
151 if (mimeData->hasFormat(DragDropHelper::MIME_TYPE_GRAPH))
152 {
153 auto graphWidget = static_cast<VisualizationGraphWidget*>(helper.getCurrentDragWidget());
154 auto parentDragDropContainer = qobject_cast<VisualizationDragDropContainer*>(graphWidget->parentWidget());
155 Q_ASSERT(parentDragDropContainer);
156
157 auto nbGraph = parentDragDropContainer->countDragWidget();
158 if (nbGraph == 1)
159 {
160 //This is the only graph in the previous zone, close the zone
161 graphWidget->parentZoneWidget()->close();
162 }
163 else
164 {
165 //Close the graph
166 graphWidget->close();
167 }
168
169 const auto& variables = graphWidget->variables();
170 createZone(variables, index);
171 }
172 else if (mimeData->hasFormat(DragDropHelper::MIME_TYPE_ZONE))
173 {
174 //Simple move of the zone, no variable operation associated
175 auto zoneWidget = static_cast<VisualizationZoneWidget*>(helper.getCurrentDragWidget());
176 auto parentDragDropContainer = zoneWidget->parentWidget();
177 parentDragDropContainer->layout()->removeWidget(zoneWidget);
178
179 ui->dragDropContainer->insertDragWidget(index, zoneWidget);
180 }
129 }
181 }
@@ -1,304 +1,394
1 #include "Visualization/VisualizationZoneWidget.h"
1 #include "Visualization/VisualizationZoneWidget.h"
2
2
3 #include "Visualization/IVisualizationWidgetVisitor.h"
3 #include "Visualization/IVisualizationWidgetVisitor.h"
4 #include "Visualization/QCustomPlotSynchronizer.h"
4 #include "Visualization/QCustomPlotSynchronizer.h"
5 #include "Visualization/VisualizationGraphWidget.h"
5 #include "Visualization/VisualizationGraphWidget.h"
6 #include "ui_VisualizationZoneWidget.h"
6 #include "ui_VisualizationZoneWidget.h"
7
7
8 #include <Data/SqpRange.h>
8 #include <Data/SqpRange.h>
9 #include <Variable/Variable.h>
9 #include <Variable/Variable.h>
10 #include <Variable/VariableController.h>
10 #include <Variable/VariableController.h>
11
11
12 #include <QUuid>
12 #include <QUuid>
13 #include <SqpApplication.h>
13 #include <SqpApplication.h>
14 #include <DragDropHelper.h>
14 #include <cmath>
15 #include <cmath>
15
16
17 #include <QLayout>
18
16 Q_LOGGING_CATEGORY(LOG_VisualizationZoneWidget, "VisualizationZoneWidget")
19 Q_LOGGING_CATEGORY(LOG_VisualizationZoneWidget, "VisualizationZoneWidget")
17
20
18 namespace {
21 namespace {
19
22
20 /// Minimum height for graph added in zones (in pixels)
23 /// Minimum height for graph added in zones (in pixels)
21 const auto GRAPH_MINIMUM_HEIGHT = 300;
24 const auto GRAPH_MINIMUM_HEIGHT = 300;
22
25
23 /// Generates a default name for a new graph, according to the number of graphs already displayed in
26 /// Generates a default name for a new graph, according to the number of graphs already displayed in
24 /// the zone
27 /// the zone
25 QString defaultGraphName(const QLayout &layout)
28 QString defaultGraphName(const QLayout &layout)
26 {
29 {
27 auto count = 0;
30 auto count = 0;
28 for (auto i = 0; i < layout.count(); ++i) {
31 for (auto i = 0; i < layout.count(); ++i) {
29 if (dynamic_cast<VisualizationGraphWidget *>(layout.itemAt(i)->widget())) {
32 if (dynamic_cast<VisualizationGraphWidget *>(layout.itemAt(i)->widget())) {
30 count++;
33 count++;
31 }
34 }
32 }
35 }
33
36
34 return QObject::tr("Graph %1").arg(count + 1);
37 return QObject::tr("Graph %1").arg(count + 1);
35 }
38 }
36
39
37 /**
40 /**
38 * Applies a function to all graphs of the zone represented by its layout
41 * Applies a function to all graphs of the zone represented by its layout
39 * @param layout the layout that contains graphs
42 * @param layout the layout that contains graphs
40 * @param fun the function to apply to each graph
43 * @param fun the function to apply to each graph
41 */
44 */
42 template <typename Fun>
45 template <typename Fun>
43 void processGraphs(QLayout &layout, Fun fun)
46 void processGraphs(QLayout &layout, Fun fun)
44 {
47 {
45 for (auto i = 0; i < layout.count(); ++i) {
48 for (auto i = 0; i < layout.count(); ++i) {
46 if (auto item = layout.itemAt(i)) {
49 if (auto item = layout.itemAt(i)) {
47 if (auto visualizationGraphWidget
50 if (auto visualizationGraphWidget
48 = dynamic_cast<VisualizationGraphWidget *>(item->widget())) {
51 = dynamic_cast<VisualizationGraphWidget *>(item->widget())) {
49 fun(*visualizationGraphWidget);
52 fun(*visualizationGraphWidget);
50 }
53 }
51 }
54 }
52 }
55 }
53 }
56 }
54
57
55 } // namespace
58 } // namespace
56
59
57 struct VisualizationZoneWidget::VisualizationZoneWidgetPrivate {
60 struct VisualizationZoneWidget::VisualizationZoneWidgetPrivate {
58
61
59 explicit VisualizationZoneWidgetPrivate()
62 explicit VisualizationZoneWidgetPrivate()
60 : m_SynchronisationGroupId{QUuid::createUuid()},
63 : m_SynchronisationGroupId{QUuid::createUuid()},
61 m_Synchronizer{std::make_unique<QCustomPlotSynchronizer>()}
64 m_Synchronizer{std::make_unique<QCustomPlotSynchronizer>()}
62 {
65 {
63 }
66 }
64 QUuid m_SynchronisationGroupId;
67 QUuid m_SynchronisationGroupId;
65 std::unique_ptr<IGraphSynchronizer> m_Synchronizer;
68 std::unique_ptr<IGraphSynchronizer> m_Synchronizer;
66 };
69 };
67
70
68 VisualizationZoneWidget::VisualizationZoneWidget(const QString &name, QWidget *parent)
71 VisualizationZoneWidget::VisualizationZoneWidget(const QString &name, QWidget *parent)
69 : QWidget{parent},
72 : VisualizationDragWidget{parent},
70 ui{new Ui::VisualizationZoneWidget},
73 ui{new Ui::VisualizationZoneWidget},
71 impl{spimpl::make_unique_impl<VisualizationZoneWidgetPrivate>()}
74 impl{spimpl::make_unique_impl<VisualizationZoneWidgetPrivate>()}
72 {
75 {
73 ui->setupUi(this);
76 ui->setupUi(this);
74
77
75 ui->zoneNameLabel->setText(name);
78 ui->zoneNameLabel->setText(name);
76
79
80 ui->dragDropContainer->setAcceptedMimeTypes({DragDropHelper::MIME_TYPE_GRAPH});
81 connect(ui->dragDropContainer, &VisualizationDragDropContainer::dropOccured, this, &VisualizationZoneWidget::dropMimeData);
82
77 // 'Close' options : widget is deleted when closed
83 // 'Close' options : widget is deleted when closed
78 setAttribute(Qt::WA_DeleteOnClose);
84 setAttribute(Qt::WA_DeleteOnClose);
79 connect(ui->closeButton, &QToolButton::clicked, this, &VisualizationZoneWidget::close);
85 connect(ui->closeButton, &QToolButton::clicked, this, &VisualizationZoneWidget::close);
80 ui->closeButton->setIcon(sqpApp->style()->standardIcon(QStyle::SP_TitleBarCloseButton));
86 ui->closeButton->setIcon(sqpApp->style()->standardIcon(QStyle::SP_TitleBarCloseButton));
81
87
82 // Synchronisation id
88 // Synchronisation id
83 QMetaObject::invokeMethod(&sqpApp->variableController(), "onAddSynchronizationGroupId",
89 QMetaObject::invokeMethod(&sqpApp->variableController(), "onAddSynchronizationGroupId",
84 Qt::QueuedConnection, Q_ARG(QUuid, impl->m_SynchronisationGroupId));
90 Qt::QueuedConnection, Q_ARG(QUuid, impl->m_SynchronisationGroupId));
85 }
91 }
86
92
87 VisualizationZoneWidget::~VisualizationZoneWidget()
93 VisualizationZoneWidget::~VisualizationZoneWidget()
88 {
94 {
89 delete ui;
95 delete ui;
90 }
96 }
91
97
92 void VisualizationZoneWidget::addGraph(VisualizationGraphWidget *graphWidget)
98 void VisualizationZoneWidget::addGraph(VisualizationGraphWidget *graphWidget)
93 {
99 {
94 // Synchronize new graph with others in the zone
100 // Synchronize new graph with others in the zone
95 impl->m_Synchronizer->addGraph(*graphWidget);
101 impl->m_Synchronizer->addGraph(*graphWidget);
96
102
97 ui->visualizationZoneFrame->layout()->addWidget(graphWidget);
103 ui->dragDropContainer->addDragWidget(graphWidget);
104 }
105
106 void VisualizationZoneWidget::insertGraph(int index, VisualizationGraphWidget *graphWidget)
107 {
108 // Synchronize new graph with others in the zone
109 impl->m_Synchronizer->addGraph(*graphWidget);
110
111 ui->dragDropContainer->insertDragWidget(index, graphWidget);
98 }
112 }
99
113
100 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<Variable> variable)
114 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<Variable> variable)
101 {
115 {
116 return createGraph(variable, -1);
117 }
118
119 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<Variable> variable, int index)
120 {
102 auto graphWidget = new VisualizationGraphWidget{
121 auto graphWidget = new VisualizationGraphWidget{
103 defaultGraphName(*ui->visualizationZoneFrame->layout()), this};
122 defaultGraphName(*ui->dragDropContainer->layout()), this};
104
123
105
124
106 // Set graph properties
125 // Set graph properties
107 graphWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
126 graphWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
108 graphWidget->setMinimumHeight(GRAPH_MINIMUM_HEIGHT);
127 graphWidget->setMinimumHeight(GRAPH_MINIMUM_HEIGHT);
109
128
110
129
111 // Lambda to synchronize zone widget
130 // Lambda to synchronize zone widget
112 auto synchronizeZoneWidget = [this, graphWidget](const SqpRange &graphRange,
131 auto synchronizeZoneWidget = [this, graphWidget](const SqpRange &graphRange,
113 const SqpRange &oldGraphRange) {
132 const SqpRange &oldGraphRange) {
114
133
115 auto zoomType = VariableController::getZoomType(graphRange, oldGraphRange);
134 auto zoomType = VariableController::getZoomType(graphRange, oldGraphRange);
116 auto frameLayout = ui->visualizationZoneFrame->layout();
135 auto frameLayout = ui->dragDropContainer->layout();
117 for (auto i = 0; i < frameLayout->count(); ++i) {
136 for (auto i = 0; i < frameLayout->count(); ++i) {
118 auto graphChild
137 auto graphChild
119 = dynamic_cast<VisualizationGraphWidget *>(frameLayout->itemAt(i)->widget());
138 = dynamic_cast<VisualizationGraphWidget *>(frameLayout->itemAt(i)->widget());
120 if (graphChild && (graphChild != graphWidget)) {
139 if (graphChild && (graphChild != graphWidget)) {
121
140
122 auto graphChildRange = graphChild->graphRange();
141 auto graphChildRange = graphChild->graphRange();
123 switch (zoomType) {
142 switch (zoomType) {
124 case AcquisitionZoomType::ZoomIn: {
143 case AcquisitionZoomType::ZoomIn: {
125 auto deltaLeft = graphRange.m_TStart - oldGraphRange.m_TStart;
144 auto deltaLeft = graphRange.m_TStart - oldGraphRange.m_TStart;
126 auto deltaRight = oldGraphRange.m_TEnd - graphRange.m_TEnd;
145 auto deltaRight = oldGraphRange.m_TEnd - graphRange.m_TEnd;
127 graphChildRange.m_TStart += deltaLeft;
146 graphChildRange.m_TStart += deltaLeft;
128 graphChildRange.m_TEnd -= deltaRight;
147 graphChildRange.m_TEnd -= deltaRight;
129 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomIn");
148 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomIn");
130 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaLeft")
149 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaLeft")
131 << deltaLeft;
150 << deltaLeft;
132 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight")
151 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight")
133 << deltaRight;
152 << deltaRight;
134 qCDebug(LOG_VisualizationZoneWidget())
153 qCDebug(LOG_VisualizationZoneWidget())
135 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
154 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
136
155
137 break;
156 break;
138 }
157 }
139
158
140 case AcquisitionZoomType::ZoomOut: {
159 case AcquisitionZoomType::ZoomOut: {
141 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomOut");
160 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomOut");
142 auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart;
161 auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart;
143 auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd;
162 auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd;
144 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaLeft")
163 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaLeft")
145 << deltaLeft;
164 << deltaLeft;
146 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight")
165 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight")
147 << deltaRight;
166 << deltaRight;
148 qCDebug(LOG_VisualizationZoneWidget())
167 qCDebug(LOG_VisualizationZoneWidget())
149 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
168 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
150 graphChildRange.m_TStart -= deltaLeft;
169 graphChildRange.m_TStart -= deltaLeft;
151 graphChildRange.m_TEnd += deltaRight;
170 graphChildRange.m_TEnd += deltaRight;
152 break;
171 break;
153 }
172 }
154 case AcquisitionZoomType::PanRight: {
173 case AcquisitionZoomType::PanRight: {
155 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: PanRight");
174 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: PanRight");
156 auto deltaLeft = graphRange.m_TStart - oldGraphRange.m_TStart;
175 auto deltaLeft = graphRange.m_TStart - oldGraphRange.m_TStart;
157 auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd;
176 auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd;
158 graphChildRange.m_TStart += deltaLeft;
177 graphChildRange.m_TStart += deltaLeft;
159 graphChildRange.m_TEnd += deltaRight;
178 graphChildRange.m_TEnd += deltaRight;
160 qCDebug(LOG_VisualizationZoneWidget())
179 qCDebug(LOG_VisualizationZoneWidget())
161 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
180 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
162 break;
181 break;
163 }
182 }
164 case AcquisitionZoomType::PanLeft: {
183 case AcquisitionZoomType::PanLeft: {
165 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: PanLeft");
184 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: PanLeft");
166 auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart;
185 auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart;
167 auto deltaRight = oldGraphRange.m_TEnd - graphRange.m_TEnd;
186 auto deltaRight = oldGraphRange.m_TEnd - graphRange.m_TEnd;
168 graphChildRange.m_TStart -= deltaLeft;
187 graphChildRange.m_TStart -= deltaLeft;
169 graphChildRange.m_TEnd -= deltaRight;
188 graphChildRange.m_TEnd -= deltaRight;
170 break;
189 break;
171 }
190 }
172 case AcquisitionZoomType::Unknown: {
191 case AcquisitionZoomType::Unknown: {
173 qCDebug(LOG_VisualizationZoneWidget())
192 qCDebug(LOG_VisualizationZoneWidget())
174 << tr("Impossible to synchronize: zoom type unknown");
193 << tr("Impossible to synchronize: zoom type unknown");
175 break;
194 break;
176 }
195 }
177 default:
196 default:
178 qCCritical(LOG_VisualizationZoneWidget())
197 qCCritical(LOG_VisualizationZoneWidget())
179 << tr("Impossible to synchronize: zoom type not take into account");
198 << tr("Impossible to synchronize: zoom type not take into account");
180 // No action
199 // No action
181 break;
200 break;
182 }
201 }
183 graphChild->enableAcquisition(false);
202 graphChild->enableAcquisition(false);
184 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: Range before: ")
203 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: Range before: ")
185 << graphChild->graphRange();
204 << graphChild->graphRange();
186 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: Range after : ")
205 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: Range after : ")
187 << graphChildRange;
206 << graphChildRange;
188 qCDebug(LOG_VisualizationZoneWidget())
207 qCDebug(LOG_VisualizationZoneWidget())
189 << tr("TORM: child dt") << graphChildRange.m_TEnd - graphChildRange.m_TStart;
208 << tr("TORM: child dt") << graphChildRange.m_TEnd - graphChildRange.m_TStart;
190 graphChild->setGraphRange(graphChildRange);
209 graphChild->setGraphRange(graphChildRange);
191 graphChild->enableAcquisition(true);
210 graphChild->enableAcquisition(true);
192 }
211 }
193 }
212 }
194 };
213 };
195
214
196 // connection for synchronization
215 // connection for synchronization
197 connect(graphWidget, &VisualizationGraphWidget::synchronize, synchronizeZoneWidget);
216 connect(graphWidget, &VisualizationGraphWidget::synchronize, synchronizeZoneWidget);
198 connect(graphWidget, &VisualizationGraphWidget::variableAdded, this,
217 connect(graphWidget, &VisualizationGraphWidget::variableAdded, this,
199 &VisualizationZoneWidget::onVariableAdded);
218 &VisualizationZoneWidget::onVariableAdded);
200 connect(graphWidget, &VisualizationGraphWidget::variableAboutToBeRemoved, this,
219 connect(graphWidget, &VisualizationGraphWidget::variableAboutToBeRemoved, this,
201 &VisualizationZoneWidget::onVariableAboutToBeRemoved);
220 &VisualizationZoneWidget::onVariableAboutToBeRemoved);
202
221
203 auto range = SqpRange{};
222 auto range = SqpRange{};
204
223
205 // Apply visitor to graph children
224 // Apply visitor to graph children
206 auto layout = ui->visualizationZoneFrame->layout();
225 auto layout = ui->dragDropContainer->layout();
207 if (layout->count() > 0) {
226 if (layout->count() > 0) {
208 // Case of a new graph in a existant zone
227 // Case of a new graph in a existant zone
209 if (auto visualizationGraphWidget
228 if (auto visualizationGraphWidget
210 = dynamic_cast<VisualizationGraphWidget *>(layout->itemAt(0)->widget())) {
229 = dynamic_cast<VisualizationGraphWidget *>(layout->itemAt(0)->widget())) {
211 range = visualizationGraphWidget->graphRange();
230 range = visualizationGraphWidget->graphRange();
212 }
231 }
213 }
232 }
214 else {
233 else {
215 // Case of a new graph as the first of the zone
234 // Case of a new graph as the first of the zone
216 range = variable->range();
235 range = variable->range();
217 }
236 }
218
237
219 this->addGraph(graphWidget);
238 this->insertGraph(index, graphWidget);
220
239
221 graphWidget->addVariable(variable, range);
240 graphWidget->addVariable(variable, range);
222
241
223 // get y using variable range
242 // get y using variable range
224 if (auto dataSeries = variable->dataSeries()) {
243 if (auto dataSeries = variable->dataSeries()) {
225 dataSeries->lockRead();
244 dataSeries->lockRead();
226 auto valuesBounds
245 auto valuesBounds
227 = dataSeries->valuesBounds(variable->range().m_TStart, variable->range().m_TEnd);
246 = dataSeries->valuesBounds(variable->range().m_TStart, variable->range().m_TEnd);
228 auto end = dataSeries->cend();
247 auto end = dataSeries->cend();
229 if (valuesBounds.first != end && valuesBounds.second != end) {
248 if (valuesBounds.first != end && valuesBounds.second != end) {
230 auto rangeValue = [](const auto &value) { return std::isnan(value) ? 0. : value; };
249 auto rangeValue = [](const auto &value) { return std::isnan(value) ? 0. : value; };
231
250
232 auto minValue = rangeValue(valuesBounds.first->minValue());
251 auto minValue = rangeValue(valuesBounds.first->minValue());
233 auto maxValue = rangeValue(valuesBounds.second->maxValue());
252 auto maxValue = rangeValue(valuesBounds.second->maxValue());
234
253
235 graphWidget->setYRange(SqpRange{minValue, maxValue});
254 graphWidget->setYRange(SqpRange{minValue, maxValue});
236 }
255 }
237 dataSeries->unlock();
256 dataSeries->unlock();
238 }
257 }
239
258
240 return graphWidget;
259 return graphWidget;
241 }
260 }
242
261
262 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(const QList<std::shared_ptr<Variable> > variables, int index)
263 {
264 if (variables.isEmpty())
265 return nullptr;
266
267 auto graphWidget = createGraph(variables.first(), index);
268 for (auto variableIt = variables.cbegin() + 1; variableIt != variables.cend(); ++variableIt)
269 {
270 graphWidget->addVariable(*variableIt, graphWidget->graphRange());
271 }
272
273 return graphWidget;
274 }
275
243 void VisualizationZoneWidget::accept(IVisualizationWidgetVisitor *visitor)
276 void VisualizationZoneWidget::accept(IVisualizationWidgetVisitor *visitor)
244 {
277 {
245 if (visitor) {
278 if (visitor) {
246 visitor->visitEnter(this);
279 visitor->visitEnter(this);
247
280
248 // Apply visitor to graph children: widgets different from graphs are not visited (no
281 // Apply visitor to graph children: widgets different from graphs are not visited (no
249 // action)
282 // action)
250 processGraphs(
283 processGraphs(
251 *ui->visualizationZoneFrame->layout(),
284 *ui->dragDropContainer->layout(),
252 [visitor](VisualizationGraphWidget &graphWidget) { graphWidget.accept(visitor); });
285 [visitor](VisualizationGraphWidget &graphWidget) { graphWidget.accept(visitor); });
253
286
254 visitor->visitLeave(this);
287 visitor->visitLeave(this);
255 }
288 }
256 else {
289 else {
257 qCCritical(LOG_VisualizationZoneWidget()) << tr("Can't visit widget : the visitor is null");
290 qCCritical(LOG_VisualizationZoneWidget()) << tr("Can't visit widget : the visitor is null");
258 }
291 }
259 }
292 }
260
293
261 bool VisualizationZoneWidget::canDrop(const Variable &variable) const
294 bool VisualizationZoneWidget::canDrop(const Variable &variable) const
262 {
295 {
263 // A tab can always accomodate a variable
296 // A tab can always accomodate a variable
264 Q_UNUSED(variable);
297 Q_UNUSED(variable);
265 return true;
298 return true;
266 }
299 }
267
300
268 bool VisualizationZoneWidget::contains(const Variable &variable) const
301 bool VisualizationZoneWidget::contains(const Variable &variable) const
269 {
302 {
270 Q_UNUSED(variable);
303 Q_UNUSED(variable);
271 return false;
304 return false;
272 }
305 }
273
306
274 QString VisualizationZoneWidget::name() const
307 QString VisualizationZoneWidget::name() const
275 {
308 {
276 return ui->zoneNameLabel->text();
309 return ui->zoneNameLabel->text();
277 }
310 }
278
311
312 QMimeData *VisualizationZoneWidget::mimeData() const
313 {
314 auto *mimeData = new QMimeData;
315 mimeData->setData(DragDropHelper::MIME_TYPE_ZONE, QByteArray());
316
317 return mimeData;
318 }
319
320 bool VisualizationZoneWidget::isDragAllowed() const
321 {
322 return true;
323 }
324
279 void VisualizationZoneWidget::closeEvent(QCloseEvent *event)
325 void VisualizationZoneWidget::closeEvent(QCloseEvent *event)
280 {
326 {
281 // Closes graphs in the zone
327 // Closes graphs in the zone
282 processGraphs(*ui->visualizationZoneFrame->layout(),
328 processGraphs(*ui->dragDropContainer->layout(),
283 [](VisualizationGraphWidget &graphWidget) { graphWidget.close(); });
329 [](VisualizationGraphWidget &graphWidget) { graphWidget.close(); });
284
330
285 // Delete synchronization group from variable controller
331 // Delete synchronization group from variable controller
286 QMetaObject::invokeMethod(&sqpApp->variableController(), "onRemoveSynchronizationGroupId",
332 QMetaObject::invokeMethod(&sqpApp->variableController(), "onRemoveSynchronizationGroupId",
287 Qt::QueuedConnection, Q_ARG(QUuid, impl->m_SynchronisationGroupId));
333 Qt::QueuedConnection, Q_ARG(QUuid, impl->m_SynchronisationGroupId));
288
334
289 QWidget::closeEvent(event);
335 QWidget::closeEvent(event);
290 }
336 }
291
337
292 void VisualizationZoneWidget::onVariableAdded(std::shared_ptr<Variable> variable)
338 void VisualizationZoneWidget::onVariableAdded(std::shared_ptr<Variable> variable)
293 {
339 {
294 QMetaObject::invokeMethod(&sqpApp->variableController(), "onAddSynchronized",
340 QMetaObject::invokeMethod(&sqpApp->variableController(), "onAddSynchronized",
295 Qt::QueuedConnection, Q_ARG(std::shared_ptr<Variable>, variable),
341 Qt::QueuedConnection, Q_ARG(std::shared_ptr<Variable>, variable),
296 Q_ARG(QUuid, impl->m_SynchronisationGroupId));
342 Q_ARG(QUuid, impl->m_SynchronisationGroupId));
297 }
343 }
298
344
299 void VisualizationZoneWidget::onVariableAboutToBeRemoved(std::shared_ptr<Variable> variable)
345 void VisualizationZoneWidget::onVariableAboutToBeRemoved(std::shared_ptr<Variable> variable)
300 {
346 {
301 QMetaObject::invokeMethod(&sqpApp->variableController(), "desynchronize", Qt::QueuedConnection,
347 QMetaObject::invokeMethod(&sqpApp->variableController(), "desynchronize", Qt::QueuedConnection,
302 Q_ARG(std::shared_ptr<Variable>, variable),
348 Q_ARG(std::shared_ptr<Variable>, variable),
303 Q_ARG(QUuid, impl->m_SynchronisationGroupId));
349 Q_ARG(QUuid, impl->m_SynchronisationGroupId));
304 }
350 }
351
352 void VisualizationZoneWidget::dropMimeData(int index, const QMimeData *mimeData)
353 {
354 auto& helper = sqpApp->dragDropHelper();
355 if (mimeData->hasFormat(DragDropHelper::MIME_TYPE_GRAPH))
356 {
357 auto graphWidget = static_cast<VisualizationGraphWidget*>(helper.getCurrentDragWidget());
358 auto parentDragDropContainer = qobject_cast<VisualizationDragDropContainer*>(graphWidget->parentWidget());
359 Q_ASSERT(parentDragDropContainer);
360
361 const auto& variables = graphWidget->variables();
362
363 if (!variables.empty())
364 {
365 if (parentDragDropContainer != ui->dragDropContainer)
366 {
367 //The drop didn't occur in the same zone
368
369 auto previousParentZoneWidget = graphWidget->parentZoneWidget();
370 auto nbGraph = parentDragDropContainer->countDragWidget();
371 if (nbGraph == 1)
372 {
373 //This is the only graph in the previous zone, close the zone
374 previousParentZoneWidget->close();
375 }
376 else
377 {
378 //Close the graph
379 graphWidget->close();
380 }
381
382 //Creates the new graph in the zone
383 createGraph(variables, index);
384 }
385 else
386 {
387 //The drop occurred in the same zone
388 //Simple move of the graph, no variable operation associated
389 parentDragDropContainer->layout()->removeWidget(graphWidget);
390 ui->dragDropContainer->insertDragWidget(index, graphWidget);
391 }
392 }
393 }
394 }
@@ -1,73 +1,84
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
2 <ui version="4.0">
3 <class>VisualizationTabWidget</class>
3 <class>VisualizationTabWidget</class>
4 <widget class="QWidget" name="VisualizationTabWidget">
4 <widget class="QWidget" name="VisualizationTabWidget">
5 <property name="geometry">
5 <property name="geometry">
6 <rect>
6 <rect>
7 <x>0</x>
7 <x>0</x>
8 <y>0</y>
8 <y>0</y>
9 <width>400</width>
9 <width>400</width>
10 <height>300</height>
10 <height>300</height>
11 </rect>
11 </rect>
12 </property>
12 </property>
13 <property name="windowTitle">
13 <property name="windowTitle">
14 <string>Form</string>
14 <string>Form</string>
15 </property>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout">
16 <layout class="QVBoxLayout" name="verticalLayout">
17 <property name="leftMargin">
17 <property name="leftMargin">
18 <number>0</number>
18 <number>0</number>
19 </property>
19 </property>
20 <property name="topMargin">
20 <property name="topMargin">
21 <number>0</number>
21 <number>0</number>
22 </property>
22 </property>
23 <property name="rightMargin">
23 <property name="rightMargin">
24 <number>0</number>
24 <number>0</number>
25 </property>
25 </property>
26 <property name="bottomMargin">
26 <property name="bottomMargin">
27 <number>0</number>
27 <number>0</number>
28 </property>
28 </property>
29 <item>
29 <item>
30 <widget class="QScrollArea" name="scrollArea">
30 <widget class="QScrollArea" name="scrollArea">
31 <property name="frameShape">
31 <property name="frameShape">
32 <enum>QFrame::NoFrame</enum>
32 <enum>QFrame::NoFrame</enum>
33 </property>
33 </property>
34 <property name="frameShadow">
34 <property name="frameShadow">
35 <enum>QFrame::Sunken</enum>
35 <enum>QFrame::Sunken</enum>
36 </property>
36 </property>
37 <property name="widgetResizable">
37 <property name="widgetResizable">
38 <bool>true</bool>
38 <bool>true</bool>
39 </property>
39 </property>
40 <widget class="QWidget" name="scrollAreaWidgetContents">
40 <widget class="QWidget" name="scrollAreaWidgetContents">
41 <property name="geometry">
41 <property name="geometry">
42 <rect>
42 <rect>
43 <x>0</x>
43 <x>0</x>
44 <y>0</y>
44 <y>0</y>
45 <width>400</width>
45 <width>400</width>
46 <height>300</height>
46 <height>300</height>
47 </rect>
47 </rect>
48 </property>
48 </property>
49 <layout class="QVBoxLayout" name="verticalLayout_3">
49 <layout class="QVBoxLayout" name="verticalLayout_3">
50 <property name="spacing">
50 <property name="spacing">
51 <number>3</number>
51 <number>3</number>
52 </property>
52 </property>
53 <property name="leftMargin">
53 <property name="leftMargin">
54 <number>0</number>
54 <number>0</number>
55 </property>
55 </property>
56 <property name="topMargin">
56 <property name="topMargin">
57 <number>0</number>
57 <number>0</number>
58 </property>
58 </property>
59 <property name="rightMargin">
59 <property name="rightMargin">
60 <number>0</number>
60 <number>0</number>
61 </property>
61 </property>
62 <property name="bottomMargin">
62 <property name="bottomMargin">
63 <number>0</number>
63 <number>0</number>
64 </property>
64 </property>
65 <item>
66 <widget class="VisualizationDragDropContainer" name="dragDropContainer" native="true"/>
67 </item>
65 </layout>
68 </layout>
66 </widget>
69 </widget>
67 </widget>
70 </widget>
68 </item>
71 </item>
69 </layout>
72 </layout>
70 </widget>
73 </widget>
74 <customwidgets>
75 <customwidget>
76 <class>VisualizationDragDropContainer</class>
77 <extends>QWidget</extends>
78 <header>Visualization/VisualizationDragDropContainer.h</header>
79 <container>1</container>
80 </customwidget>
81 </customwidgets>
71 <resources/>
82 <resources/>
72 <connections/>
83 <connections/>
73 </ui>
84 </ui>
@@ -1,117 +1,128
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
2 <ui version="4.0">
3 <class>VisualizationZoneWidget</class>
3 <class>VisualizationZoneWidget</class>
4 <widget class="QWidget" name="VisualizationZoneWidget">
4 <widget class="QWidget" name="VisualizationZoneWidget">
5 <property name="geometry">
5 <property name="geometry">
6 <rect>
6 <rect>
7 <x>0</x>
7 <x>0</x>
8 <y>0</y>
8 <y>0</y>
9 <width>400</width>
9 <width>400</width>
10 <height>300</height>
10 <height>300</height>
11 </rect>
11 </rect>
12 </property>
12 </property>
13 <property name="windowTitle">
13 <property name="windowTitle">
14 <string>Form</string>
14 <string>Form</string>
15 </property>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout_2">
16 <layout class="QVBoxLayout" name="verticalLayout_2">
17 <property name="spacing">
17 <property name="spacing">
18 <number>0</number>
18 <number>0</number>
19 </property>
19 </property>
20 <property name="leftMargin">
20 <property name="leftMargin">
21 <number>0</number>
21 <number>0</number>
22 </property>
22 </property>
23 <property name="topMargin">
23 <property name="topMargin">
24 <number>0</number>
24 <number>0</number>
25 </property>
25 </property>
26 <property name="rightMargin">
26 <property name="rightMargin">
27 <number>0</number>
27 <number>0</number>
28 </property>
28 </property>
29 <property name="bottomMargin">
29 <property name="bottomMargin">
30 <number>0</number>
30 <number>0</number>
31 </property>
31 </property>
32 <item>
32 <item>
33 <widget class="QWidget" name="infobar" native="true">
33 <widget class="QWidget" name="infobar" native="true">
34 <property name="sizePolicy">
34 <property name="sizePolicy">
35 <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
35 <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
36 <horstretch>0</horstretch>
36 <horstretch>0</horstretch>
37 <verstretch>0</verstretch>
37 <verstretch>0</verstretch>
38 </sizepolicy>
38 </sizepolicy>
39 </property>
39 </property>
40 <layout class="QHBoxLayout" name="horizontalLayout">
40 <layout class="QHBoxLayout" name="horizontalLayout">
41 <property name="spacing">
41 <property name="spacing">
42 <number>0</number>
42 <number>0</number>
43 </property>
43 </property>
44 <property name="leftMargin">
44 <property name="leftMargin">
45 <number>0</number>
45 <number>0</number>
46 </property>
46 </property>
47 <property name="topMargin">
47 <property name="topMargin">
48 <number>0</number>
48 <number>0</number>
49 </property>
49 </property>
50 <property name="rightMargin">
50 <property name="rightMargin">
51 <number>0</number>
51 <number>0</number>
52 </property>
52 </property>
53 <property name="bottomMargin">
53 <property name="bottomMargin">
54 <number>0</number>
54 <number>0</number>
55 </property>
55 </property>
56 <item>
56 <item>
57 <widget class="QLabel" name="zoneNameLabel">
57 <widget class="QLabel" name="zoneNameLabel">
58 <property name="styleSheet">
58 <property name="styleSheet">
59 <string notr="true">color: rgb(127, 127, 127);
59 <string notr="true">color: rgb(127, 127, 127);
60 </string>
60 </string>
61 </property>
61 </property>
62 <property name="text">
62 <property name="text">
63 <string>TextLabel</string>
63 <string>TextLabel</string>
64 </property>
64 </property>
65 </widget>
65 </widget>
66 </item>
66 </item>
67 <item>
67 <item>
68 <widget class="QToolButton" name="closeButton">
68 <widget class="QToolButton" name="closeButton">
69 <property name="styleSheet">
69 <property name="styleSheet">
70 <string notr="true">background-color: transparent;</string>
70 <string notr="true">background-color: transparent;</string>
71 </property>
71 </property>
72 <property name="text">
72 <property name="text">
73 <string>Close</string>
73 <string>Close</string>
74 </property>
74 </property>
75 </widget>
75 </widget>
76 </item>
76 </item>
77 </layout>
77 </layout>
78 </widget>
78 </widget>
79 </item>
79 </item>
80 <item>
80 <item>
81 <widget class="QFrame" name="visualizationZoneFrame">
81 <widget class="QFrame" name="visualizationZoneFrame">
82 <property name="sizePolicy">
82 <property name="sizePolicy">
83 <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
83 <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
84 <horstretch>0</horstretch>
84 <horstretch>0</horstretch>
85 <verstretch>0</verstretch>
85 <verstretch>0</verstretch>
86 </sizepolicy>
86 </sizepolicy>
87 </property>
87 </property>
88 <property name="frameShape">
88 <property name="frameShape">
89 <enum>QFrame::Box</enum>
89 <enum>QFrame::Box</enum>
90 </property>
90 </property>
91 <property name="frameShadow">
91 <property name="frameShadow">
92 <enum>QFrame::Raised</enum>
92 <enum>QFrame::Raised</enum>
93 </property>
93 </property>
94 <property name="lineWidth">
94 <property name="lineWidth">
95 <number>1</number>
95 <number>1</number>
96 </property>
96 </property>
97 <layout class="QVBoxLayout" name="verticalLayout">
97 <layout class="QVBoxLayout" name="verticalLayout">
98 <property name="leftMargin">
98 <property name="leftMargin">
99 <number>0</number>
99 <number>0</number>
100 </property>
100 </property>
101 <property name="topMargin">
101 <property name="topMargin">
102 <number>0</number>
102 <number>0</number>
103 </property>
103 </property>
104 <property name="rightMargin">
104 <property name="rightMargin">
105 <number>0</number>
105 <number>0</number>
106 </property>
106 </property>
107 <property name="bottomMargin">
107 <property name="bottomMargin">
108 <number>0</number>
108 <number>0</number>
109 </property>
109 </property>
110 <item>
111 <widget class="VisualizationDragDropContainer" name="dragDropContainer" native="true"/>
112 </item>
110 </layout>
113 </layout>
111 </widget>
114 </widget>
112 </item>
115 </item>
113 </layout>
116 </layout>
114 </widget>
117 </widget>
118 <customwidgets>
119 <customwidget>
120 <class>VisualizationDragDropContainer</class>
121 <extends>QWidget</extends>
122 <header>Visualization/VisualizationDragDropContainer.h</header>
123 <container>1</container>
124 </customwidget>
125 </customwidgets>
115 <resources/>
126 <resources/>
116 <connections/>
127 <connections/>
117 </ui>
128 </ui>
General Comments 6
Approved

Status change > Approved

You need to be logged in to leave comments. Login now