自动化立体仓库 - WCS系统
Junjie
2023-05-10 11b28c7a6c5f0882b8385a370b20919c6246fc1d
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -45,8 +45,8 @@
    private int barcodeSize = 2;
    public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{
        add(100);add(101);add(102);
        add(200);add(201);add(202);
        add(300);add(301);add(302);
        add(103);add(104);add(105);
        add(106);add(107);add(108);
    }};
    public boolean charge0;
@@ -195,38 +195,37 @@
            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]);
        }
//        // 外形检测 - 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) {
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId()));
            // 根据实时信息更新数据库