blob: 568005216de550cc34f51d6385d458ab6eca7875 [file] [log] [blame]
Patrick Ventured8012182018-03-08 08:21:38 -08001#pragma once
2
Patrick Ventureda4a5dd2018-08-31 09:42:48 -07003#include "ec/pid.hpp"
4#include "fan.hpp"
5
James Feist22c257a2018-08-31 14:07:12 -07006#include <string>
Patrick Ventured8012182018-03-08 08:21:38 -08007
Patrick Venturea0764872020-08-08 07:48:43 -07008namespace pid_control
9{
10
Patrick Ventured8012182018-03-08 08:21:38 -080011/*
James Feist22c257a2018-08-31 14:07:12 -070012 * Base class for controllers. Each controller that implements this needs to
Patrick Venture563a3562018-10-30 09:31:26 -070013 * provide an inputProc, process, and outputProc.
Patrick Ventured8012182018-03-08 08:21:38 -080014 */
James Feist22c257a2018-08-31 14:07:12 -070015class ZoneInterface;
Patrick Ventured8012182018-03-08 08:21:38 -080016
James Feist22c257a2018-08-31 14:07:12 -070017struct Controller
18{
19 virtual ~Controller() = default;
Patrick Ventured8012182018-03-08 08:21:38 -080020
Patrick Venture5f59c0f2018-11-11 12:55:14 -080021 virtual double inputProc(void) = 0;
James Feist22c257a2018-08-31 14:07:12 -070022
Patrick Venture5f59c0f2018-11-11 12:55:14 -080023 virtual void outputProc(double value) = 0;
Patrick Ventured8012182018-03-08 08:21:38 -080024
James Feist22c257a2018-08-31 14:07:12 -070025 virtual void process(void) = 0;
Patrick Ventured8012182018-03-08 08:21:38 -080026
Patrick Venture563a3562018-10-30 09:31:26 -070027 virtual std::string getID(void) = 0;
Patrick Ventured8012182018-03-08 08:21:38 -080028};
Patrick Venturea0764872020-08-08 07:48:43 -070029
30} // namespace pid_control