* @brief Copies the selected samples into @p series in chronological order. */
| 419 | * @brief Copies the selected samples into @p series in chronological order. |
| 420 | */ |
| 421 | static void writeSelectedSamples(const DSP::AxisData& x, |
| 422 | const DSP::AxisData& y, |
| 423 | const std::vector<std::size_t>& indices, |
| 424 | Sessions::DatasetSeries& series) |
| 425 | { |
| 426 | Q_ASSERT(!indices.empty()); |
| 427 | Q_ASSERT(series.timesSec.empty()); |
| 428 | Q_ASSERT(series.values.empty()); |
| 429 | |
| 430 | series.timesSec.reserve(indices.size()); |
| 431 | series.values.reserve(indices.size()); |
| 432 | |
| 433 | for (const auto index : indices) { |
| 434 | Q_ASSERT(index < x.size() && index < y.size()); |
| 435 | series.timesSec.push_back(x[index]); |
| 436 | series.values.push_back(y[index]); |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | /** |
| 441 | * @brief Writes either the raw samples or a fixed-budget decimated series. |
no test coverage detected