servicedatas.h 1.96 KB
#ifndef SERVICEDATAS_H
#define SERVICEDATAS_H

#include <stdint.h>
#include <time.h>

#define STRUCT_PACK     __attribute__ ((packed))

#define MAX_ERROR_TYPE_CNT  34

typedef struct _error_item{
    uint16_t fired_cnt;
    time_t first_fired;
    time_t last_fried;
}STRUCT_PACK error_item;


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;
            error_item upper_fire_alarm;
            error_item upper_pan_fail;
            error_item lower_fire_fail;
            error_item lower_fire_alarm;
            error_item lower_pan_fail;
            error_item steam_fire_fail;
            error_item steam_fire_alarm;
            error_item steam_pan_fail;
            error_item water_level_sensor_fail;
            error_item water_flow_sensor_fail;
            error_item inner_temp_fail;
            error_item inner_temp_high_alarm;
            error_item qunching_temp_fail;
            error_item meat_prove_temp1_fail;
            error_item meatprove_temp2_fail;
            error_item meatprove_temp3_fail;
            error_item meatprove_temp4_fail;
            error_item wall_temp1_fail;
            error_item wall_temp2_fail;
            error_item steam_gen_temp_fail;
            error_item pcb_temp_fail;
            error_item upper_motor_noncook_fail;
            error_item upper_motor_cook_fail;
            error_item lower_motor_noncook_fail;
            error_item lower_motor_cook_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;
        }items;
}STRUCT_PACK error_log;




class servicedatas
{
public:
    servicedatas();
    error_log err_log;
    bool saveServiceDatas(void);
    bool loadServiceDatas(void);
};

#endif // SERVICEDATAS_H