@@ -31,12 +31,12 public: | |||||
31 |
|
31 | |||
32 | protected: |
|
32 | protected: | |
33 | /// Protected ctor (DataSeries is abstract) |
|
33 | /// Protected ctor (DataSeries is abstract) | |
34 | explicit DataSeries(std::shared_ptr<ArrayData<1> > xAxisData, Unit xAxisUnit, |
|
34 | explicit DataSeries(std::shared_ptr<ArrayData<1> > xAxisData, const Unit &xAxisUnit, | |
35 | std::shared_ptr<ArrayData<Dim> > valuesData, Unit valuesUnit) |
|
35 | std::shared_ptr<ArrayData<Dim> > valuesData, const Unit &valuesUnit) | |
36 | : m_XAxisData{xAxisData}, |
|
36 | : m_XAxisData{xAxisData}, | |
37 |
m_XAxisUnit{ |
|
37 | m_XAxisUnit{xAxisUnit}, | |
38 | m_ValuesData{valuesData}, |
|
38 | m_ValuesData{valuesData}, | |
39 |
m_ValuesUnit{ |
|
39 | m_ValuesUnit{valuesUnit} | |
40 | { |
|
40 | { | |
41 | } |
|
41 | } | |
42 |
|
42 |
@@ -14,7 +14,7 public: | |||||
14 | * @param xAxisUnit x-axis unit |
|
14 | * @param xAxisUnit x-axis unit | |
15 | * @param valuesUnit values unit |
|
15 | * @param valuesUnit values unit | |
16 | */ |
|
16 | */ | |
17 | explicit ScalarSeries(int size, Unit xAxisUnit, Unit valuesUnit); |
|
17 | explicit ScalarSeries(int size, const Unit &xAxisUnit, const Unit &valuesUnit); | |
18 |
|
18 | |||
19 | /** |
|
19 | /** | |
20 | * Sets data for a specific index. The index has to be valid to be effective |
|
20 | * Sets data for a specific index. The index has to be valid to be effective |
@@ -1,8 +1,8 | |||||
1 | #include <Data/ScalarSeries.h> |
|
1 | #include <Data/ScalarSeries.h> | |
2 |
|
2 | |||
3 | ScalarSeries::ScalarSeries(int size, Unit xAxisUnit, Unit valuesUnit) |
|
3 | ScalarSeries::ScalarSeries(int size, const Unit &xAxisUnit, const Unit &valuesUnit) | |
4 |
: DataSeries{std::make_shared<ArrayData<1> >(size), |
|
4 | : DataSeries{std::make_shared<ArrayData<1> >(size), xAxisUnit, | |
5 |
std::make_shared<ArrayData<1> >(size), |
|
5 | std::make_shared<ArrayData<1> >(size), valuesUnit} | |
6 | { |
|
6 | { | |
7 | } |
|
7 | } | |
8 |
|
8 |
@@ -20,7 +20,7 VisualizationWidget::VisualizationWidget(QWidget *parent) | |||||
20 | addTabViewButton->setCursor(Qt::ArrowCursor); |
|
20 | addTabViewButton->setCursor(Qt::ArrowCursor); | |
21 | ui->tabWidget->setCornerWidget(addTabViewButton, Qt::TopRightCorner); |
|
21 | ui->tabWidget->setCornerWidget(addTabViewButton, Qt::TopRightCorner); | |
22 |
|
22 | |||
23 |
auto enableMinimu |
|
23 | auto enableMinimumCornerWidgetSize = [this](bool enable) { | |
24 |
|
24 | |||
25 | auto tabViewCornerWidget = ui->tabWidget->cornerWidget(); |
|
25 | auto tabViewCornerWidget = ui->tabWidget->cornerWidget(); | |
26 | auto width = enable ? tabViewCornerWidget->width() : 0; |
|
26 | auto width = enable ? tabViewCornerWidget->width() : 0; | |
@@ -31,18 +31,18 VisualizationWidget::VisualizationWidget(QWidget *parent) | |||||
31 | ui->tabWidget->setMinimumWidth(width); |
|
31 | ui->tabWidget->setMinimumWidth(width); | |
32 | }; |
|
32 | }; | |
33 |
|
33 | |||
34 |
auto addTabView = [this, enableMinimu |
|
34 | auto addTabView = [this, enableMinimumCornerWidgetSize]() { | |
35 | auto index = ui->tabWidget->addTab(new VisualizationTabWidget(ui->tabWidget), |
|
35 | auto index = ui->tabWidget->addTab(new VisualizationTabWidget(ui->tabWidget), | |
36 | QString("View %1").arg(ui->tabWidget->count() + 1)); |
|
36 | QString("View %1").arg(ui->tabWidget->count() + 1)); | |
37 | if (ui->tabWidget->count() > 0) { |
|
37 | if (ui->tabWidget->count() > 0) { | |
38 |
enableMinimu |
|
38 | enableMinimumCornerWidgetSize(false); | |
39 | } |
|
39 | } | |
40 | qCInfo(LOG_VisualizationWidget()) << tr("add the tab of index %1").arg(index); |
|
40 | qCInfo(LOG_VisualizationWidget()) << tr("add the tab of index %1").arg(index); | |
41 | }; |
|
41 | }; | |
42 |
|
42 | |||
43 |
auto removeTabView = [this, enableMinimu |
|
43 | auto removeTabView = [this, enableMinimumCornerWidgetSize](int index) { | |
44 | if (ui->tabWidget->count() == 1) { |
|
44 | if (ui->tabWidget->count() == 1) { | |
45 |
enableMinimu |
|
45 | enableMinimumCornerWidgetSize(true); | |
46 | } |
|
46 | } | |
47 |
|
47 | |||
48 | ui->tabWidget->removeTab(index); |
|
48 | ui->tabWidget->removeTab(index); | |
@@ -101,17 +101,17 void VisualizationWidget::displayVariable(std::shared_ptr<Variable> variable) no | |||||
101 | newGraph->addVariable(variable); |
|
101 | newGraph->addVariable(variable); | |
102 | } |
|
102 | } | |
103 | else { |
|
103 | else { | |
104 |
qC |
|
104 | qCCritical(LOG_VisualizationWidget()) | |
105 | << tr("Can't display the variable : can't create the graph"); |
|
105 | << tr("Can't display the variable : can't create the graph"); | |
106 | } |
|
106 | } | |
107 | } |
|
107 | } | |
108 | else { |
|
108 | else { | |
109 |
qC |
|
109 | qCCritical(LOG_VisualizationWidget()) | |
110 | << tr("Can't display the variable : can't create a new zone in the current tab"); |
|
110 | << tr("Can't display the variable : can't create a new zone in the current tab"); | |
111 | } |
|
111 | } | |
112 | } |
|
112 | } | |
113 | else { |
|
113 | else { | |
114 |
qC |
|
114 | qCCritical(LOG_VisualizationWidget()) | |
115 | << tr("Can't display the variable : there is no current tab"); |
|
115 | << tr("Can't display the variable : there is no current tab"); | |
116 | } |
|
116 | } | |
117 | } |
|
117 | } |
General Comments 0
You need to be logged in to leave comments.
Login now