##// END OF EJS Templates
Fixes after review
Alexandre Leroux -
r188:a02da6065266
parent child
Show More
@@ -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{std::move(xAxisUnit)},
37 m_XAxisUnit{xAxisUnit},
38 m_ValuesData{valuesData},
38 m_ValuesData{valuesData},
39 m_ValuesUnit{std::move(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), std::move(xAxisUnit),
4 : DataSeries{std::make_shared<ArrayData<1> >(size), xAxisUnit,
5 std::make_shared<ArrayData<1> >(size), std::move(valuesUnit)}
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 enableMinimunCornerWidgetSize = [this](bool enable) {
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, enableMinimunCornerWidgetSize]() {
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 enableMinimunCornerWidgetSize(false);
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, enableMinimunCornerWidgetSize](int index) {
43 auto removeTabView = [this, enableMinimumCornerWidgetSize](int index) {
44 if (ui->tabWidget->count() == 1) {
44 if (ui->tabWidget->count() == 1) {
45 enableMinimunCornerWidgetSize(true);
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 qCDebug(LOG_VisualizationWidget())
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 qCDebug(LOG_VisualizationWidget())
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 qCDebug(LOG_VisualizationWidget())
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