| | |
| | | public boolean putReadIBackByteBuffer(ByteBuffer bf) {
|
| | | ByteBuffer tmpbf = bf;
|
| | | int datacount = ComBase.changeShortToInt(bf.getShort());
|
| | | if(datacount < 36) {
|
| | | if(datacount < 2) {
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | //读取M区数据成功[0x01-0x12]
|
| | | //读取M区数据成功[01-12]
|
| | | public boolean putReadMBackByteBuffer(ByteBuffer bf) {
|
| | | ByteBuffer tmpbf = bf;
|
| | | int datacount = ComBase.changeShortToInt(bf.getShort());
|
| | | if(datacount < 24) {
|
| | | int datacount = ComBase.changeByteToInt(bf.get());
|
| | | if(datacount < 2) {
|
| | | return false;
|
| | | }
|
| | | state.FZ_autostate1 = ComBase.changeShortToInt(bf.getShort()); //FZ4_自动状态1 01 |
| | | state.FZ_autostate2 = ComBase.changeShortToInt(bf.getShort()); //FZ4_自动状态2 02 |
| | | state.FZ_autostate3 = ComBase.changeShortToInt(bf.getShort()); //FZ4_自动状态3 03 |
| | | state.FZ_autostate4 = ComBase.changeShortToInt(bf.getShort()); //FZ4_自动状态4 04 |
| | | state.FZ_autostate5 = ComBase.changeShortToInt(bf.getShort()); //FZ4_自动状态5 05
|
| | | int backup1 = ComBase.changeShortToInt(bf.getShort()); //备用1 06
|
| | | int backup2 = ComBase.changeShortToInt(bf.getShort()); //备用2 07
|
| | | state.start_auto = ComBase.changeShortToInt(bf.getShort()); //启动自动加载 08
|
| | | state.stop_auto = ComBase.changeShortToInt(bf.getShort()); //停止自动加载 09
|
| | | state.sudden_crease = ComBase.changeShortToInt(bf.getShort()); //突加突卸 10
|
| | | state.all_open = ComBase.changeShortToInt(bf.getShort()); //全部分闸 11
|
| | | state.fan_button = ComBase.changeShortToInt(bf.getShort()); //风机按钮 12
|
| | | int code = ComBase.changeByteToInt(bf.get());
|
| | | state.FZ_autostate1 = (code & ComBase.my_power_2(0))>0?1:0; //FZ4_自动状态1 01 |
| | | state.FZ_autostate2 = (code & ComBase.my_power_2(1))>0?1:0; //FZ4_自动状态2 02 |
| | | state.FZ_autostate3 = (code & ComBase.my_power_2(2))>0?1:0; //FZ4_自动状态3 03 |
| | | state.FZ_autostate4 = (code & ComBase.my_power_2(3))>0?1:0; //FZ4_自动状态4 04 |
| | | state.FZ_autostate5 = (code & ComBase.my_power_2(4))>0?1:0; //FZ4_自动状态5 05
|
| | | int backup1 = (code & ComBase.my_power_2(5))>0?1:0; //备用1 06
|
| | | int backup2 = (code & ComBase.my_power_2(6))>0?1:0; //备用2 07
|
| | | state.start_auto = (code & ComBase.my_power_2(7))>0?1:0; //启动自动加载 08
|
| | | |
| | | code = ComBase.changeByteToInt(bf.get());
|
| | | state.stop_auto = (code & ComBase.my_power_2(0))>0?1:0; //停止自动加载 09
|
| | | state.sudden_crease = (code & ComBase.my_power_2(1))>0?1:0; //突加突卸 10
|
| | | state.all_open = (code & ComBase.my_power_2(2))>0?1:0; //全部分闸 11
|
| | | state.fan_button = (code & ComBase.my_power_2(3))>0?1:0;
|
| | | return true;
|
| | | }
|
| | |
|
| | | //读取Q区数据成功[0x8000-0x8013]
|
| | | public boolean putReadQBackByteBuffer(ByteBuffer bf) {
|
| | | ByteBuffer tmpbf = bf;
|
| | | int datacount = ComBase.changeShortToInt(bf.getShort());
|
| | | if(datacount < 28) {
|
| | | int datacount = ComBase.changeByteToInt(bf.get());
|
| | | //System.out.println("$$$$$$$"+datacount);
|
| | | if(datacount < 2) {
|
| | | return false;
|
| | | }
|
| | | int code = ComBase.changeShortToInt(bf.get());
|