-
Notifications
You must be signed in to change notification settings - Fork 1
/
AutoTuneController.h
40 lines (31 loc) · 1.08 KB
/
AutoTuneController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#if !defined(AUTO_TUNE_CONTROLLER_H)
#define AUTO_TUNE_CONTROLLER_H
#include "ComponentController.h"
#include "CapacitorController.h"
class PowerMonitor;
class AutoTuneController : public ComponentController
{
public:
enum Direction { NONE, DOWN, UP };
enum State { IDLE, BEGIN_TUNE, FAST_TUNE, SLOW_TUNE, TOP_UP, FAST_TUNE_WAIT, SLOW_TUNE_WAIT };
AutoTuneController(CapacitorController* pCapacitorController, PowerMonitor* pPowerMonitor);
virtual ~AutoTuneController();
virtual void process();
virtual void setup();
void beginTune(Direction direction);
void endTune();
Direction getDirection() const;
State getState() const;
private:
CapacitorController* pCapacitorController_;
PowerMonitor* pPowerMonitor_;
State currentState_;
Direction autoTuneDirection_;
double minSWRVal_;
unsigned long waitTimeBegin_;
CapacitorController::Direction getDirectionForCurrentState_() const;
CapacitorController::Speed getSpeedForCurrentState_() const;
double getSWRThresholdForCurrentState_() const;
State getNextState_() const;
};
#endif // AUTO_TUNE_CONTROLLER_H