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 const std::vector<std::string>& inputs, 20 double setpoint, const ec::pidinfo& initial); 21 22 ThermalController(const std::string& id, 23 const std::vector<std::string>& inputs, 24 ZoneInterface* owner) : 25 PIDController(id, owner), 26 _inputs(inputs) 27 { 28 } 29 30 double inputProc(void) override; 31 double setptProc(void) override; 32 void outputProc(double value) override; 33 34 private: 35 std::vector<std::string> _inputs; 36 }; 37