##// END OF EJS Templates
Correction for MR
perrinel -
r447:00ae2619d35f
parent child
Show More
@@ -40,7 +40,7 public:
40 40 void removeVariable(std::shared_ptr<Variable> variable) noexcept;
41 41
42 42 void setRange(std::shared_ptr<Variable> variable, const SqpDateTime &range);
43 SqpDateTime graphRange();
43 SqpDateTime graphRange() const noexcept;
44 44 void setGraphRange(const SqpDateTime &range);
45 45
46 46 // IVisualizationWidget interface
@@ -78,9 +78,9 public:
78 78 auto buttonRect = QRect(progressRect.right(), option.rect.top(), cancelButtonWidth,
79 79 option.rect.height());
80 80
81 QMouseEvent *e = (QMouseEvent *)event;
82 int clickX = e->x();
83 int clickY = e->y();
81 auto e = (QMouseEvent *)event;
82 auto clickX = e->x();
83 auto clickY = e->y();
84 84
85 85 auto x = buttonRect.left(); // the X coordinate
86 86 auto y = buttonRect.top(); // the Y coordinate
@@ -89,7 +89,6 public:
89 89
90 90 if (clickX > x && clickX < x + w) {
91 91 if (clickY > y && clickY < y + h) {
92 qCritical(LOG_VariableInspectorWidget()) << tr("editorEvent CLIC");
93 92 auto variableModel = sqpApp->variableController().variableModel();
94 93 variableModel->abortProgress(index);
95 94 }
@@ -25,7 +25,7 const auto VERTICAL_ZOOM_MODIFIER = Qt::ControlModifier;
25 25
26 26 struct VisualizationGraphWidget::VisualizationGraphWidgetPrivate {
27 27
28 explicit VisualizationGraphWidgetPrivate() : m_DoSynchronize(true), m_IsCalibration(false) {}
28 explicit VisualizationGraphWidgetPrivate() : m_DoSynchronize{true}, m_IsCalibration{false} {}
29 29
30 30
31 31 // Return the operation when range changed
@@ -106,8 +106,8 void VisualizationGraphWidget::addVariableUsingGraph(std::shared_ptr<Variable> v
106 106
107 107 auto variableDateTimeWithTolerance = dateTime;
108 108
109 // add 10% tolerance for each side
110 auto tolerance = 0.1 * (dateTime.m_TEnd - dateTime.m_TStart);
109 // add 20% tolerance for each side
110 auto tolerance = 0.2 * (dateTime.m_TEnd - dateTime.m_TStart);
111 111 variableDateTimeWithTolerance.m_TStart -= tolerance;
112 112 variableDateTimeWithTolerance.m_TEnd += tolerance;
113 113
@@ -142,6 +142,8 void VisualizationGraphWidget::removeVariable(std::shared_ptr<Variable> variable
142 142 void VisualizationGraphWidget::setRange(std::shared_ptr<Variable> variable,
143 143 const SqpDateTime &range)
144 144 {
145 // Note: in case of different axes that depends on variable, we could start with a code like
146 // that:
145 147 // auto componentsIt = impl->m_VariableToPlotMultiMap.equal_range(variable);
146 148 // for (auto it = componentsIt.first; it != componentsIt.second;) {
147 149 // }
@@ -149,7 +151,7 void VisualizationGraphWidget::setRange(std::shared_ptr<Variable> variable,
149 151 ui->widget->replot();
150 152 }
151 153
152 SqpDateTime VisualizationGraphWidget::graphRange()
154 SqpDateTime VisualizationGraphWidget::graphRange() const noexcept
153 155 {
154 156 auto grapheRange = ui->widget->xAxis->range();
155 157 return SqpDateTime{grapheRange.lower, grapheRange.upper};
@@ -146,7 +146,7 void VisualizationWidget::onVariableAboutToBeDeleted(std::shared_ptr<Variable> v
146 146 void VisualizationWidget::onRangeChanged(std::shared_ptr<Variable> variable,
147 147 const SqpDateTime &range) noexcept
148 148 {
149 // Calls the operation of removing all references to the variable in the visualization
149 // Calls the operation of rescaling all graph that contrains variable in the visualization
150 150 auto rescaleVariableOperation = RescaleAxeOperation{variable, range};
151 151 accept(&rescaleVariableOperation);
152 152 }
@@ -6,7 +6,7 Q_LOGGING_CATEGORY(LOG_RescaleAxeOperation, "RescaleAxeOperation")
6 6 struct RescaleAxeOperation::RescaleAxeOperationPrivate {
7 7 explicit RescaleAxeOperationPrivate(std::shared_ptr<Variable> variable,
8 8 const SqpDateTime &range)
9 : m_Variable(variable), m_Range(range)
9 : m_Variable{variable}, m_Range{range}
10 10 {
11 11 }
12 12
@@ -59,7 +59,7 void RescaleAxeOperation::visitLeave(VisualizationZoneWidget *zoneWidget)
59 59 void RescaleAxeOperation::visit(VisualizationGraphWidget *graphWidget)
60 60 {
61 61 if (graphWidget) {
62 // If the widget contains the variable, removes it
62 // If the widget contains the variable, rescale it
63 63 if (impl->m_Variable && graphWidget->contains(*impl->m_Variable)) {
64 64 graphWidget->setRange(impl->m_Variable, impl->m_Range);
65 65 }
@@ -156,11 +156,11 void TestAmdaResultParser::testReadTxt_data()
156 156 QVector<double>{-2.71850, -2.52150}};
157 157
158 158 // Invalid files
159 QTest::newRow("Invalid file (unexisting file)")
160 << QStringLiteral("UnexistingFile.txt") << ExpectedResults{};
159 QTest::newRow("Invalid file (unexisting file)") << QStringLiteral("UnexistingFile.txt")
160 << ExpectedResults{};
161 161
162 QTest::newRow("Invalid file (file not found on server)")
163 << QStringLiteral("FileNotFound.txt") << ExpectedResults{};
162 QTest::newRow("Invalid file (file not found on server)") << QStringLiteral("FileNotFound.txt")
163 << ExpectedResults{};
164 164 }
165 165
166 166 void TestAmdaResultParser::testReadTxt()
General Comments 0
You need to be logged in to leave comments. Login now