1
Administrator
昨天 faf2c5e81aedcac5ea83b797e89302938b399829
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java
@@ -169,6 +169,15 @@
        staProtocol.setSegApply(status2[2]);
        staProtocol.setApplyErr(status2[3]);
        if (!status2[1] && !status[1]) {
            staProtocol.setStartUpFlag(true);
        }
        for (int i = 0; i < 8; i++) {
            if (status0[i + 8] != status2[i]) {
                log.info("状态码不一致 [id:{}] [i:{}] [status0:{}] [status2:{}]", slave.getId(), i, status0[i], status2[i]);
            }
        }
    }
    /**
@@ -195,16 +204,16 @@
                    content, seg[0] + i * DeviceField.BARCODE.getByteLength());
            String barcode = siemensS7Net.getByteTransform().TransString(
                    content, seg[1] + i * DeviceField.BARCODE.getByteLength(),
                    DeviceField.BARCODE.getByteLength() - seg[1], "UTF-8");
                    DeviceField.BARCODE.getByteLength()-seg[1] , "UTF-8").trim();
            if (!Cools.isEmpty(barcode) && staNo != 0) {
            if (!Cools.isEmpty(barcode) && !barcode.contains("Default") && !barcode.contains("Error") && staNo != 0) {
                StaProtocol staProtocol = station.get(staNo);
                if (staProtocol == null) {
                    log.warn("扫码站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNo);
                    continue;
                }
                staProtocol.setBarcode(barcode);
                News.info("料箱码:{}", barcode);
                //News.info("料箱码:{}", barcode);
            }
        }
    }
@@ -235,7 +244,7 @@
            if (!Cools.isEmpty(weight) && staNo != 0) {
                StaProtocol staProtocol = station.get(staNo);
                if (staProtocol == null) {
                    log.warn("称重站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNo);
                    log.warn(" [id:{}] [staNo:{}]", slave.getId(), staNo);
                    continue;
                }
                staProtocol.setWeight(BigDecimal.valueOf(weight).setScale(4, RoundingMode.HALF_UP).doubleValue());
@@ -374,13 +383,14 @@
            staProtocolTake.setOutComplete(status2[4]);
            //
            if (status[3]) {
                staProtocolPut.setSafeSignal( new SafeSignal(i, (short) 0, true));
                redis.push(RedisConveyorConstant.CONVEYOR_SAFE_FLAG,staProtocolPut);
                staProtocolPut.setSafeSignal(new SafeSignal(i, false, true));
                redis.push(RedisConveyorConstant.CONVEYOR_SAFE_FLAG, staProtocolPut);
                News.info("安全交互信号复位 [id:{}] [staNo:{}]", slave.getId(), staProtocolPut.getSiteId());
            }
            if (status2[4]) {
                staProtocolTake.setSafeSignal(new SafeSignal(i, (short) 0, false));
                staProtocolTake.setSafeSignal(new SafeSignal(i, false, false));
                redis.push(RedisConveyorConstant.CONVEYOR_SAFE_FLAG, staProtocolTake);
                News.info("安全交互信号复位 [id:{}] [staNo:{}]", slave.getId(), staProtocolPut.getSiteId());
            }
        }