blob: dbfcfc96a8aac7a3a16bb6811bc1d26b481ba867 [file] [log] [blame]
Patrick Ventured8012182018-03-08 08:21:38 -08001#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 */
15class ThermalController : public PIDController
16{
17 public:
18 static std::unique_ptr<PIDController> CreateThermalPid(
Patrick Venture5c7cc542018-06-11 14:29:38 -070019 PIDZone* owner,
Patrick Ventured8012182018-03-08 08:21:38 -080020 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,
Patrick Venture5c7cc542018-06-11 14:29:38 -070027 PIDZone* owner)
Patrick Ventured8012182018-03-08 08:21:38 -080028 : 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