-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTempDisplay.h
120 lines (89 loc) · 2.69 KB
/
TempDisplay.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
119
120
/*
Copyright (C) AC SOFTWARE SP. Z O.O.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef TempDisplay_h
#define TempDisplay_h
#include <Arduino.h>
#include <supla/sensor/thermometer.h>
#include <supla/storage/storage.h>
#include <supla/actions.h>
#include <supla/action_handler.h>
#include <supla/element.h>
#include <supla/local_action.h>
#include <supla/events.h>
#include <M5Dial.h>
namespace Supla {
namespace Sensor {
class SetDisplay : public Thermometer{//, public ActionHandler {
public:
//void handleAction(int event, int action);
virtual void stepUp() = 0;
virtual void stepDown() = 0;
};
class TempDisplay : public SetDisplay {
public:
TempDisplay(double dt_current, double dt_min, double dt_max, double dt_step);
double getValue();
double getMinValue();
double getMaxValue();
double getStepValue();
void onInit();
void onLoadState();
void onSaveState();
//void handleAction(int event, int action);
virtual void stepUp();
virtual void stepDown();
void setTemp(double dt_current);
protected:
double dt_min;
double dt_max;
double dt_step;
double dt_current;
};
class ProgDisplay : public SetDisplay {
public:
ProgDisplay(int dp_current, int dp_cnt, double *dpt);
double getValue();
void onInit();
void onLoadState();
void onSaveState();
//void handleAction(int event, int action);
virtual void stepUp();
virtual void stepDown();
virtual void setDP(int new_dp);
virtual int getDP();
virtual int getCount();
virtual int getPCount();
protected:
int dp_current;
int dp_cnt;
double *dpt;
};
class DisplayAH : public ActionHandler, public Element {
public:
DisplayAH(m5::M5_DIAL *dah_m5dial, bool *dah_switch);
void handleAction(int event, int action);
void iterateAlways();
protected:
bool *dah_switch = NULL;
long dah_timestamp = 0;
m5::M5_DIAL *dah_m5dial = NULL;
};
}; // namespace Sensor
}; // namespace Supla
extern long screen_saver_time;
extern bool nm_menu_redraw;
extern bool screen_saver_on;
extern m5::touch_state_t touch_prev_state;
#endif