Const.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #pragma once
  2. #ifndef __SAILING_CONST_H
  3. #define __SAILING_CONST_H
  4. #define DEBUG_SMS 0
  5. #define DEBUG_NOTICE 0
  6. #define DEBUG_HC_CARD 0
  7. #define DEBUG_UPS 0
  8. #define DEBUG_TEPW 0
  9. #define DEBUG_MAKEWATER 0
  10. #define DEBUG_AIRCONDITION_CM 0
  11. #define DEBUG_CFI 0
  12. #define DEBUG_KND 1
  13. #define DEBUG_UPS_APC_MGE 1
  14. #define DEBUG_AIRCONDITION_MCQUAY 0
  15. #define DEBUG_HG 0
  16. #define IS_USE_DOG 0
  17. #define FLOPW(ray,val) (ray)[0] = ((val)/256); (ray)[1] = ((val) & 0xFF)
  18. #define HG_BUFFER_LEN 80
  19. #define MAX_ADDR_NUM 128
  20. #define THREADSTOPWAITTIME 1000
  21. // Modbus Ascii 设备Dll错误代码定义
  22. enum __ERRO_CODE_MODBUS_ASC
  23. {
  24. ERR_CODE_MODBUS_ASC_COM_FAULT = 20001 , // Modbus asc设备串口通信故障
  25. ERR_CODE_MODBUS_ASC_COM_BUSY , // Modbus asc设备串口通信忙
  26. ERR_CODE_MODBUS_ASC_COM_READ_NO_DATA , // Modbus asc设备没有读到数据
  27. ERR_CODE_MODBUS_ASC_COM_READ_LEN_OVER , // Modbus asc设备读到数据长度超时限制
  28. ERR_CODE_MODBUS_ASC_COM_LRC_LOST , // Modbus asc设备lrc校验失败
  29. };
  30. //信息类型
  31. enum AlarmType
  32. {
  33. MSG_DATA_LOG = 0, //0:数据日志
  34. MSG_OK, //1:正确
  35. MSG_ERROR, //2:错误
  36. MSG_WARNING //3:警告
  37. };
  38. //功能模块类型
  39. enum ModuleType
  40. {
  41. MSG_MAIN_THREAD_MD = 0, //主线程
  42. MSG_DB_MD, //数据库操作模块
  43. MSG_EMAIL_MD, //email模块
  44. MSG_SMS_MD, //sms模块
  45. MSG_PING_MD, //ping模块
  46. MSG_TRAP_MD, //Trap模块
  47. MSG_SNMP_MD, //SNMP操作模块
  48. MSG_DOG_MD, //狗操作模块
  49. MSG_NOTICE_MD, //语音通知模块
  50. MSG_VIDEO_MD //视频模块
  51. };
  52. #define MAX_ERROR_LEN 500
  53. #define random(x) (rand()%x)
  54. #define MAX_COMM_NUM 128
  55. #define PATH_MAX 255
  56. #define MAX_THREAD_TIME 1000
  57. //缓冲区长度限制
  58. #define MAX_BOARDTYPE_LENGTH 50
  59. #define MAX_PROTOCOL_LENGTH 50
  60. #define MAX_BOARD_COUNT 10
  61. #define MAX_BOARD_CHANNEL_COUNT 120
  62. #define MAX_IVR_COUNT MAX_BOARD_COUNT * MAX_BOARD_CHANNEL_COUNT
  63. #define MAX_VOICE_COUNT 100
  64. #define MAX_TEL_LENGTH 20
  65. #define MAX_EMAIL_LENGTH 30
  66. #define MAX_DTMF_LENGTH 30
  67. #define MAX_FSK_LENGTH MAX_PATH
  68. #define MAX_PATH_LENGTH MAX_PATH
  69. #define MAX_FILE_LENGTH MAX_PATH
  70. #define MAX_LIST_LENGTH 10240
  71. #define MAX_DIGIT_LENGTH 30
  72. #define MAX_MSGNO_LENGTH 4
  73. #define MAX_MSG_LENGTH 1024 * 4
  74. #define MAX_STATUS_LENGTH 50
  75. #define MAX_RESULT_LENGTH 50
  76. #define MAX_FUNC_LENGTH 4
  77. #define MAX_CHANNELID_LENGTH 10
  78. #define MAX_VARNAME_LENGTH 100
  79. #define MAX_VARVALUE_LENGTH 1024
  80. #define MAX_VAR_COUNT 100
  81. #define MAX_VARSYS_COUNT 30
  82. #define MAX_LABLE_COUNT 100
  83. #define MAX_CASE_COUNT 100
  84. #define MAX_LINE_COUNT 1024
  85. #define MAX_LINE_LENGTH 1024
  86. #define MAX_REPLAY_TIME 3
  87. #define MAX_FIRST_TIME 3
  88. #define MAX_INTER_TIME 3
  89. #define MAX_TIME_LENGTH 20
  90. #define MAX_DESCRIPTION_LENGTH 50
  91. #define MAX_BOX_LENGTH 10
  92. #define MAX_VALUE_LENGTH 100
  93. #define MAX_DBVALUE_LENGTH 1024
  94. #define MAX_EMPLOYEENO_LENGTH 10
  95. #define MAX_NAME_LENGTH 100
  96. #define MAX_FAXNO_LENGTH 20
  97. #define MAX_REMARKS_LENGTH 100
  98. #define MAX_SQL_LENGTH 1024*1//1024 * 10
  99. #define MAX_PLAY_LENGTH 100
  100. #define MAX_LANG_LENGTH 100
  101. #define MAX_VOL_LENGTH 20
  102. #define MAX_IA_LENGTH 20
  103. //DB字段长度限制
  104. #define MAX_EQUIP_TYPE 40
  105. #define MAX_EQUIP_IP 50
  106. #define MAX_EQUIP_DESC 255
  107. #define MAX_EQUIP_ADDR 5
  108. #define MAX_COMM_PORT 5
  109. #define MAX_OBJ_OID 100
  110. #define MAX_SENSOR_TYPE 40
  111. #define MAX_SENSOR_DESC 255
  112. #define MAX_SENSOR_CURR 10
  113. #define MAX_SENSOR_STATUS 5
  114. #define MAX_SENSOR_PORT 5
  115. #define MAX_LEF_POS 10
  116. #define MAX_BG_DESC 255
  117. #define MAX_RATE 10
  118. #define MAX_SENSOR_UNIT 10
  119. #define MAX_SENSOR_UNIT_TYPE 5
  120. #define MAX_OFFSET 10
  121. #define MAX_REARM 10
  122. #define MAX_ID 10
  123. #define MAX_DOUBLE_DATA 50
  124. #define MAX_PURVIEW_NAME 255
  125. #define MAX_SET_POINT 10
  126. //Email
  127. #define MAX_MAILSERVER_LENGTH 50
  128. #define MAX_MAILFROM_LENGTH 100
  129. #define MAX_MAILTO_LENGTH 100
  130. #define MAX_MAILSUBJECT_LENGTH 100
  131. #define MAX_MAILBODY_LENGTH 500
  132. #define MAX_MALIACCOUNT_LENGTH 100
  133. #define MAX_MAILPASSWORD_LENGTH 50
  134. #define MAX_EMAIL_QUEUE_NUM 100
  135. //Sms
  136. #define MAX_SMS_QUEUE_NUM 100
  137. //语音通知
  138. #define MAX_NOTICE_QUEUE_NUM 100
  139. //ConfirmSensor
  140. #define MAX_CONFIRM_SENSOR_NUM 100
  141. //Database
  142. #define MAX_SERVER_LENGTH 50
  143. #define MAX_DATABASE_LENGTH 50
  144. #define MAX_USER_LENGTH 50
  145. #define MAX_PASSWORD_LENGTH 64
  146. // 常量
  147. // 联合类型变量ID范围
  148. const UNION_TYPE_MIN_ID = 100;
  149. const UNION_TYPE_MAX_ID = 120;
  150. #endif