Junjie
2023-03-27 eb5eb35a7ef56a01a4c788a8c2efef9fc7b823e7
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -181,34 +181,49 @@
            charge1 = status[0];
        }
//        // 外形检测 - 102
//        Thread.sleep(50);
//        OperateResultExOne<byte[]> result4 = siemensS7Net.Read("DB102.129", (short)1);
//        if (result4.IsSuccess) {
//            boolean[] status = siemensS7Net.getByteTransform().TransBool(result4.Content, 0, 1);
//            StaProtocol staProtocol = station.get(102);
//            staProtocol.setFrontErr(status[0]);
//            staProtocol.setBackErr(status[1]);
//            staProtocol.setHighErr(status[2]);
//            staProtocol.setLeftErr(status[3]);
//            staProtocol.setRightErr(status[4]);
//            staProtocol.setWeightErr(status[5]);
//            staProtocol.setBarcodeErr(status[6]);
//        }
//        // 外形检测 - 203
//        Thread.sleep(50);
//        OperateResultExOne<byte[]> result5 = siemensS7Net.Read("DB102.130", (short)1);
//        if (result5.IsSuccess) {
//            boolean[] status = siemensS7Net.getByteTransform().TransBool(result5.Content, 0, 1);
//            StaProtocol staProtocol = station.get(202);
//            staProtocol.setFrontErr(status[0]);
//            staProtocol.setBackErr(status[1]);
//            staProtocol.setHighErr(status[2]);
//            staProtocol.setLeftErr(status[3]);
//            staProtocol.setRightErr(status[4]);
//            staProtocol.setWeightErr(status[5]);
//            staProtocol.setBarcodeErr(status[6]);
//        }
        // 外形检测 - 102
        Thread.sleep(50);
        OperateResultExOne<byte[]> result102 = siemensS7Net.Read("DB102.110", (short)1);
        if (result102.IsSuccess) {
            boolean[] status = siemensS7Net.getByteTransform().TransBool(result102.Content, 0, 1);
            StaProtocol staProtocol = station.get(102);
            staProtocol.setFrontErr(status[0]);// 前超限
            staProtocol.setBackErr(status[1]);// 后超限
            staProtocol.setHighErr(status[2]);// 高超限
            staProtocol.setLeftErr(status[3]);// 左超限
            staProtocol.setRightErr(status[4]);// 右超限
            staProtocol.setWeightErr(status[5]); // 超重
            staProtocol.setBarcodeErr(status[6]);// 扫码失败
        }
        // 外形检测 - 201
        Thread.sleep(50);
        OperateResultExOne<byte[]> result201 = siemensS7Net.Read("DB102.112", (short)1);
        if (result201.IsSuccess) {
            boolean[] status = siemensS7Net.getByteTransform().TransBool(result201.Content, 0, 1);
            StaProtocol staProtocol = station.get(201);
            staProtocol.setFrontErr(status[0]);
            staProtocol.setBackErr(status[1]);
            staProtocol.setHighErr(status[2]);
            staProtocol.setLeftErr(status[3]);
            staProtocol.setRightErr(status[4]);
            staProtocol.setWeightErr(status[5]);
            staProtocol.setBarcodeErr(status[6]);
        }
        // 外形检测 - 301
        Thread.sleep(50);
        OperateResultExOne<byte[]> result301 = siemensS7Net.Read("DB102.114", (short)1);
        if (result301.IsSuccess) {
            boolean[] status = siemensS7Net.getByteTransform().TransBool(result301.Content, 0, 1);
            StaProtocol staProtocol = station.get(301);
            staProtocol.setFrontErr(status[0]);
            staProtocol.setBackErr(status[1]);
            staProtocol.setHighErr(status[2]);
            staProtocol.setLeftErr(status[3]);
            staProtocol.setRightErr(status[4]);
            staProtocol.setWeightErr(status[5]);
            staProtocol.setBarcodeErr(status[6]);
        }
        if (result.IsSuccess && result1.IsSuccess) {