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