Patrick Venture | eeeb867 | 2019-02-08 11:47:42 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "conf.hpp" |
| 4 | |
Patrick Venture | eeeb867 | 2019-02-08 11:47:42 -0800 | [diff] [blame] | 5 | #include <nlohmann/json.hpp> |
Patrick Venture | a83a3ec | 2020-08-04 09:52:05 -0700 | [diff] [blame] | 6 | |
| 7 | #include <map> |
Patrick Venture | eeeb867 | 2019-02-08 11:47:42 -0800 | [diff] [blame] | 8 | #include <string> |
| 9 | |
| 10 | using json = nlohmann::json; |
| 11 | |
Patrick Venture | a076487 | 2020-08-08 07:48:43 -0700 | [diff] [blame] | 12 | namespace pid_control |
| 13 | { |
| 14 | |
Patrick Venture | eeeb867 | 2019-02-08 11:47:42 -0800 | [diff] [blame] | 15 | /** |
| 16 | * Given a json object generated from a configuration file, build the sensor |
| 17 | * configuration representation. This expecteds the json configuration to be |
| 18 | * valid. |
| 19 | * |
| 20 | * @param[in] data - the json data |
| 21 | * @return a map of sensors. |
| 22 | */ |
James Feist | f81f288 | 2019-02-26 11:26:36 -0800 | [diff] [blame] | 23 | std::map<std::string, struct conf::SensorConfig> |
Patrick Venture | eeeb867 | 2019-02-08 11:47:42 -0800 | [diff] [blame] | 24 | buildSensorsFromJson(const json& data); |
Patrick Venture | a076487 | 2020-08-08 07:48:43 -0700 | [diff] [blame] | 25 | |
| 26 | } // namespace pid_control |