-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathActiveStatus.h
118 lines (98 loc) · 2.55 KB
/
ActiveStatus.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#ifndef ActiveStatus_h
#define ActiveStatus_h
#if defined(ESP8266)
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#elif defined(ESP_PLATFORM)
#include <WiFi.h>
#include <AsyncTCP.h>
#endif
#include <ESPAsyncWebServer.h>
#include <ArduinoJson.h>
#include <AsyncArduinoJson6.h>
#include <TimeLib.h>
#include <NtpClientLib.h>
#include <enum.h>
#include <enum.h>
#define PGM_P const char *
#define PGM_VOID_P const void *
#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
#define MAX_ACTIVESTATUS_SIZE 2024
#define ACTIVE_STATUS_FILE "/config/activeStatus.json"
class ActiveStatus
{
public:
ActiveStatus(FS *f);
~ActiveStatus();
int ActiveStep;
int LastActiveStep;
boolean BrewStarted;
String ActiveBoilStepIndex;
String ActiveBoilStepName;
int ActiveMashStepIndex;
String ActiveMashStepName;
String ActiveMashStepSufixName;
int BoilTime;
double PWM;
double PWMPercentage;
double SpargePWM;
double SpargePWMPercentage;
double BoilPWM;
double BoilPWMPercentage;
boolean PIDActing;
boolean StartBoilCounter;
double BoilTargetTemperature;
double BoilPowerPercentage;
double TargetTemperature;
double Temperature;
double BoilTemperature;
double SpargeTemperature;
double AuxOneTemperature;
double AuxTwoTemperature;
double AuxThreeTemperature;
bool EnableSparge;
bool EnableBoilKettle;
double SpargeTargetTemperature;
String MainSensor;
String SpargeSensor;
String BoilSensor;
String AuxOneSensor;
String AuxTwoSensor;
String AuxThreeSensor;
String Count;
time_t EndTime;
time_t StartTime;
time_t TimeNow;
boolean Recirculation;
boolean PIDTuning;
boolean PumpOn;
boolean PumpIsResting;
boolean PIDSettingsUpdated;
boolean TimeNotSet;
String TempUnit;
boolean HeaterOn;
boolean FullPower;
boolean StepLock;
boolean StepLocked;
boolean LoadActiveStatusSettings();
void SaveActiveStatus(time_t StartTime,
time_t EndTime,
time_t TimeNow,
float TargetTemperature,
int ActiveMashStepIndex,
String ActiveBoilStepIndex,
int boilTime,
float boilTargetTemperature,
int ActiveStep,
boolean brewStarted);
void SaveActiveStatus();
void SaveActiveStatusLoop();
void SetTemperature(Temperatures temps);
void SetJsonTemperatures(String json);
String GetJson();
void TimeNotSetted();
void TimeSetted();
private:
FS *_fs;
};
#endif