conf.hpp (9fe3a3c767cc7932f526edb2fded7962d848b8a4) conf.hpp (31058fd3fcc5b8b2d09282d89cef64a18e20b5da)
1#pragma once
2
3#include "pid/ec/pid.hpp"
4#include "pid/ec/stepwise.hpp"
5
1#pragma once
2
3#include "pid/ec/pid.hpp"
4#include "pid/ec/stepwise.hpp"
5
6#include <limits>
6#include <map>
7#include <string>
8#include <vector>
9
10namespace pid_control
11{
7#include <map>
8#include <string>
9#include <vector>
10
11namespace pid_control
12{
13
12namespace conf
13{
14
15/*
16 * General sensor structure used for configuration.
17 */
18struct SensorConfig
19{

--- 6 unchanged lines hidden (view full) ---

26 int64_t min;
27 int64_t max;
28 int64_t timeout;
29 bool ignoreDbusMinMax;
30 bool unavailableAsFailed;
31};
32
33/*
14namespace conf
15{
16
17/*
18 * General sensor structure used for configuration.
19 */
20struct SensorConfig
21{

--- 6 unchanged lines hidden (view full) ---

28 int64_t min;
29 int64_t max;
30 int64_t timeout;
31 bool ignoreDbusMinMax;
32 bool unavailableAsFailed;
33};
34
35/*
36 * Structure for decorating an input sensor's name with additional
37 * information, to help out with TempToMargin conversion.
38 */
39struct SensorInput
40{
41 std::string name;
42 double convertMarginZero = std::numeric_limits<double>::quiet_NaN();
43 bool convertTempToMargin = false;
44};
45
46/*
34 * Structure for holding the configuration of a PID.
35 */
36struct ControllerInfo
37{
38 std::string type; // fan or margin or temp?
47 * Structure for holding the configuration of a PID.
48 */
49struct ControllerInfo
50{
51 std::string type; // fan or margin or temp?
39 std::vector<std::string> inputs; // one or more sensors.
52 std::vector<SensorInput> inputs; // one or more sensors.
40 double setpoint; // initial setpoint for thermal.
41 ec::pidinfo pidInfo; // pid details
42 ec::StepwiseInfo stepwiseInfo;
43 double failSafePercent;
44};
45
46struct CycleTime
47{

--- 21 unchanged lines hidden (view full) ---

69 CycleTime cycleTime;
70};
71
72using PIDConf = std::map<std::string, ControllerInfo>;
73
74constexpr bool DEBUG = false; // enable to print found configuration
75
76} // namespace conf
53 double setpoint; // initial setpoint for thermal.
54 ec::pidinfo pidInfo; // pid details
55 ec::StepwiseInfo stepwiseInfo;
56 double failSafePercent;
57};
58
59struct CycleTime
60{

--- 21 unchanged lines hidden (view full) ---

82 CycleTime cycleTime;
83};
84
85using PIDConf = std::map<std::string, ControllerInfo>;
86
87constexpr bool DEBUG = false; // enable to print found configuration
88
89} // namespace conf
90
77} // namespace pid_control
91} // namespace pid_control