servicedata.h
6.01 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#ifndef SERVICEDATA_H
#define SERVICEDATA_H
#include <stdint.h>
#include <time.h>
#define STRUCT_PACK __attribute__ ((packed))
#define MAX_ERROR_TYPE_CNT 31
#define MAX_STATICS_CNT 23
#define MAX_LOG_SENSOR 16
typedef struct _error_item{
uint16_t fired_cnt;
time_t first_fired;
time_t last_fried;
}STRUCT_PACK error_item;
typedef union{
int16_t itemp;
uint16_t utemp;
}type_temp;
typedef struct _sensor_log_item{
type_temp high_temp;
time_t last_high_time;
}STRUCT_PACK sensor_log_item;
typedef union _sensor_statics_log{
uint8_t data[MAX_LOG_SENSOR * sizeof(sensor_log_item)];
sensor_log_item values[MAX_LOG_SENSOR];
struct{
sensor_log_item B1;
sensor_log_item B2;
sensor_log_item Reserved1;
sensor_log_item B4;
sensor_log_item B5;
sensor_log_item B3_1;
sensor_log_item B3_2;
sensor_log_item B3_3;
sensor_log_item B3_4;
sensor_log_item Reserved2; //10
sensor_log_item mbar1;
sensor_log_item mbar2;
sensor_log_item pcb;
sensor_log_item adc;
sensor_log_item convec_fan_rpm;
sensor_log_item bunner_rpm;
}items;
}STRUCT_PACK sensor_statics_log;
typedef union _error_log{
uint8_t data[MAX_ERROR_TYPE_CNT*sizeof(error_item)];
error_item values[MAX_ERROR_TYPE_CNT];
struct{
error_item door;
error_item upper_fire_fail;
error_item upper_pan_fail;
error_item lower_fire_fail;
error_item lower_pan_fail;
error_item steam_fire_fail;
error_item steam_pan_fail;
error_item water_level_sensor_fail;
error_item water_flow_sensor_fail;
error_item inner_temp_high_alarm; //B1 Sensor
error_item inner_temp_fail;
error_item qunching_temp_high_alarm; //B2 Sensor
error_item qunching_temp_fail;
error_item meatprove_temp1_high_alarm; //B3 Sensor
error_item meatprove_temp1_fail;
error_item wall_temp1_high_alarm; //B4 Sensor
error_item wall_temp1_fail;
error_item steam_gen_temp_high_alram; //B5 Sensor
error_item steam_gen_temp_fail;
error_item meatprove_temp2_fail;
error_item meatprove_temp3_fail;
error_item meatprove_temp4_fail;
error_item pcb_temp_high_alarm; //PCB Temp
error_item pcb_temp_fail;
error_item upper_motor_fail;
error_item lower_motor_fail;
error_item small_motor_fail;
error_item midd_motor_fail;
error_item supply_motor_fail; // Steam Generator Tank Supply Pump
error_item humidity_tamper_fail;
error_item repeat_error;
}items;
}STRUCT_PACK error_log;
enum ERROR_ITEM_IDX{
ERROR_IDX_door=0,
ERROR_IDX_upper_fire_fail,
ERROR_IDX_upper_pan_fail,
ERROR_IDX_lower_fire_fail,
ERROR_IDX_lower_pan_fail,
ERROR_IDX_steam_fire_fail,
ERROR_IDX_steam_pan_fail,
ERROR_IDX_water_level_sensor_fail,
ERROR_IDX_water_flow_sensor_fail,
ERROR_IDX_inner_temp_high_alarm, //B1 Sensor
ERROR_IDX_inner_temp_fail,
ERROR_IDX_qunching_temp_high_alarm, //B2 Sensor
ERROR_IDX_qunching_temp_fail,
ERROR_IDX_meatprove_temp1_high_alarm, //B3 Sensor
ERROR_IDX_meatprove_temp1_fail,
ERROR_IDX_wall_temp1_high_alarm, //B4 Sensor
ERROR_IDX_wall_temp1_fail,
ERROR_IDX_steam_gen_temp_high_alram, //B5 Sensor
ERROR_IDX_steam_gen_temp_fail,
ERROR_IDX_meatprove_temp2_fail,
ERROR_IDX_meatprove_temp3_fail,
ERROR_IDX_meatprove_temp4_fail,
ERROR_IDX_pcb_temp_high_alarm, //PCB Temp
ERROR_IDX_pcb_temp_fail,
ERROR_IDX_upper_motor_fail,
ERROR_IDX_lower_motor_fail,
ERROR_IDX_small_motor_fail,
ERROR_IDX_midd_motor_fail,
ERROR_IDX_supply_motor_fail, // Steam Generator Tank Supply Pump
ERROR_IDX_humidity_tamper_fail
};
enum USE_ITEMS_IDX{
USE_ITEM_steam_heat=0,
USE_ITEM_dry_heat,
USE_ITEM_upper_heat,
USE_ITEM_lower_heat,
USE_ITEM_cook_dry_mode,
USE_ITEM_cook_steam_mode,
USE_ITEM_cook_combi_mode,
USE_ITEM_wash_mode_nocleanser,
USE_ITEM_wash_mode_simple,
USE_ITEM_wash_mode_standard,
USE_ITEM_wash_mode_strong,
USE_ITEM_wash_mode_speed,
USE_ITEM_cooldown_mode,
USE_ITEM_door_open,
USE_ITEM_dv_open,
USE_ITEM_ssv_open,
USE_ITEM_qnv_open,
USE_ITEM_ssp_open,
USE_ITEM_snv_open,
USE_ITEM_hosereel,
USE_ITEM_hdm_open,
USE_ITEM_dp_open,
USE_ITEM_unp_open
};
typedef union _use_statics_log{
uint8_t data[MAX_STATICS_CNT*4];
uint32_t values[MAX_STATICS_CNT];
struct{
uint32_t steam_heat;
uint32_t dry_heat;
uint32_t upper_heat;
uint32_t lower_heat;
uint32_t cook_dry_mode;
uint32_t cook_steam_mode;
uint32_t cook_combi_mode;
uint32_t wash_mode_nocleanser;
uint32_t wash_mode_simple;
uint32_t wash_mode_standard;
uint32_t wash_mode_strong;
uint32_t wash_mode_speed;
uint32_t cooldown_mode;
uint32_t door_open;
uint32_t dv_open;
uint32_t ssv_open;
uint32_t qnv_open;
uint32_t ssp_open;
uint32_t snv_open;
uint32_t hosereel;
uint32_t hdm_open;
uint32_t dp_open;
uint32_t unp_open;
}items;
}STRUCT_PACK use_statics_log;
class ServiceData
{
public:
ServiceData();
error_log err_log;
use_statics_log use_log;
sensor_statics_log sensor_log;
uint16_t m_nRepeatErrorIdx;
bool saveServiceData(void);
bool loadServiceData(void);
bool resetSensorlogData(void);
};
#endif // SERVICEDATA_H