Browse Source

现场调试改动022200111

调味吧台(白底)
fyf 1 year ago
parent
commit
4e1a97a785
2 changed files with 11 additions and 4 deletions
  1. +8
    -4
      app/src/main/java/com/example/bpa/service/DeviceData.java
  2. +3
    -0
      app/src/main/java/com/example/bpa/view/fragment/SsjkFragment.java

+ 8
- 4
app/src/main/java/com/example/bpa/service/DeviceData.java View File

@@ -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);
}
});



+ 3
- 0
app/src/main/java/com/example/bpa/view/fragment/SsjkFragment.java View File

@@ -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());


Loading…
Cancel
Save