-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContext.h
93 lines (75 loc) · 1.56 KB
/
Context.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef _CONTEXT_h
#define _CONTEXT_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
#include "ScheduledConf.h"
#include "TimedConf.h"
#include "SensorConf.h"
class Context
{
public:
// TimedComponents
TimedConf* reseviorPump;
TimedConf* waterPump;
TimedConf* PP_1;
TimedConf* PP_2;
TimedConf* PP_3;
TimedConf* PP_4;
TimedConf* mixer;
Conf* heater;
Conf* fan;
// ScheduledComponents
ScheduledConf* light;
// Actions Conf
ScheduledConf* poll;
SensorConf* irrigation;
SensorConf* hvac;
Conf* illumination;
Context();
enum Constants
{
// Arduino Id
ARDUINO_ID = 2,
// Serial types
ON_OFF = 1,
POLL_RESULTS = 2,
ADMIN = 3,
// Component IDs. All component IDs start with 1000
RESEVIOR_PUMP_ID = 1000,
WATER_PUMP_ID = 1001,
PP1_ID = 1002,
PP2_ID = 1003,
PP3_ID = 1004,
PP4_ID = 1005,
MIXER_ID = 1006,
LIGHT_ID = 1007,
FAN_ID = 1008,
HEATER_ID = 1009,
// Action IDs. All action IDs start with 2000
POLL_ID = 2000,
IRRIGATE_ID = 2001,
ILLUMINATE_ID = 2002,
HVAC_ID = 2003,
// Sensor IDs. All sensor IDs start with 3000
MOISTURE_SENSOR_ID = 3000,
PHOTORESISTOR_ID = 3001,
TEMP_SENSOR_ID = 3002,
HUMIDITY_SENSOR_ID = 3003,
// Admin/Debug/Other IDs. All these IDs start with 4000
MEM_USAGE_ID = 4000,
// Configuration action types
CONF_MIN = 5000,
CONF_MAX = 5001,
CONF_TIME_ON = 5002,
CONF_TIME_OFF = 5003,
OVERRIDE_ON_OFF = 5004,
OVERRIDE_ON_FOR = 5005,
OVERRIDE_OFF_FOR = 5006,
OVERRIDE_SET_ACTION = 5007,
CONF_TOUCH = 5008
};
};
#endif