@@ -75,6 +75,8 public: | |||
|
75 | 75 | void readResultLine(const QString &line) override; |
|
76 | 76 | |
|
77 | 77 | private: |
|
78 | void handleDataHoles(); | |
|
79 | ||
|
78 | 80 | Properties m_Properties{}; |
|
79 | 81 | std::vector<double> m_XAxisData{}; |
|
80 | 82 | std::vector<double> m_YAxisData{}; |
@@ -3,6 +3,7 | |||
|
3 | 3 | #include <Common/DateUtils.h> |
|
4 | 4 | #include <Common/SortUtils.h> |
|
5 | 5 | |
|
6 | #include <Data/DataSeriesUtils.h> | |
|
6 | 7 | #include <Data/ScalarSeries.h> |
|
7 | 8 | #include <Data/SpectrogramSeries.h> |
|
8 | 9 | #include <Data/Unit.h> |
@@ -283,13 +284,14 bool SpectrogramParserHelper::checkProperties() | |||
|
283 | 284 | // Sets fill value |
|
284 | 285 | m_FillValue = m_Properties.value(FILL_VALUE_PROPERTY).value<double>(); |
|
285 | 286 | |
|
286 | /// @todo: handle min/max samplings? | |
|
287 | ||
|
288 | 287 | return true; |
|
289 | 288 | } |
|
290 | 289 | |
|
291 | 290 | std::shared_ptr<IDataSeries> SpectrogramParserHelper::createSeries() |
|
292 | 291 | { |
|
292 | // Before creating the series, we handle its data holes | |
|
293 | handleDataHoles(); | |
|
294 | ||
|
293 | 295 | return std::make_shared<SpectrogramSeries>( |
|
294 | 296 | std::move(m_XAxisData), std::move(m_YAxisData), std::move(m_ValuesData), |
|
295 | 297 | Unit{"t", true}, // x-axis unit is always a time unit |
@@ -352,6 +354,15 void SpectrogramParserHelper::readResultLine(const QString &line) | |||
|
352 | 354 | tryReadResult(m_XAxisData, m_ValuesData, line, m_ValuesIndexes, m_FillValue); |
|
353 | 355 | } |
|
354 | 356 | |
|
357 | void SpectrogramParserHelper::handleDataHoles() | |
|
358 | { | |
|
359 | // Fills data holes according to the max resolution found in the AMDA file | |
|
360 | auto resolution = m_Properties.value(MAX_SAMPLING_PROPERTY).value<double>(); | |
|
361 | auto fillValue = m_Properties.value(FILL_VALUE_PROPERTY).value<double>(); | |
|
362 | ||
|
363 | DataSeriesUtils::fillDataHoles(m_XAxisData, m_ValuesData, resolution, fillValue); | |
|
364 | } | |
|
365 | ||
|
355 | 366 | // ////////////////// // |
|
356 | 367 | // VectorParserHelper // |
|
357 | 368 | // ////////////////// // |
General Comments 0
You need to be logged in to leave comments.
Login now