aboutsummaryrefslogtreecommitdiff
path: root/Arduino/ems/Machine.h
blob: a2680a9046a612095a3b2c66620e6ee6d3c40d1f (plain)
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
41
42
#ifndef Machine_h
#define Machine_h
#include "Common.h"
#include "Monitor.h"
#include "TaskScheduler.h"

class Machine;
extern Machine machine;

static void STC (uint8_t kwIndex, uint8_t verb,char *args);
static void TMR (uint8_t kwIndex, uint8_t verb,char *args);
static void TMS (uint8_t kwIndex, uint8_t verb,char *args);
static void TRM (uint8_t kwIndex, uint8_t verb,char *args);
static void systemInCharge();

class Machine
{
private:
    Task monitorTask;
    Task machineTask;
    
public:
    int previousState;
    int currentState;
    int timerSetting;
    bool timerIsRunning;
    int timeRemaining;
    bool inSafeStateToRun;
    
    Machine() : currentState(STATE_OFF) {}
    Scheduler todolist;
    void init();
    void setPreviousState(int newState); // {currentState=newState;};
    void setState(int newState); // {currentState=newState;};
    int state() { return currentState; };
    const char * stateName(int) ;
    
protected:

};

#endif