@@ -1,1 +1,1 | |||||
1 | Subproject commit a8a4e48c21af5a28ad3f56582db7bbec0fe76978 |
|
1 | Subproject commit ae48b17833443bc2730a7511f964569dc7cdb1df |
@@ -153,7 +153,7 struct AxisSetter<T, typename std::enable_if_t<std::is_base_of<SpectrogramTimeSe | |||||
153 | template <typename T> |
|
153 | template <typename T> | |
154 | struct AxisHelper : public IAxisHelper |
|
154 | struct AxisHelper : public IAxisHelper | |
155 | { |
|
155 | { | |
156 |
explicit AxisHelper(T |
|
156 | explicit AxisHelper(std::shared_ptr<T> dataSeries) : m_DataSeries { dataSeries } {} | |
157 |
|
157 | |||
158 | void setProperties(QCustomPlot& plot, SqpColorScale& colorScale) override |
|
158 | void setProperties(QCustomPlot& plot, SqpColorScale& colorScale) override | |
159 | { |
|
159 | { | |
@@ -173,7 +173,7 struct AxisHelper : public IAxisHelper | |||||
173 | } |
|
173 | } | |
174 | } |
|
174 | } | |
175 |
|
175 | |||
176 |
T |
|
176 | std::shared_ptr<T> m_DataSeries; | |
177 | }; |
|
177 | }; | |
178 |
|
178 | |||
179 | } // namespace |
|
179 | } // namespace | |
@@ -197,13 +197,13 std::unique_ptr<IAxisHelper> IAxisHelperFactory::create(Variable2& variable) noe | |||||
197 | { |
|
197 | { | |
198 | case DataSeriesType::SCALAR: |
|
198 | case DataSeriesType::SCALAR: | |
199 | return std::make_unique<AxisHelper<ScalarTimeSerie>>( |
|
199 | return std::make_unique<AxisHelper<ScalarTimeSerie>>( | |
200 |
dynamic_cast<ScalarTimeSerie |
|
200 | std::dynamic_pointer_cast<ScalarTimeSerie>(variable.data())); | |
201 | case DataSeriesType::SPECTROGRAM: |
|
201 | case DataSeriesType::SPECTROGRAM: | |
202 | return std::make_unique<AxisHelper<SpectrogramTimeSerie>>( |
|
202 | return std::make_unique<AxisHelper<SpectrogramTimeSerie>>( | |
203 |
dynamic_cast<SpectrogramTimeSerie |
|
203 | std::dynamic_pointer_cast<SpectrogramTimeSerie>(variable.data())); | |
204 | case DataSeriesType::VECTOR: |
|
204 | case DataSeriesType::VECTOR: | |
205 | return std::make_unique<AxisHelper<VectorTimeSerie>>( |
|
205 | return std::make_unique<AxisHelper<VectorTimeSerie>>( | |
206 |
dynamic_cast<VectorTimeSerie |
|
206 | std::dynamic_pointer_cast<VectorTimeSerie>(variable.data())); | |
207 | default: |
|
207 | default: | |
208 | // Creates default helper |
|
208 | // Creates default helper | |
209 | break; |
|
209 | break; |
@@ -340,7 +340,7 struct IPlottablesHelper | |||||
340 | template <typename T> |
|
340 | template <typename T> | |
341 | struct PlottablesHelper : public IPlottablesHelper |
|
341 | struct PlottablesHelper : public IPlottablesHelper | |
342 | { |
|
342 | { | |
343 |
explicit PlottablesHelper(T |
|
343 | explicit PlottablesHelper(std::shared_ptr<T> dataSeries) : m_DataSeries { dataSeries } {} | |
344 |
|
344 | |||
345 | PlottablesMap create(QCustomPlot& plot) const override |
|
345 | PlottablesMap create(QCustomPlot& plot) const override | |
346 | { |
|
346 | { | |
@@ -376,7 +376,7 struct PlottablesHelper : public IPlottablesHelper | |||||
376 | } |
|
376 | } | |
377 | } |
|
377 | } | |
378 |
|
378 | |||
379 |
T |
|
379 | std::shared_ptr<T> m_DataSeries; | |
380 | }; |
|
380 | }; | |
381 |
|
381 | |||
382 | /// Creates IPlottablesHelper according to the type of data series a variable holds |
|
382 | /// Creates IPlottablesHelper according to the type of data series a variable holds | |
@@ -386,13 +386,13 std::unique_ptr<IPlottablesHelper> createHelper(std::shared_ptr<Variable2> varia | |||||
386 | { |
|
386 | { | |
387 | case DataSeriesType::SCALAR: |
|
387 | case DataSeriesType::SCALAR: | |
388 | return std::make_unique<PlottablesHelper<ScalarTimeSerie>>( |
|
388 | return std::make_unique<PlottablesHelper<ScalarTimeSerie>>( | |
389 |
dynamic_cast<ScalarTimeSerie |
|
389 | std::dynamic_pointer_cast<ScalarTimeSerie>(variable->data())); | |
390 | case DataSeriesType::SPECTROGRAM: |
|
390 | case DataSeriesType::SPECTROGRAM: | |
391 | return std::make_unique<PlottablesHelper<SpectrogramTimeSerie>>( |
|
391 | return std::make_unique<PlottablesHelper<SpectrogramTimeSerie>>( | |
392 |
dynamic_cast<SpectrogramTimeSerie |
|
392 | std::dynamic_pointer_cast<SpectrogramTimeSerie>(variable->data())); | |
393 | case DataSeriesType::VECTOR: |
|
393 | case DataSeriesType::VECTOR: | |
394 | return std::make_unique<PlottablesHelper<VectorTimeSerie>>( |
|
394 | return std::make_unique<PlottablesHelper<VectorTimeSerie>>( | |
395 |
dynamic_cast<VectorTimeSerie |
|
395 | std::dynamic_pointer_cast<VectorTimeSerie>(variable->data())); | |
396 | default: |
|
396 | default: | |
397 | // Creates default helper |
|
397 | // Creates default helper | |
398 | break; |
|
398 | break; |
@@ -64,10 +64,10 private slots: | |||||
64 | auto r = variables.back()->range(); |
|
64 | auto r = variables.back()->range(); | |
65 |
|
65 | |||
66 | /* |
|
66 | /* | |
67 |
* Scrolling to the left implies going |
|
67 | * Scrolling to the left implies going forward in time | |
68 | * Scroll only implies keeping the same delta T -> shit only transformation |
|
68 | * Scroll only implies keeping the same delta T -> shift only transformation | |
69 | */ |
|
69 | */ | |
70 |
QVERIFY(r.m_TEnd |
|
70 | QVERIFY(r.m_TEnd > range.m_TEnd); | |
71 | QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(), range.delta(), 1)); |
|
71 | QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(), range.delta(), 1)); | |
72 | } |
|
72 | } | |
73 |
|
73 | |||
@@ -85,10 +85,10 private slots: | |||||
85 | auto r = variables.back()->range(); |
|
85 | auto r = variables.back()->range(); | |
86 |
|
86 | |||
87 | /* |
|
87 | /* | |
88 |
* Scrolling to the right implies going |
|
88 | * Scrolling to the right implies going back in time | |
89 | * Scroll only implies keeping the same delta T -> shit only transformation |
|
89 | * Scroll only implies keeping the same delta T -> shift only transformation | |
90 | */ |
|
90 | */ | |
91 |
QVERIFY(r.m_TEnd |
|
91 | QVERIFY(r.m_TEnd < range.m_TEnd); | |
92 | QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(), range.delta(), 1)); |
|
92 | QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(), range.delta(), 1)); | |
93 | } |
|
93 | } | |
94 | }; |
|
94 | }; |
General Comments 0
You need to be logged in to leave comments.
Login now