ZLOpdProtCMDEnum.java 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. package com.hb.proj.gather.protocol;
  2. /**
  3. * 数据读取指令 枚举类
  4. * @author cwen
  5. *
  6. */
  7. public enum ZLOpdProtCMDEnum {
  8. //20[应返回数据区字节数] 一次读取到油压、套压、回压、井口温度、载荷 01 03 01 2c 00 0a 校验位两字节 应返回字节数 每个数据项字节数 参数编码表
  9. PRESS_TEMP_LOAD(
  10. new byte[] {0x01, 0x03, 0x01, 0x2c, 0x00, 0x0a, 0x05, (byte)0xf8},
  11. 0x14,
  12. 4,
  13. new String[]{"oil_press","casing_press","back_press","well_head_temp","load"}),
  14. //48 电机电流A、B、C,电压A、B、C,有功功耗,无功功耗,有功功率,无功功率,反向功率,功率因数 01 03 01 5f 00 18
  15. CURR_VOL_LOS_PW(
  16. new byte[] {0x01, 0x03, 0x01, 0x5f, 0x00, 0x18, 0x74, (byte)0x2e},
  17. 0x30,
  18. 4,
  19. new String[]{"current_a","current_b","current_c","voltage_a","voltage_b","voltage_c","useful_power_loss","unuseful_power_loss","useful_power","unuseful_power","reverse_power","power_factor"}),
  20. //8 冲次、冲程 01 03 01 a4 00 04
  21. FREQ_STROKE(
  22. new byte[] {0x01, 0x03, 0x01, (byte)0xa4, 0x00, 0x04, 0x04, 0x16},
  23. 0x08,
  24. 4,
  25. new String[]{"freq","stroke"}),
  26. //2 功图实际点数 01 03 03 d7 00 01
  27. DIAGRAM_POINT_COUNT(
  28. new byte[] {0x01, 0x03, 0x03, (byte)0xd7, 0x00, 0x01, 0x34, 0x76},
  29. 0x02,
  30. 2,
  31. new String[]{"diagram_point"}),
  32. //196-98功图位移第1部分 01 03 03 e8 00 62
  33. DIAGRAM_DISP_1(
  34. new byte[] {0x01, 0x03, 0x03, (byte)0xe8, 0x00, 0x62, (byte)0x44, 0x53},
  35. 0xc4,
  36. 2,
  37. new String[]{"disp_1"}),
  38. //200-100 功图位移第2部分 01 03 04 4a 00 64
  39. DIAGRAM_DISP_2(
  40. new byte[] {0x01, 0x03, 0x04, 0x4a, 0x00, 0x64, 0x64, (byte)0xc7},
  41. 0xc8,
  42. 2,
  43. new String[]{"disp_2"}),
  44. //104-52 功图位移第3部分 01 03 04 ae 00 34
  45. DIAGRAM_DISP_3(
  46. new byte[] {0x01, 0x03, 0x04, (byte)0xae, 0x00, 0x34, 0x24, (byte)0xcc},
  47. 0x68,
  48. 2,
  49. new String[]{"disp_3"}),
  50. //192-96 功图载荷第1部分 01 03 04 e2 00 60 01 03 05 42 00 5a 01 03 05 9c 00 40
  51. DIAGRAM_LOAD_1(
  52. new byte[] {0x01, 0x03, 0x04, (byte)0xe2, 0x00, 0x60, (byte)0xe4, (byte)0xe4},
  53. 0xc0,
  54. 2,
  55. new String[]{"chartload_1"}),
  56. //180-90 功图载荷第2部分 01 03 05 42 00 5a
  57. DIAGRAM_LOAD_2(
  58. new byte[] {0x01, 0x03, 0x05, 0x42, 0x00, 0x5a, 0x65, 0x29},
  59. 0xb4,
  60. 2,
  61. new String[]{"chartload_2"}),
  62. //128-64 功图载荷第3部分 01 03 05 9c 00 40
  63. DIAGRAM_LOAD_3(
  64. new byte[] {0x01, 0x03, 0x05, (byte)0x9c, 0x00, 0x40, (byte)0x84, (byte)0xd8},
  65. 0x80,
  66. 2,
  67. new String[]{"chartload_3"}),
  68. //188-94 电流图电流第1部分 01 03 05 dc 00 5e 01 03 06 3a 00 58 01 03 06 92 00 44
  69. DIAGRAM_CURR_1(
  70. new byte[] {0x01, 0x03, 0x05, (byte)0xdc, 0x00, 0x5e, 0x05, 0x04},
  71. 0xbc,
  72. 2,
  73. new String[]{"chartcurr_1"}),
  74. //176-88 电流图电流第2部分 01 03 06 3a 00 58
  75. DIAGRAM_CURR_2(
  76. new byte[] {0x01, 0x03, 0x06, 0x3a, 0x00, 0x58, 0x64, (byte)0xb5},
  77. 0xb0,
  78. 2,
  79. new String[]{"chartcurr_2"}),
  80. //136-68 电流图电流第3部分 01 03 06 92 00 44
  81. DIAGRAM_CURR_3(
  82. new byte[] {0x01, 0x03, 0x06, (byte)0x92, 0x00, 0x44, (byte)0xe4, (byte)0x9c},
  83. 0x88,
  84. 2,
  85. new String[]{"chartcurr_3"}),
  86. //184-92 功率图功率第1部分 01 03 06 d6 00 5c 01 03 07 32 00 56 01 03 07 88 00 48
  87. DIAGRAM_POWER_1(
  88. new byte[] {0x01, 0x03, 0x06, (byte)0xd6, 0x00, 0x5c, (byte)0xa4, (byte)0x83},
  89. 0xb8,
  90. 2,
  91. new String[]{"chartpower_1"}),
  92. //172-86 功率图功率第2部分 01 03 07 32 00 56
  93. DIAGRAM_POWER_2(
  94. new byte[] {0x01, 0x03, 0x07, 0x32, 0x00, 0x56, 0x65, 0x4f},
  95. 0xac,
  96. 2,
  97. new String[]{"chartpower_2"}),
  98. //144-72 功率图功率第3部分 01 03 07 88 00 48
  99. DIAGRAM_POWER_3(
  100. new byte[] {0x01, 0x03, 0x07, (byte)0x88, 0x00, 0x48, (byte)0xc4, (byte)0xa2},
  101. 0x90,
  102. 2,
  103. new String[]{"chartpower_3"}),
  104. //18-9 动液面其它参数采集(测量时间、音速、测量深度、套压) 01 03 18 00 00 09
  105. LIQUID_OTHER(
  106. new byte[] {0x01, 0x03, 0x18, 0x00, 0x00, 0x09, (byte)0x83, 0x6c},
  107. 0x12,
  108. 2,
  109. new String[]{"test_time_yy","test_time_mm","test_time_dd","test_time_hr","test_time_mi","test_time_ss","sound_speed","test_depth","casing_pre"}
  110. ),
  111. //250-125 动液面曲线数据(1/40)
  112. LIQUID_SERIAL_1(
  113. new byte[] {0x01,0x03,0x18,0x10,0x00,0x7d,(byte)0x82,(byte)0x8e},
  114. 0xfa,
  115. 1,
  116. new String[] {"serial_1"}
  117. ),
  118. LIQUID_SERIAL_2(
  119. new byte[] {0x01,0x03,0x18,(byte)0x8D,0x00,0x7d,0x13,0x60},
  120. 0xfa,
  121. 1,
  122. new String[] {"serial_2"}
  123. ),
  124. LIQUID_SERIAL_3(
  125. new byte[] {0x01,0x03,0x19,0x0A,0x00,0x7d,(byte)0xa2,(byte)0xb5},
  126. 0xfa,
  127. 1,
  128. new String[] {"serial_3"}
  129. ),
  130. LIQUID_SERIAL_4(
  131. new byte[] {0x01,0x03,0x19,(byte)0x87,0x00,0x7d,0x32,(byte)0x9e},
  132. 0xfa,
  133. 1,
  134. new String[] {"serial_4"}
  135. ),
  136. LIQUID_SERIAL_5(
  137. new byte[] {0x01,0x03,0x1A,0x04,0x00,0x7d,(byte)0xc3,0x32},
  138. 0xfa,
  139. 1,
  140. new String[] {"serial_5"}
  141. ),
  142. LIQUID_SERIAL_6(
  143. new byte[] {0x01,0x03,0x1A,(byte)0x81,0x00,0x7d,(byte)0xd2,(byte)0xdb},
  144. 0xfa,
  145. 1,
  146. new String[] {"serial_6"}
  147. ),
  148. LIQUID_SERIAL_7(
  149. new byte[] {0x01,0x03,0x1A,(byte)0xFE,0x00,0x7d,(byte)0xe3,0x03},
  150. 0xfa,
  151. 1,
  152. new String[] {"serial_7"}
  153. ),
  154. LIQUID_SERIAL_8(
  155. new byte[] {0x01,0x03,0x1B,0x7B,0x00,0x7d,(byte)0xf3,0x16},
  156. 0xfa,
  157. 1,
  158. new String[] {"serial_8"}
  159. ),
  160. LIQUID_SERIAL_9(
  161. new byte[] {0x01,0x03,0x1B,(byte)0xF8,0x00,0x7d},
  162. 0xfa,
  163. 1,
  164. new String[] {"serial_9"}
  165. ),
  166. LIQUID_SERIAL_10(
  167. new byte[] {0x01,0x03,0x1C,0x75,0x00,0x7d,(byte)0x93,(byte)0xa1},
  168. 0xfa,
  169. 1,
  170. new String[] {"serial_10"}
  171. ),
  172. LIQUID_SERIAL_11(
  173. new byte[] {0x01,0x03,0x1C,(byte)0xF2,0x00,0x7d,0x23,(byte)0x88},
  174. 0xfa,
  175. 1,
  176. new String[] {"serial_11"}
  177. ),
  178. LIQUID_SERIAL_12(
  179. new byte[] {0x01,0x03,0x1D,0x6F,0x00,0x7d,(byte)0xb3,(byte)0x9a},
  180. 0xfa,
  181. 1,
  182. new String[] {"serial_12"}
  183. ),
  184. LIQUID_SERIAL_13(
  185. new byte[] {0x01,0x03,0x1D,(byte)0xEC,0x00,0x7d,0x42,0x72},
  186. 0xfa,
  187. 1,
  188. new String[] {"serial_13"}
  189. ),
  190. LIQUID_SERIAL_14(
  191. new byte[] {0x01,0x03,0x1E,0x69,0x00,0x7d,0x53,(byte)0xdf},
  192. 0xfa,
  193. 1,
  194. new String[] {"serial_14"}
  195. ),
  196. LIQUID_SERIAL_15(
  197. new byte[] {0x01,0x03,0x1E,(byte)0xE6,0x00,0x7d,0x62,0x34},
  198. 0xfa,
  199. 1,
  200. new String[] {"serial_15"}
  201. ),
  202. LIQUID_SERIAL_16(
  203. new byte[] {0x01,0x03,0x1F,0x63,0x00,0x7d,0x72,0x21},
  204. 0xfa,
  205. 1,
  206. new String[] {"serial_16"}
  207. ),
  208. LIQUID_SERIAL_17(
  209. new byte[] {0x01,0x03,0x1F,(byte)0xE0,0x00,0x7d,(byte)0x83,(byte)0xc9},
  210. 0xfa,
  211. 1,
  212. new String[] {"serial_17"}
  213. ),
  214. LIQUID_SERIAL_18(
  215. new byte[] {0x01,0x03,0x20,0x5D,0x00,0x7d,0x1f,(byte)0xf9},
  216. 0xfa,
  217. 1,
  218. new String[] {"serial_18"}
  219. ),
  220. LIQUID_SERIAL_19(
  221. new byte[] {0x01,0x03,0x20,(byte)0xDA,0x00,0x7d,(byte)0xaf,(byte)0xd0},
  222. 0xfa,
  223. 1,
  224. new String[] {"serial_19"}
  225. ),
  226. LIQUID_SERIAL_20(
  227. new byte[] {0x01,0x03,0x21,0x57,0x00,0x7d,0x3e,0x07},
  228. 0xfa,
  229. 1,
  230. new String[] {"serial_20"}
  231. ),
  232. LIQUID_SERIAL_21(
  233. new byte[] {0x01,0x03,0x21,(byte)0xD4,0x00,0x7d,(byte)0xcf,(byte)0xef},
  234. 0xfa,
  235. 1,
  236. new String[] {"serial_21"}
  237. ),
  238. LIQUID_SERIAL_22(
  239. new byte[] {0x01,0x03,0x22,0x51,0x00,0x7d,(byte)0xde,0x42},
  240. 0xfa,
  241. 1,
  242. new String[] {"serial_22"}
  243. ),
  244. LIQUID_SERIAL_23(
  245. new byte[] {0x01,0x03,0x22,(byte)0xCE,0x00,0x7d,(byte)0xee,0x6c},
  246. 0xfa,
  247. 1,
  248. new String[] {"serial_23"}
  249. ),
  250. LIQUID_SERIAL_24(
  251. new byte[] {0x01,0x03,0x23,0x4B,0x00,0x7d,(byte)0xfe,0x79},
  252. 0xfa,
  253. 1,
  254. new String[] {"serial_24"}
  255. ),
  256. LIQUID_SERIAL_25(
  257. new byte[] {0x01,0x03,0x23,(byte)0xC8,0x00,0x7d,0x0f,(byte)0x91},
  258. 0xfa,
  259. 1,
  260. new String[] {"serial_25"}
  261. ),
  262. LIQUID_SERIAL_26(
  263. new byte[] {0x01,0x03,0x24,0x45,0x00,0x7d,(byte)0x9e,(byte)0xce},
  264. 0xfa,
  265. 1,
  266. new String[] {"serial_26"}
  267. ),
  268. LIQUID_SERIAL_27(
  269. new byte[] {0x01,0x03,0x24,(byte)0xC2,0x00,0x7d,0x2e,(byte)0xe7},
  270. 0xfa,
  271. 1,
  272. new String[] {"serial_27"}
  273. ),
  274. LIQUID_SERIAL_28(
  275. new byte[] {0x01,0x03,0x25,0x3F,0x00,0x7d,(byte)0xbe,(byte)0xeb},
  276. 0xfa,
  277. 1,
  278. new String[] {"serial_28"}
  279. ),
  280. LIQUID_SERIAL_29(
  281. new byte[] {0x01,0x03,0x25,(byte)0xBC,0x00,0x7d,0x4f,0x03},
  282. 0xfa,
  283. 1,
  284. new String[] {"serial_29"}
  285. ),
  286. LIQUID_SERIAL_30(
  287. new byte[] {0x01,0x03,0x26,0x39,0x00,0x7d,0x5e,(byte)0xae},
  288. 0xfa,
  289. 1,
  290. new String[] {"serial_30"}
  291. ),
  292. LIQUID_SERIAL_31(
  293. new byte[] {0x01,0x03,0x26,(byte)0xB6,0x00,0x7d,0x6f,0x45},
  294. 0xfa,
  295. 1,
  296. new String[] {"serial_31"}
  297. ),
  298. LIQUID_SERIAL_32(
  299. new byte[] {0x01,0x03,0x27,0x33,0x00,0x7d,0x7f,0x50},
  300. 0xfa,
  301. 1,
  302. new String[] {"serial_32"}
  303. ),
  304. LIQUID_SERIAL_33(
  305. new byte[] {0x01,0x03,0x27,(byte)0xB0,0x00,0x7d,(byte)0x8e,(byte)0xb8},
  306. 0xfa,
  307. 1,
  308. new String[] {"serial_33"}
  309. ),
  310. LIQUID_SERIAL_34(
  311. new byte[] {0x01,0x03,0x28,0x2D,0x00,0x7d,0x1c,0x42},
  312. 0xfa,
  313. 1,
  314. new String[] {"serial_34"}
  315. ),
  316. LIQUID_SERIAL_35(
  317. new byte[] {0x01,0x03,0x28,(byte)0xAA,0x00,0x7d,(byte)0xac,0x6b},
  318. 0xfa,
  319. 1,
  320. new String[] {"serial_35"}
  321. ),
  322. LIQUID_SERIAL_36(
  323. new byte[] {0x01,0x03,0x29,0x27,0x00,0x7d,0x3d,(byte)0xbc},
  324. 0xfa,
  325. 1,
  326. new String[] {"serial_36"}
  327. ),
  328. LIQUID_SERIAL_37(
  329. new byte[] {0x01,0x03,0x29,(byte)0xA4,0x00,0x7d,(byte)0xcc,0x54},
  330. 0xfa,
  331. 1,
  332. new String[] {"serial_37"}
  333. ),
  334. LIQUID_SERIAL_38(
  335. new byte[] {0x01,0x03,0x2A,0x21,0x00,0x7d,(byte)0xdd,(byte)0xf9},
  336. 0xfa,
  337. 1,
  338. new String[] {"serial_38"}
  339. ),
  340. LIQUID_SERIAL_39(
  341. new byte[] {0x01,0x03,0x2A,(byte)0x9E,0x00,0x7d,(byte)0xec,0x1d},
  342. 0xfa,
  343. 1,
  344. new String[] {"serial_39"}
  345. ),
  346. LIQUID_SERIAL_40(
  347. new byte[] {0x01,0x03,0x2B,0x1B,0x00,0x7d,(byte)0xfc,0x08},
  348. 0xfa,
  349. 1,
  350. new String[] {"serial_40"}
  351. );
  352. private byte[] cmd; //读取指令 最后字节CRC16
  353. private int totalBytCount; //返回的字节数(以此区分不同指令的返回数据)
  354. private int itemBytCount; //每个数据项字节数 目前为4字节或2字节一个数据
  355. private String[] paramCodes; //返回数据项对应参数编码
  356. private ZLOpdProtCMDEnum(byte[] cmd,int totalBytCount,int itemBytCount,String[] paramCodes) {
  357. this.cmd=cmd;
  358. this.totalBytCount=totalBytCount;
  359. this.itemBytCount=itemBytCount;
  360. this.paramCodes=paramCodes;
  361. }
  362. public byte[] getCmd() {
  363. return cmd;
  364. }
  365. public int getTotalBytCount() {
  366. return totalBytCount;
  367. }
  368. public int getItemBytCount() {
  369. return itemBytCount;
  370. }
  371. public String[] getParamCodes() {
  372. return paramCodes;
  373. }
  374. }