mc0051gs.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #ifndef MC0051GS_H
  2. #define MC0051GS_H
  3. #include "comm.h"
  4. #include "sm.h"
  5. #include "plt.h"
  6. #define MC0051GS_NBR_MAX 4
  7. struct mc0051gs_t
  8. {
  9. char szinfo[32];
  10. int idx;
  11. char szdev_id[SNOW_ID_BUF_SIZE];
  12. struct comm_t comm;
  13. struct statemachine_t sm;
  14. int cmd;
  15. //0x0400
  16. int started;
  17. int runMode;
  18. char sys_run_mode_set[16];
  19. int ctlMode;
  20. char ctrMode_str[16];
  21. //0xA30B
  22. double cellt_max;
  23. double cellt_min;
  24. double cellt_ave;
  25. int cell_run;
  26. char cell_run_str[16];
  27. //0xE600
  28. double cool_temp; //制冷目标温度
  29. double heat_temp; //制热目标温度
  30. double cool_gap_temp; //制冷回差
  31. double heat_gap_temp; //制热回差
  32. int pump_gear;/*水泵档位*/
  33. int adr;
  34. int baud;
  35. int comp_gear;/*压缩机档位*/
  36. double cool_cell_temp; //制冷开启温度/*cell is working*/
  37. double cool_stop_cell_temp; //制冷关闭温度/*cell is working*/
  38. double heat_cell_temp; //加热开启温度/*cell is working*/
  39. double heat_stop_cell_temp; //加热关闭温度/*cell is working*/
  40. double cool_gap_cell_temp_noworking;/*在电池非运行状态时,制冷开启温度= 电芯温度制冷点+ 电池非运行模式制冷偏差温度*/
  41. double cell_self_cycle_start_diff_temp;/*电芯温度自循环启动差*/
  42. double cell_self_cycle_stop_diff_temp;/*电芯温度自循环启动差*/
  43. //0xE700
  44. double in_water_temp;
  45. double out_water_temp;
  46. double out_air_temp;
  47. double ev_temp;
  48. double in_water_press;
  49. double out_water_press;
  50. int out_water_high_temp_alarm;/*0 正常,1 告警,255告警未使能*/
  51. int out_water_low_temp_alarm;/*0 正常,1 告警,255告警未使能*/
  52. int out_temp_sensor_alarm;/*0 正常,1 告警,255告警未使能*/
  53. int in_temp_sensor_alarm;/*0 正常,1 告警,255告警未使能*/
  54. int pump_comm_alarm;/*0 正常,1 告警,255告警未使能*/
  55. int VFD_comm_alarm;/*0 正常,1 告警,255告警未使能*/
  56. int sys_high_voltage_lock;/*0 正常,1 锁定,255告警未使能*/
  57. int sys_low_voltage_lock;/*0 正常,1 锁定,255告警未使能*/
  58. int air_out_over_temp_lock;/*0 正常,1 锁定,255告警未使能*/
  59. int VFD_oc_lock;/*0 正常,1 锁定,255告警未使能*/
  60. int VFD_ot_lock;/*0 正常,1 锁定,255告警未使能*/
  61. int VFD_over_fre_lock;/*0 正常,1 锁定,255告警未使能*/
  62. int VFD_under_fre_lock;/*0 正常,1 锁定,255告警未使能*/
  63. int VFD_phase_lost_lock;/*0 正常,1 锁定,255告警未使能*/
  64. int VFD_other_fault_lock;/*0 正常,1 锁定,255告警未使能*/
  65. int alarm_level;
  66. char alarm_level_str[20];
  67. int elc_heat_state;
  68. int lack_liquid_alarm;/*0 正常,1 告警,255告警未使能*/
  69. int sys_pree_high_alarm;/*0 正常,1 告警,255告警未使能*/
  70. int out_water_press_high_alarm;/*0 正常,1 告警,255告警未使能*/
  71. double pump_speed;
  72. int pump_state;
  73. int heart;
  74. int comp_state;
  75. int comp_run_time;
  76. int comp_start_times;
  77. int elc_heat_run_time;
  78. int elc_heat_start_times;
  79. int pump_run_time;
  80. int pump_start_times;
  81. int outfan_run_time;
  82. int outfan_start_times;
  83. int sys_run_state;
  84. char sys_run_state_str[30];
  85. int pump_fault;
  86. int fan_drive_fault;
  87. int fan_drive_comm_fault;
  88. int upper_computer_comm_fault;
  89. int cellt_max_comm_fault;
  90. int cellt_min_comm_fault;
  91. int cellt_ave_comm_fault;
  92. int water_over_press;
  93. int water_under_press;
  94. int in_water_over_press_fault;
  95. int in_water_under_press_fault;
  96. int out_water_over_press_fault;
  97. int out_water_under_press_fault;
  98. };
  99. extern struct mc0051gs_t mc0051gs[MC0051GS_NBR_MAX + 1];
  100. int mc0051gs_init( void );
  101. int mc0051gs_get_state( int idx );
  102. char* mc0051gs_get_workstat_str(int idx);
  103. char* mc0051gs_get_infan_stat_str(int idx);
  104. char* mc0051gs_get_outfan_stat_str(int idx);
  105. int mc0051gs_get_workstat(int idx);
  106. int mc0051gs_get_infan_stat(int idx);
  107. int mc0051gs_get_outfan_stat(int idx);
  108. char* mc0051gs_get_cmp_stat_str(int idx);
  109. int mc0051gs_get_cmp_stat(int idx);
  110. int mc0051gs_get_rtnwind_temp(int idx);
  111. int mc0051gs_get_eva_temp(int idx);
  112. int mc0051gs_get_cond_temp(int idx);
  113. int mc0051gs_get_infan_spd(int idx);
  114. int mc0051gs_get_outfan_spd(int idx);
  115. int mc0051gs_send_sm_cmd( int idx, int cmd );
  116. int mc0051gs_get_addr( int idx );
  117. int mc0051gs_chk_state_all( int stat);
  118. int mc0051gs_send_sm_cmd_all( int cmd );
  119. int mc0051gs_set_dev_comp_start_temp(int idx, int val);
  120. int mc0051gs_set_dev_comp_gap_temp(int idx, int val);
  121. int mc0051gs_set_dev_heat_start_temp(int idx, int val);
  122. int mc0051gs_set_dev_heat_gap_temp(int idx, int val);
  123. int mc0051gs_get_cmd( int idx );
  124. void mc0051gs_reset_cmd(int idx);
  125. int mc0051gs_get_comm_st(int idx);
  126. int mc0051gs_get_chan_idx(int idx);
  127. char* mc0051gs_get_comm_st_str(int idx);
  128. int mc0051gs_get_tick(int idx);
  129. int mc0051gs_get_nbr();
  130. int mc0051gs_get_tool_data(int idx,char* buf);
  131. int mc0051gs_get_tbmqtt_data(int idx,char* buf);
  132. int mc0051gs_get_cloud_data(int ctn_idx,int idx,char* buf);
  133. int mc0051gs_get_bkds_data(int idx,char *buf);
  134. int mc0051gs_get_init_data(int ctn_idx, int idx, char *buf);
  135. int mc0051gs_get_modbus_data(int idx,unsigned short* data);
  136. #endif /* MC0051GS_H */