Patrick Venture | d801218 | 2018-03-08 08:21:38 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <memory> |
| 4 | #include <string> |
| 5 | #include <vector> |
| 6 | |
| 7 | #include "controller.hpp" |
| 8 | #include "ec/pid.hpp" |
| 9 | |
| 10 | |
| 11 | /* |
| 12 | * A ThermalController is a PID controller that reads a number of sensors and |
| 13 | * provides the set-points for the fans. |
| 14 | */ |
| 15 | class ThermalController : public PIDController |
| 16 | { |
| 17 | public: |
| 18 | static std::unique_ptr<PIDController> CreateThermalPid( |
| 19 | std::shared_ptr<PIDZone> owner, |
| 20 | const std::string& id, |
| 21 | std::vector<std::string>& inputs, |
| 22 | float setpoint, |
| 23 | ec::pidinfo initial); |
| 24 | |
| 25 | ThermalController(const std::string& id, |
| 26 | std::vector<std::string>& inputs, |
| 27 | std::shared_ptr<PIDZone> owner) |
| 28 | : PIDController(id, owner), |
| 29 | _inputs(inputs) |
| 30 | { } |
| 31 | |
| 32 | float input_proc(void) override; |
| 33 | float setpt_proc(void) override; |
| 34 | void output_proc(float value) override; |
| 35 | |
| 36 | private: |
| 37 | std::vector<std::string> _inputs; |
| 38 | }; |
| 39 | |