123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- #ifndef MC0051GS_H
- #define MC0051GS_H
- #include "comm.h"
- #include "sm.h"
- #include "plt.h"
- #define MC0051GS_NBR_MAX 4
- struct mc0051gs_t
- {
- char szinfo[32];
- int idx;
- char szdev_id[SNOW_ID_BUF_SIZE];
- struct comm_t comm;
- struct statemachine_t sm;
- int cmd;
- //0x0400
- int started;
- int runMode;
- char sys_run_mode_set[16];
- int ctlMode;
- char ctrMode_str[16];
- //0xA30B
- double cellt_max;
- double cellt_min;
- double cellt_ave;
- int cell_run;
- char cell_run_str[16];
- //0xE600
- double cool_temp; //制冷目标温度
- double heat_temp; //制热目标温度
- double cool_gap_temp; //制冷回差
- double heat_gap_temp; //制热回差
- int pump_gear;/*水泵档位*/
- int adr;
- int baud;
- int comp_gear;/*压缩机档位*/
- double cool_cell_temp; //制冷开启温度/*cell is working*/
- double cool_stop_cell_temp; //制冷关闭温度/*cell is working*/
- double heat_cell_temp; //加热开启温度/*cell is working*/
- double heat_stop_cell_temp; //加热关闭温度/*cell is working*/
- double cool_gap_cell_temp_noworking;/*在电池非运行状态时,制冷开启温度= 电芯温度制冷点+ 电池非运行模式制冷偏差温度*/
- double cell_self_cycle_start_diff_temp;/*电芯温度自循环启动差*/
- double cell_self_cycle_stop_diff_temp;/*电芯温度自循环启动差*/
- //0xE700
- double in_water_temp;
- double out_water_temp;
- double out_air_temp;
- double ev_temp;
- double in_water_press;
- double out_water_press;
- int out_water_high_temp_alarm;/*0 正常,1 告警,255告警未使能*/
- int out_water_low_temp_alarm;/*0 正常,1 告警,255告警未使能*/
- int out_temp_sensor_alarm;/*0 正常,1 告警,255告警未使能*/
- int in_temp_sensor_alarm;/*0 正常,1 告警,255告警未使能*/
- int pump_comm_alarm;/*0 正常,1 告警,255告警未使能*/
- int VFD_comm_alarm;/*0 正常,1 告警,255告警未使能*/
- int sys_high_voltage_lock;/*0 正常,1 锁定,255告警未使能*/
- int sys_low_voltage_lock;/*0 正常,1 锁定,255告警未使能*/
- int air_out_over_temp_lock;/*0 正常,1 锁定,255告警未使能*/
- int VFD_oc_lock;/*0 正常,1 锁定,255告警未使能*/
- int VFD_ot_lock;/*0 正常,1 锁定,255告警未使能*/
- int VFD_over_fre_lock;/*0 正常,1 锁定,255告警未使能*/
- int VFD_under_fre_lock;/*0 正常,1 锁定,255告警未使能*/
- int VFD_phase_lost_lock;/*0 正常,1 锁定,255告警未使能*/
- int VFD_other_fault_lock;/*0 正常,1 锁定,255告警未使能*/
- int alarm_level;
- char alarm_level_str[20];
- int elc_heat_state;
- int lack_liquid_alarm;/*0 正常,1 告警,255告警未使能*/
- int sys_pree_high_alarm;/*0 正常,1 告警,255告警未使能*/
- int out_water_press_high_alarm;/*0 正常,1 告警,255告警未使能*/
- double pump_speed;
- int pump_state;
- int heart;
- int comp_state;
- int comp_run_time;
- int comp_start_times;
- int elc_heat_run_time;
- int elc_heat_start_times;
- int pump_run_time;
- int pump_start_times;
- int outfan_run_time;
- int outfan_start_times;
- int sys_run_state;
- char sys_run_state_str[30];
- int pump_fault;
- int fan_drive_fault;
- int fan_drive_comm_fault;
- int upper_computer_comm_fault;
- int cellt_max_comm_fault;
- int cellt_min_comm_fault;
- int cellt_ave_comm_fault;
- int water_over_press;
- int water_under_press;
- int in_water_over_press_fault;
- int in_water_under_press_fault;
- int out_water_over_press_fault;
- int out_water_under_press_fault;
- };
- extern struct mc0051gs_t mc0051gs[MC0051GS_NBR_MAX + 1];
- int mc0051gs_init( void );
- int mc0051gs_get_state( int idx );
- char* mc0051gs_get_workstat_str(int idx);
- char* mc0051gs_get_infan_stat_str(int idx);
- char* mc0051gs_get_outfan_stat_str(int idx);
- int mc0051gs_get_workstat(int idx);
- int mc0051gs_get_infan_stat(int idx);
- int mc0051gs_get_outfan_stat(int idx);
- char* mc0051gs_get_cmp_stat_str(int idx);
- int mc0051gs_get_cmp_stat(int idx);
- int mc0051gs_get_rtnwind_temp(int idx);
- int mc0051gs_get_eva_temp(int idx);
- int mc0051gs_get_cond_temp(int idx);
- int mc0051gs_get_infan_spd(int idx);
- int mc0051gs_get_outfan_spd(int idx);
- int mc0051gs_send_sm_cmd( int idx, int cmd );
- int mc0051gs_get_addr( int idx );
- int mc0051gs_chk_state_all( int stat);
- int mc0051gs_send_sm_cmd_all( int cmd );
- int mc0051gs_set_dev_comp_start_temp(int idx, int val);
- int mc0051gs_set_dev_comp_gap_temp(int idx, int val);
- int mc0051gs_set_dev_heat_start_temp(int idx, int val);
- int mc0051gs_set_dev_heat_gap_temp(int idx, int val);
- int mc0051gs_get_cmd( int idx );
- void mc0051gs_reset_cmd(int idx);
- int mc0051gs_get_comm_st(int idx);
- int mc0051gs_get_chan_idx(int idx);
- char* mc0051gs_get_comm_st_str(int idx);
- int mc0051gs_get_tick(int idx);
- int mc0051gs_get_nbr();
- int mc0051gs_get_tool_data(int idx,char* buf);
- int mc0051gs_get_tbmqtt_data(int idx,char* buf);
- int mc0051gs_get_cloud_data(int ctn_idx,int idx,char* buf);
- int mc0051gs_get_bkds_data(int idx,char *buf);
- int mc0051gs_get_init_data(int ctn_idx, int idx, char *buf);
- int mc0051gs_get_modbus_data(int idx,unsigned short* data);
- #endif /* MC0051GS_H */
|