diff --git a/app/src/main/java/com/example/bpa/service/DeviceData.java b/app/src/main/java/com/example/bpa/service/DeviceData.java index 3b6aa4b..f3a54df 100644 --- a/app/src/main/java/com/example/bpa/service/DeviceData.java +++ b/app/src/main/java/com/example/bpa/service/DeviceData.java @@ -146,10 +146,14 @@ public class DeviceData { ModbusTcpServer.get().ReadStatus("VW382", 3, data -> { for (int i = 0; i < data.length; i++) { byte status=data[i];//0x92 - IoStatus.put(i*4+0, ByteHelper.getBit(status,0)==1); - IoStatus.put(i*4+1, ByteHelper.getBit(status,1)==1); - IoStatus.put(i*4+2, ByteHelper.getBit(status,2)==1); - IoStatus.put(i*4+3, ByteHelper.getBit(status,3)==1); + IoStatus.put(i*8+0, ByteHelper.getBit(status,0)==1); + IoStatus.put(i*8+1, ByteHelper.getBit(status,1)==1); + IoStatus.put(i*8+2, ByteHelper.getBit(status,2)==1); + IoStatus.put(i*8+3, ByteHelper.getBit(status,3)==1); + IoStatus.put(i*8+4, ByteHelper.getBit(status,4)==1); + IoStatus.put(i*8+5, ByteHelper.getBit(status,5)==1); + IoStatus.put(i*8+6, ByteHelper.getBit(status,6)==1); + IoStatus.put(i*8+7, ByteHelper.getBit(status,7)==1); } }); diff --git a/app/src/main/java/com/example/bpa/view/fragment/SsjkFragment.java b/app/src/main/java/com/example/bpa/view/fragment/SsjkFragment.java index e65b825..3c1acde 100644 --- a/app/src/main/java/com/example/bpa/view/fragment/SsjkFragment.java +++ b/app/src/main/java/com/example/bpa/view/fragment/SsjkFragment.java @@ -175,6 +175,9 @@ public class SsjkFragment extends Fragment implements View.OnClickListener { SetStatus(19,DeviceData.Get().getConcurrentHash(35)); SetStatus(20,DeviceData.Get().getConcurrentHash(36)); SetStatus(21,DeviceData.Get().getConcurrentHash(37)); + SetStatus(22,DeviceData.Get().getConcurrentHash(38)); + SetStatus(23,DeviceData.Get().getConcurrentHash(39)); + adapter.refresh(); } catch (Exception e) { MessageLog.ShowInfo("状态显示解析异常!"+e.getMessage());