| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include <units.h> |
| 7 | #include <utility> |
| 8 | #include <vector> |
| 9 | |
| 10 | namespace Utils::Common { |
| 11 | |
| 12 | /// Normalizes points into temperature and percentage ranges. |
| 13 | /// @note Temperature normalization is only performed when needed. |
| 14 | /// @param tempRange target temperature range |
| 15 | /// @param speedRange target speed range |
| 16 | void normalizePoints( |
| 17 | std::vector<std::pair<units::temperature::celsius_t, |
| 18 | units::concentration::percent_t>> &points, |
| 19 | std::pair<units::temperature::celsius_t, units::temperature::celsius_t> tempRange, |
| 20 | std::pair<units::concentration::percent_t, units::concentration::percent_t> |
| 21 | speedRange = std::make_pair(units::concentration::percent_t(0), |
| 22 | units::concentration::percent_t(100))); |
| 23 | |
| 24 | } // namespace Utils::Common |