#ifndef __TONGFEI_H__ #define __TONGFEI_H__ #include "comm.h" #include "sm.h" #include "plt.h" #define TF_NBR_MAX 4 struct tongfei_t { char szinfo[32]; int idx; char szdev_id[SNOW_ID_BUF_SIZE]; struct comm_t comm; struct statemachine_t sm; int cmd; //0x0000 int run_statue; //运行状态,0空闲 1准备启动 2运行 3 延时停机 4 故障 char run_state_str[30]; int io_in; int io_out; double in_water_temp; //进水口温度 double out_water_temp; //出水口温度 double in_evaporation_temp;//蒸发入口温度 double out_evaporation_temp;//蒸发入口温度 double ev_temp; //环境温度 int expansion_valve_degree; //节流膨胀阀当前开度 double in_water_press; //进水口压力 double out_water_press; //出水口压力 int Err_1; int Err_2; int Err_3; int Err_4; int FrequencyChangerErr; // 0x1000 int runMode;//1制冷 2加热 3自循环 4自动 char runMode_str[16]; int ctlMode; char ctrMode_str[16]; int settiing_temp; //预设温度 /* param set */ int cool_start_temp; int cool_stop_temp; int heat_start_temp; int heat_stop_temp; }; extern struct tongfei_t tf[TF_NBR_MAX + 1]; int tongfei_init( void ); int tongfei_get_state( int idx ); int tongfei_send_sm_cmd( int idx, int cmd ); int tongfei_get_addr( int idx ); int tongfei_chk_state_all( int stat); int tongfei_send_sm_cmd_all( int cmd ); int tongfei_get_cmd( int idx ); void tongfei_reset_cmd(int idx); int tongfei_get_comm_st(int idx); int tongfei_get_chan_idx(int idx); char* tongfei_get_comm_st_str(int idx); int tongfei_get_tick(int idx); int tongfei_get_nbr(); int tongfei_get_tool_data(int idx,char* buf); int tongfei_get_tbmqtt_data(int idx,char* buf); int tongfei_get_cloud_data(int ctn_idx,int idx,char* buf); int tongfei_get_bkds_data(int idx,char *buf); int tongfei_get_init_data(int ctn_idx, int idx, char *buf); int tongfei_get_modbus_data(int idx,unsigned short* data); int tongfei_set_cool_start_temp(int idx, int val); int tongfei_set_cool_stop_temp(int idx, int val); int tongfei_set_heat_start_temp(int idx, int val); int tongfei_set_heat_stop_temp(int idx, int val); #endif