1 #pragma once
2 
3 #include "controller.hpp"
4 #include "ec/stepwise.hpp"
5 #include "fan.hpp"
6 
7 #include <memory>
8 #include <vector>
9 
10 class ZoneInterface;
11 
12 class StepwiseController : public Controller
13 {
14   public:
15     static std::unique_ptr<Controller>
16         CreateStepwiseController(ZoneInterface* owner, const std::string& id,
17                                  const std::vector<std::string>& inputs,
18                                  const ec::StepwiseInfo& initial);
19 
20     StepwiseController(const std::string& id,
21                        const std::vector<std::string>& inputs,
22                        ZoneInterface* owner) :
23         Controller(),
24         _owner(owner), _id(id), _inputs(inputs)
25     {
26     }
27 
28     float input_proc(void) override;
29 
30     void output_proc(float value) override;
31 
32     void process(void) override;
33 
34     std::string get_id(void)
35     {
36         return _id;
37     }
38 
39     ec::StepwiseInfo& get_stepwise_info(void)
40     {
41         return _stepwise_info;
42     }
43 
44   protected:
45     ZoneInterface* _owner;
46 
47   private:
48     // parameters
49     ec::StepwiseInfo _stepwise_info;
50     std::string _id;
51     std::vector<std::string> _inputs;
52 };
53