##// END OF EJS Templates
Updates spectrogram to hold time resolution...
Alexandre Leroux -
r1029:2928e8449245
parent child
Show More
@@ -16,18 +16,25 public:
16 /// Ctor
16 /// Ctor
17 explicit SpectrogramSeries(std::vector<double> xAxisData, std::vector<double> yAxisData,
17 explicit SpectrogramSeries(std::vector<double> xAxisData, std::vector<double> yAxisData,
18 std::vector<double> valuesData, const Unit &xAxisUnit,
18 std::vector<double> valuesData, const Unit &xAxisUnit,
19 const Unit &yAxisUnit, const Unit &valuesUnit);
19 const Unit &yAxisUnit, const Unit &valuesUnit,
20 double xResolution = std::numeric_limits<double>::quiet_NaN());
20
21
21 /// Ctor directly with the y-axis
22 /// Ctor directly with the y-axis
22 explicit SpectrogramSeries(std::shared_ptr<ArrayData<1> > xAxisData, const Unit &xAxisUnit,
23 explicit SpectrogramSeries(std::shared_ptr<ArrayData<1> > xAxisData, const Unit &xAxisUnit,
23 std::shared_ptr<ArrayData<2> > valuesData, const Unit &valuesUnit,
24 std::shared_ptr<ArrayData<2> > valuesData, const Unit &valuesUnit,
24 OptionalAxis yAxis);
25 OptionalAxis yAxis,
26 double xResolution = std::numeric_limits<double>::quiet_NaN());
25
27
26 /// @sa DataSeries::clone()
28 /// @sa DataSeries::clone()
27 std::unique_ptr<IDataSeries> clone() const override;
29 std::unique_ptr<IDataSeries> clone() const override;
28
30
29 /// @sa DataSeries::subDataSeries()
31 /// @sa DataSeries::subDataSeries()
30 std::shared_ptr<IDataSeries> subDataSeries(const SqpRange &range) override;
32 std::shared_ptr<IDataSeries> subDataSeries(const SqpRange &range) override;
33
34 inline double xResolution() const noexcept { return m_XResolution; }
35
36 private:
37 double m_XResolution; ///< Resolution used on x-axis to build the spectrogram
31 };
38 };
32
39
33 #endif // SCIQLOP_SPECTROGRAMSERIES_H
40 #endif // SCIQLOP_SPECTROGRAMSERIES_H
@@ -2,20 +2,25
2
2
3 SpectrogramSeries::SpectrogramSeries(std::vector<double> xAxisData, std::vector<double> yAxisData,
3 SpectrogramSeries::SpectrogramSeries(std::vector<double> xAxisData, std::vector<double> yAxisData,
4 std::vector<double> valuesData, const Unit &xAxisUnit,
4 std::vector<double> valuesData, const Unit &xAxisUnit,
5 const Unit &yAxisUnit, const Unit &valuesUnit)
5 const Unit &yAxisUnit, const Unit &valuesUnit,
6 double resolution)
6 : SpectrogramSeries{
7 : SpectrogramSeries{
7 std::make_shared<ArrayData<1> >(std::move(xAxisData)), xAxisUnit,
8 std::make_shared<ArrayData<1> >(std::move(xAxisData)),
8 std::make_shared<ArrayData<2> >(std::move(valuesData), yAxisData.size()), valuesUnit,
9 xAxisUnit,
9 OptionalAxis{std::make_shared<ArrayData<1> >(std::move(yAxisData)), yAxisUnit}}
10 std::make_shared<ArrayData<2> >(std::move(valuesData), yAxisData.size()),
11 valuesUnit,
12 OptionalAxis{std::make_shared<ArrayData<1> >(std::move(yAxisData)), yAxisUnit},
13 resolution}
10 {
14 {
11 }
15 }
12
16
13 SpectrogramSeries::SpectrogramSeries(std::shared_ptr<ArrayData<1> > xAxisData,
17 SpectrogramSeries::SpectrogramSeries(std::shared_ptr<ArrayData<1> > xAxisData,
14 const Unit &xAxisUnit,
18 const Unit &xAxisUnit,
15 std::shared_ptr<ArrayData<2> > valuesData,
19 std::shared_ptr<ArrayData<2> > valuesData,
16 const Unit &valuesUnit, OptionalAxis yAxis)
20 const Unit &valuesUnit, OptionalAxis yAxis, double resolution)
17 : DataSeries{std::move(xAxisData), xAxisUnit, std::move(valuesData), valuesUnit,
21 : DataSeries{std::move(xAxisData), xAxisUnit, std::move(valuesData), valuesUnit,
18 std::move(yAxis)}
22 std::move(yAxis)},
23 m_XResolution{resolution}
19 {
24 {
20 }
25 }
21
26
@@ -308,7 +308,8 std::shared_ptr<IDataSeries> SpectrogramParserHelper::createSeries()
308 std::move(m_XAxisData), std::move(m_YAxisData), std::move(m_ValuesData),
308 std::move(m_XAxisData), std::move(m_YAxisData), std::move(m_ValuesData),
309 Unit{"t", true}, // x-axis unit is always a time unit
309 Unit{"t", true}, // x-axis unit is always a time unit
310 m_Properties.value(Y_AXIS_UNIT_PROPERTY).value<Unit>(),
310 m_Properties.value(Y_AXIS_UNIT_PROPERTY).value<Unit>(),
311 m_Properties.value(VALUES_UNIT_PROPERTY).value<Unit>());
311 m_Properties.value(VALUES_UNIT_PROPERTY).value<Unit>(),
312 m_Properties.value(MIN_SAMPLING_PROPERTY).value<double>());
312 }
313 }
313
314
314 void SpectrogramParserHelper::readPropertyLine(const QString &line)
315 void SpectrogramParserHelper::readPropertyLine(const QString &line)
General Comments 0
You need to be logged in to leave comments. Login now