Blame view

app/gui/oven_control/servicedatas.h 5.98 KB
652e9cd54   고영탁   Merge
1
2
3
4
5
6
7
  #ifndef SERVICEDATAS_H
  #define SERVICEDATAS_H
  
  #include <stdint.h>
  #include <time.h>
  
  #define STRUCT_PACK     __attribute__ ((packed))
6a965b9f1   고영탁   엔지니어 모드 2차 구현
8
  #define MAX_ERROR_TYPE_CNT  31
c50beef02   고영탁   에러 처리 루틴 및 에러 처리 ...
9
10
  
  #define MAX_STATICS_CNT            23
652e9cd54   고영탁   Merge
11
6a965b9f1   고영탁   엔지니어 모드 2차 구현
12
  #define MAX_LOG_SENSOR          16
652e9cd54   고영탁   Merge
13
14
15
16
17
  typedef struct _error_item{
      uint16_t fired_cnt;
      time_t first_fired;
      time_t last_fried;
  }STRUCT_PACK error_item;
6a965b9f1   고영탁   엔지니어 모드 2차 구현
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
  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 datas[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;
652e9cd54   고영탁   Merge
51
52
53
54
55
56
57
  
  typedef union _error_log{
          uint8_t datas[MAX_ERROR_TYPE_CNT*sizeof(error_item)];
          error_item values[MAX_ERROR_TYPE_CNT];
          struct{
              error_item door;
              error_item upper_fire_fail;
652e9cd54   고영탁   Merge
58
59
              error_item upper_pan_fail;
              error_item lower_fire_fail;
652e9cd54   고영탁   Merge
60
61
              error_item lower_pan_fail;
              error_item steam_fire_fail;
652e9cd54   고영탁   Merge
62
63
64
              error_item steam_pan_fail;
              error_item water_level_sensor_fail;
              error_item water_flow_sensor_fail;
c50beef02   고영탁   에러 처리 루틴 및 에러 처리 ...
65
              error_item inner_temp_high_alarm;                   //B1 Sensor
652e9cd54   고영탁   Merge
66
              error_item inner_temp_fail;
c50beef02   고영탁   에러 처리 루틴 및 에러 처리 ...
67
              error_item qunching_temp_high_alarm;            //B2 Sensor
652e9cd54   고영탁   Merge
68
              error_item qunching_temp_fail;
c50beef02   고영탁   에러 처리 루틴 및 에러 처리 ...
69
70
71
              error_item meatprove_temp1_high_alarm;         //B3 Sensor
              error_item meatprove_temp1_fail;
              error_item wall_temp1_high_alarm;                   //B4 Sensor
652e9cd54   고영탁   Merge
72
              error_item wall_temp1_fail;
c50beef02   고영탁   에러 처리 루틴 및 에러 처리 ...
73
              error_item steam_gen_temp_high_alram;          //B5 Sensor
652e9cd54   고영탁   Merge
74
              error_item steam_gen_temp_fail;
c50beef02   고영탁   에러 처리 루틴 및 에러 처리 ...
75
76
77
78
              error_item meatprove_temp2_fail;
              error_item meatprove_temp3_fail;
              error_item meatprove_temp4_fail;            
              error_item pcb_temp_high_alarm;                         //PCB Temp
652e9cd54   고영탁   Merge
79
              error_item pcb_temp_fail;
c50beef02   고영탁   에러 처리 루틴 및 에러 처리 ...
80
81
              error_item upper_motor_fail;
              error_item lower_motor_fail;
652e9cd54   고영탁   Merge
82
83
              error_item small_motor_fail;
              error_item midd_motor_fail;
c50beef02   고영탁   에러 처리 루틴 및 에러 처리 ...
84
              error_item supply_motor_fail;                               // Steam Generator Tank Supply Pump
652e9cd54   고영탁   Merge
85
              error_item humidity_tamper_fail;
6a965b9f1   고영탁   엔지니어 모드 2차 구현
86
              error_item repeat_error;
652e9cd54   고영탁   Merge
87
88
          }items;
  }STRUCT_PACK error_log;
6a965b9f1   고영탁   엔지니어 모드 2차 구현
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
  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
  };
652e9cd54   고영탁   Merge
147
c50beef02   고영탁   에러 처리 루틴 및 에러 처리 ...
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
  typedef union _use_statics_log{
          uint8_t datas[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;
652e9cd54   고영탁   Merge
177
178
179
180
181
  
  class servicedatas
  {
  public:
      servicedatas();
6a965b9f1   고영탁   엔지니어 모드 2차 구현
182
652e9cd54   고영탁   Merge
183
      error_log err_log;
c50beef02   고영탁   에러 처리 루틴 및 에러 처리 ...
184
      use_statics_log use_log;
6a965b9f1   고영탁   엔지니어 모드 2차 구현
185
186
      sensor_statics_log sensor_log;
      uint16_t m_nRepeatErrorIdx;
652e9cd54   고영탁   Merge
187
188
189
190
191
      bool saveServiceDatas(void);
      bool loadServiceDatas(void);
  };
  
  #endif // SERVICEDATAS_H