123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422 |
- package com.hb.proj.gather.protocol;
- /**
- * 数据读取指令 枚举类
- * @author cwen
- *
- */
- public enum ZLOpdProtCMDEnum {
-
- //20[应返回数据区字节数] 一次读取到油压、套压、回压、井口温度、载荷 01 03 01 2c 00 0a 校验位两字节 应返回字节数 每个数据项字节数 参数编码表
- PRESS_TEMP_LOAD(
- new byte[] {0x01, 0x03, 0x01, 0x2c, 0x00, 0x0a, 0x05, (byte)0xf8},
- 0x14,
- 4,
- new String[]{"oil_press","casing_press","back_press","well_head_temp","load"}),
-
-
-
- //48 电机电流A、B、C,电压A、B、C,有功功耗,无功功耗,有功功率,无功功率,反向功率,功率因数 01 03 01 5f 00 18
- CURR_VOL_LOS_PW(
- new byte[] {0x01, 0x03, 0x01, 0x5f, 0x00, 0x18, 0x74, (byte)0x2e},
- 0x30,
- 4,
- 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"}),
-
- //8 冲次、冲程 01 03 01 a4 00 04
- FREQ_STROKE(
- new byte[] {0x01, 0x03, 0x01, (byte)0xa4, 0x00, 0x04, 0x04, 0x16},
- 0x08,
- 4,
- new String[]{"freq","stroke"}),
-
- //2 功图实际点数 01 03 03 d7 00 01
- DIAGRAM_POINT_COUNT(
- new byte[] {0x01, 0x03, 0x03, (byte)0xd7, 0x00, 0x01, 0x34, 0x76},
- 0x02,
- 2,
- new String[]{"diagram_point"}),
-
-
-
-
- //196-98功图位移第1部分 01 03 03 e8 00 62
- DIAGRAM_DISP_1(
- new byte[] {0x01, 0x03, 0x03, (byte)0xe8, 0x00, 0x62, (byte)0x44, 0x53},
- 0xc4,
- 2,
- new String[]{"disp_1"}),
-
- //200-100 功图位移第2部分 01 03 04 4a 00 64
- DIAGRAM_DISP_2(
- new byte[] {0x01, 0x03, 0x04, 0x4a, 0x00, 0x64, 0x64, (byte)0xc7},
- 0xc8,
- 2,
- new String[]{"disp_2"}),
-
- //104-52 功图位移第3部分 01 03 04 ae 00 34
- DIAGRAM_DISP_3(
- new byte[] {0x01, 0x03, 0x04, (byte)0xae, 0x00, 0x34, 0x24, (byte)0xcc},
- 0x68,
- 2,
- new String[]{"disp_3"}),
-
-
-
-
- //192-96 功图载荷第1部分 01 03 04 e2 00 60 01 03 05 42 00 5a 01 03 05 9c 00 40
- DIAGRAM_LOAD_1(
- new byte[] {0x01, 0x03, 0x04, (byte)0xe2, 0x00, 0x60, (byte)0xe4, (byte)0xe4},
- 0xc0,
- 2,
- new String[]{"chartload_1"}),
-
- //180-90 功图载荷第2部分 01 03 05 42 00 5a
- DIAGRAM_LOAD_2(
- new byte[] {0x01, 0x03, 0x05, 0x42, 0x00, 0x5a, 0x65, 0x29},
- 0xb4,
- 2,
- new String[]{"chartload_2"}),
-
- //128-64 功图载荷第3部分 01 03 05 9c 00 40
- DIAGRAM_LOAD_3(
- new byte[] {0x01, 0x03, 0x05, (byte)0x9c, 0x00, 0x40, (byte)0x84, (byte)0xd8},
- 0x80,
- 2,
- new String[]{"chartload_3"}),
-
-
-
-
-
-
- //188-94 电流图电流第1部分 01 03 05 dc 00 5e 01 03 06 3a 00 58 01 03 06 92 00 44
- DIAGRAM_CURR_1(
- new byte[] {0x01, 0x03, 0x05, (byte)0xdc, 0x00, 0x5e, 0x05, 0x04},
- 0xbc,
- 2,
- new String[]{"chartcurr_1"}),
-
- //176-88 电流图电流第2部分 01 03 06 3a 00 58
- DIAGRAM_CURR_2(
- new byte[] {0x01, 0x03, 0x06, 0x3a, 0x00, 0x58, 0x64, (byte)0xb5},
- 0xb0,
- 2,
- new String[]{"chartcurr_2"}),
-
- //136-68 电流图电流第3部分 01 03 06 92 00 44
- DIAGRAM_CURR_3(
- new byte[] {0x01, 0x03, 0x06, (byte)0x92, 0x00, 0x44, (byte)0xe4, (byte)0x9c},
- 0x88,
- 2,
- new String[]{"chartcurr_3"}),
-
-
-
-
-
- //184-92 功率图功率第1部分 01 03 06 d6 00 5c 01 03 07 32 00 56 01 03 07 88 00 48
- DIAGRAM_POWER_1(
- new byte[] {0x01, 0x03, 0x06, (byte)0xd6, 0x00, 0x5c, (byte)0xa4, (byte)0x83},
- 0xb8,
- 2,
- new String[]{"chartpower_1"}),
-
- //172-86 功率图功率第2部分 01 03 07 32 00 56
- DIAGRAM_POWER_2(
- new byte[] {0x01, 0x03, 0x07, 0x32, 0x00, 0x56, 0x65, 0x4f},
- 0xac,
- 2,
- new String[]{"chartpower_2"}),
-
- //144-72 功率图功率第3部分 01 03 07 88 00 48
- DIAGRAM_POWER_3(
- new byte[] {0x01, 0x03, 0x07, (byte)0x88, 0x00, 0x48, (byte)0xc4, (byte)0xa2},
- 0x90,
- 2,
- new String[]{"chartpower_3"}),
-
-
- //18-9 动液面其它参数采集(测量时间、音速、测量深度、套压) 01 03 18 00 00 09
- LIQUID_OTHER(
- new byte[] {0x01, 0x03, 0x18, 0x00, 0x00, 0x09, (byte)0x83, 0x6c},
- 0x12,
- 2,
- 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"}
- ),
-
- //250-125 动液面曲线数据(1/40)
- LIQUID_SERIAL_1(
- new byte[] {0x01,0x03,0x18,0x10,0x00,0x7d,(byte)0x82,(byte)0x8e},
- 0xfa,
- 1,
- new String[] {"serial_1"}
- ),
- LIQUID_SERIAL_2(
- new byte[] {0x01,0x03,0x18,(byte)0x8D,0x00,0x7d,0x13,0x60},
- 0xfa,
- 1,
- new String[] {"serial_2"}
- ),
- LIQUID_SERIAL_3(
- new byte[] {0x01,0x03,0x19,0x0A,0x00,0x7d,(byte)0xa2,(byte)0xb5},
- 0xfa,
- 1,
- new String[] {"serial_3"}
- ),
- LIQUID_SERIAL_4(
- new byte[] {0x01,0x03,0x19,(byte)0x87,0x00,0x7d,0x32,(byte)0x9e},
- 0xfa,
- 1,
- new String[] {"serial_4"}
- ),
- LIQUID_SERIAL_5(
- new byte[] {0x01,0x03,0x1A,0x04,0x00,0x7d,(byte)0xc3,0x32},
- 0xfa,
- 1,
- new String[] {"serial_5"}
- ),
- LIQUID_SERIAL_6(
- new byte[] {0x01,0x03,0x1A,(byte)0x81,0x00,0x7d,(byte)0xd2,(byte)0xdb},
- 0xfa,
- 1,
- new String[] {"serial_6"}
- ),
- LIQUID_SERIAL_7(
- new byte[] {0x01,0x03,0x1A,(byte)0xFE,0x00,0x7d,(byte)0xe3,0x03},
- 0xfa,
- 1,
- new String[] {"serial_7"}
- ),
- LIQUID_SERIAL_8(
- new byte[] {0x01,0x03,0x1B,0x7B,0x00,0x7d,(byte)0xf3,0x16},
- 0xfa,
- 1,
- new String[] {"serial_8"}
- ),
- LIQUID_SERIAL_9(
- new byte[] {0x01,0x03,0x1B,(byte)0xF8,0x00,0x7d},
- 0xfa,
- 1,
- new String[] {"serial_9"}
- ),
- LIQUID_SERIAL_10(
- new byte[] {0x01,0x03,0x1C,0x75,0x00,0x7d,(byte)0x93,(byte)0xa1},
- 0xfa,
- 1,
- new String[] {"serial_10"}
- ),
- LIQUID_SERIAL_11(
- new byte[] {0x01,0x03,0x1C,(byte)0xF2,0x00,0x7d,0x23,(byte)0x88},
- 0xfa,
- 1,
- new String[] {"serial_11"}
- ),
- LIQUID_SERIAL_12(
- new byte[] {0x01,0x03,0x1D,0x6F,0x00,0x7d,(byte)0xb3,(byte)0x9a},
- 0xfa,
- 1,
- new String[] {"serial_12"}
- ),
- LIQUID_SERIAL_13(
- new byte[] {0x01,0x03,0x1D,(byte)0xEC,0x00,0x7d,0x42,0x72},
- 0xfa,
- 1,
- new String[] {"serial_13"}
- ),
- LIQUID_SERIAL_14(
- new byte[] {0x01,0x03,0x1E,0x69,0x00,0x7d,0x53,(byte)0xdf},
- 0xfa,
- 1,
- new String[] {"serial_14"}
- ),
- LIQUID_SERIAL_15(
- new byte[] {0x01,0x03,0x1E,(byte)0xE6,0x00,0x7d,0x62,0x34},
- 0xfa,
- 1,
- new String[] {"serial_15"}
- ),
- LIQUID_SERIAL_16(
- new byte[] {0x01,0x03,0x1F,0x63,0x00,0x7d,0x72,0x21},
- 0xfa,
- 1,
- new String[] {"serial_16"}
- ),
- LIQUID_SERIAL_17(
- new byte[] {0x01,0x03,0x1F,(byte)0xE0,0x00,0x7d,(byte)0x83,(byte)0xc9},
- 0xfa,
- 1,
- new String[] {"serial_17"}
- ),
- LIQUID_SERIAL_18(
- new byte[] {0x01,0x03,0x20,0x5D,0x00,0x7d,0x1f,(byte)0xf9},
- 0xfa,
- 1,
- new String[] {"serial_18"}
- ),
- LIQUID_SERIAL_19(
- new byte[] {0x01,0x03,0x20,(byte)0xDA,0x00,0x7d,(byte)0xaf,(byte)0xd0},
- 0xfa,
- 1,
- new String[] {"serial_19"}
- ),
- LIQUID_SERIAL_20(
- new byte[] {0x01,0x03,0x21,0x57,0x00,0x7d,0x3e,0x07},
- 0xfa,
- 1,
- new String[] {"serial_20"}
- ),
- LIQUID_SERIAL_21(
- new byte[] {0x01,0x03,0x21,(byte)0xD4,0x00,0x7d,(byte)0xcf,(byte)0xef},
- 0xfa,
- 1,
- new String[] {"serial_21"}
- ),
- LIQUID_SERIAL_22(
- new byte[] {0x01,0x03,0x22,0x51,0x00,0x7d,(byte)0xde,0x42},
- 0xfa,
- 1,
- new String[] {"serial_22"}
- ),
- LIQUID_SERIAL_23(
- new byte[] {0x01,0x03,0x22,(byte)0xCE,0x00,0x7d,(byte)0xee,0x6c},
- 0xfa,
- 1,
- new String[] {"serial_23"}
- ),
- LIQUID_SERIAL_24(
- new byte[] {0x01,0x03,0x23,0x4B,0x00,0x7d,(byte)0xfe,0x79},
- 0xfa,
- 1,
- new String[] {"serial_24"}
- ),
- LIQUID_SERIAL_25(
- new byte[] {0x01,0x03,0x23,(byte)0xC8,0x00,0x7d,0x0f,(byte)0x91},
- 0xfa,
- 1,
- new String[] {"serial_25"}
- ),
- LIQUID_SERIAL_26(
- new byte[] {0x01,0x03,0x24,0x45,0x00,0x7d,(byte)0x9e,(byte)0xce},
- 0xfa,
- 1,
- new String[] {"serial_26"}
- ),
- LIQUID_SERIAL_27(
- new byte[] {0x01,0x03,0x24,(byte)0xC2,0x00,0x7d,0x2e,(byte)0xe7},
- 0xfa,
- 1,
- new String[] {"serial_27"}
- ),
- LIQUID_SERIAL_28(
- new byte[] {0x01,0x03,0x25,0x3F,0x00,0x7d,(byte)0xbe,(byte)0xeb},
- 0xfa,
- 1,
- new String[] {"serial_28"}
- ),
- LIQUID_SERIAL_29(
- new byte[] {0x01,0x03,0x25,(byte)0xBC,0x00,0x7d,0x4f,0x03},
- 0xfa,
- 1,
- new String[] {"serial_29"}
- ),
- LIQUID_SERIAL_30(
- new byte[] {0x01,0x03,0x26,0x39,0x00,0x7d,0x5e,(byte)0xae},
- 0xfa,
- 1,
- new String[] {"serial_30"}
- ),
- LIQUID_SERIAL_31(
- new byte[] {0x01,0x03,0x26,(byte)0xB6,0x00,0x7d,0x6f,0x45},
- 0xfa,
- 1,
- new String[] {"serial_31"}
- ),
- LIQUID_SERIAL_32(
- new byte[] {0x01,0x03,0x27,0x33,0x00,0x7d,0x7f,0x50},
- 0xfa,
- 1,
- new String[] {"serial_32"}
- ),
- LIQUID_SERIAL_33(
- new byte[] {0x01,0x03,0x27,(byte)0xB0,0x00,0x7d,(byte)0x8e,(byte)0xb8},
- 0xfa,
- 1,
- new String[] {"serial_33"}
- ),
- LIQUID_SERIAL_34(
- new byte[] {0x01,0x03,0x28,0x2D,0x00,0x7d,0x1c,0x42},
- 0xfa,
- 1,
- new String[] {"serial_34"}
- ),
- LIQUID_SERIAL_35(
- new byte[] {0x01,0x03,0x28,(byte)0xAA,0x00,0x7d,(byte)0xac,0x6b},
- 0xfa,
- 1,
- new String[] {"serial_35"}
- ),
- LIQUID_SERIAL_36(
- new byte[] {0x01,0x03,0x29,0x27,0x00,0x7d,0x3d,(byte)0xbc},
- 0xfa,
- 1,
- new String[] {"serial_36"}
- ),
- LIQUID_SERIAL_37(
- new byte[] {0x01,0x03,0x29,(byte)0xA4,0x00,0x7d,(byte)0xcc,0x54},
- 0xfa,
- 1,
- new String[] {"serial_37"}
- ),
- LIQUID_SERIAL_38(
- new byte[] {0x01,0x03,0x2A,0x21,0x00,0x7d,(byte)0xdd,(byte)0xf9},
- 0xfa,
- 1,
- new String[] {"serial_38"}
- ),
- LIQUID_SERIAL_39(
- new byte[] {0x01,0x03,0x2A,(byte)0x9E,0x00,0x7d,(byte)0xec,0x1d},
- 0xfa,
- 1,
- new String[] {"serial_39"}
- ),
- LIQUID_SERIAL_40(
- new byte[] {0x01,0x03,0x2B,0x1B,0x00,0x7d,(byte)0xfc,0x08},
- 0xfa,
- 1,
- new String[] {"serial_40"}
- );
-
- private byte[] cmd; //读取指令 最后字节CRC16
-
- private int totalBytCount; //返回的字节数(以此区分不同指令的返回数据)
-
- private int itemBytCount; //每个数据项字节数 目前为4字节或2字节一个数据
-
- private String[] paramCodes; //返回数据项对应参数编码
-
- private ZLOpdProtCMDEnum(byte[] cmd,int totalBytCount,int itemBytCount,String[] paramCodes) {
- this.cmd=cmd;
- this.totalBytCount=totalBytCount;
- this.itemBytCount=itemBytCount;
- this.paramCodes=paramCodes;
- }
- public byte[] getCmd() {
- return cmd;
- }
- public int getTotalBytCount() {
- return totalBytCount;
- }
- public int getItemBytCount() {
- return itemBytCount;
- }
- public String[] getParamCodes() {
- return paramCodes;
- }
-
- }
|