diff --git a/core b/core index a8a4e48..ae48b17 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit a8a4e48c21af5a28ad3f56582db7bbec0fe76978 +Subproject commit ae48b17833443bc2730a7511f964569dc7cdb1df diff --git a/gui/src/Visualization/AxisRenderingUtils.cpp b/gui/src/Visualization/AxisRenderingUtils.cpp index dbb2209..779b62e 100644 --- a/gui/src/Visualization/AxisRenderingUtils.cpp +++ b/gui/src/Visualization/AxisRenderingUtils.cpp @@ -153,7 +153,7 @@ struct AxisSetter struct AxisHelper : public IAxisHelper { - explicit AxisHelper(T* dataSeries) : m_DataSeries { dataSeries } {} + explicit AxisHelper(std::shared_ptr dataSeries) : m_DataSeries { dataSeries } {} void setProperties(QCustomPlot& plot, SqpColorScale& colorScale) override { @@ -173,7 +173,7 @@ struct AxisHelper : public IAxisHelper } } - T* m_DataSeries; + std::shared_ptr m_DataSeries; }; } // namespace @@ -197,13 +197,13 @@ std::unique_ptr IAxisHelperFactory::create(Variable2& variable) noe { case DataSeriesType::SCALAR: return std::make_unique>( - dynamic_cast(variable.data()->base())); + std::dynamic_pointer_cast(variable.data())); case DataSeriesType::SPECTROGRAM: return std::make_unique>( - dynamic_cast(variable.data()->base())); + std::dynamic_pointer_cast(variable.data())); case DataSeriesType::VECTOR: return std::make_unique>( - dynamic_cast(variable.data()->base())); + std::dynamic_pointer_cast(variable.data())); default: // Creates default helper break; diff --git a/gui/src/Visualization/VisualizationGraphHelper.cpp b/gui/src/Visualization/VisualizationGraphHelper.cpp index 5157cdd..1479eb7 100644 --- a/gui/src/Visualization/VisualizationGraphHelper.cpp +++ b/gui/src/Visualization/VisualizationGraphHelper.cpp @@ -340,7 +340,7 @@ struct IPlottablesHelper template struct PlottablesHelper : public IPlottablesHelper { - explicit PlottablesHelper(T* dataSeries) : m_DataSeries { dataSeries } {} + explicit PlottablesHelper(std::shared_ptr dataSeries) : m_DataSeries { dataSeries } {} PlottablesMap create(QCustomPlot& plot) const override { @@ -376,7 +376,7 @@ struct PlottablesHelper : public IPlottablesHelper } } - T* m_DataSeries; + std::shared_ptr m_DataSeries; }; /// Creates IPlottablesHelper according to the type of data series a variable holds @@ -386,13 +386,13 @@ std::unique_ptr createHelper(std::shared_ptr varia { case DataSeriesType::SCALAR: return std::make_unique>( - dynamic_cast(variable->data()->base())); + std::dynamic_pointer_cast(variable->data())); case DataSeriesType::SPECTROGRAM: return std::make_unique>( - dynamic_cast(variable->data()->base())); + std::dynamic_pointer_cast(variable->data())); case DataSeriesType::VECTOR: return std::make_unique>( - dynamic_cast(variable->data()->base())); + std::dynamic_pointer_cast(variable->data())); default: // Creates default helper break; diff --git a/gui/tests/multiple_sync_graph/main.cpp b/gui/tests/multiple_sync_graph/main.cpp index ae2f8ee..1cc9ffa 100644 --- a/gui/tests/multiple_sync_graph/main.cpp +++ b/gui/tests/multiple_sync_graph/main.cpp @@ -64,10 +64,10 @@ private slots: auto r = variables.back()->range(); /* - * Scrolling to the left implies going back in time - * Scroll only implies keeping the same delta T -> shit only transformation + * Scrolling to the left implies going forward in time + * Scroll only implies keeping the same delta T -> shift only transformation */ - QVERIFY(r.m_TEnd < range.m_TEnd); + QVERIFY(r.m_TEnd > range.m_TEnd); QVERIFY(SciQLop::numeric::almost_equal(r.delta(), range.delta(), 1)); } @@ -85,10 +85,10 @@ private slots: auto r = variables.back()->range(); /* - * Scrolling to the right implies going forward in time - * Scroll only implies keeping the same delta T -> shit only transformation + * Scrolling to the right implies going back in time + * Scroll only implies keeping the same delta T -> shift only transformation */ - QVERIFY(r.m_TEnd > range.m_TEnd); + QVERIFY(r.m_TEnd < range.m_TEnd); QVERIFY(SciQLop::numeric::almost_equal(r.delta(), range.delta(), 1)); } };