1
zhang
2 天以前 ccc7db768baea9df601574a9e2afd52a26a8577d
1
1个文件已修改
12 ■■■■ 已修改文件
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java
@@ -174,13 +174,13 @@
        byte[] content = result.Content;
        for (int i = 0; i < DeviceField.BARCODE.getArrLength(); i++) {
            int[] seg = DeviceField.BARCODE.getSeg();
            Short staNo = siemensS7Net.getByteTransform().TransInt16(
            int staNo = siemensS7Net.getByteTransform().TransInt16(
                    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");
            if (!Cools.isEmpty(barcode) && staNo != null) {
            if (!Cools.isEmpty(barcode) && staNo != 0) {
                StaProtocol staProtocol = station.get(staNo);
                if (staProtocol == null) {
                    log.warn("扫码站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNo);
@@ -211,11 +211,11 @@
        byte[] content = result.Content;
        for (int i = 0; i < DeviceField.WEIGHT.getArrLength(); i++) {
            int[] seg = DeviceField.WEIGHT.getSeg();
            Short staNo = siemensS7Net.getByteTransform().TransInt16(
            int staNo = siemensS7Net.getByteTransform().TransInt16(
                    content, seg[0] + i * DeviceField.WEIGHT.getByteLength());
            Double weight = (double) siemensS7Net.getByteTransform().TransSingle(
                    content, seg[1] + i * DeviceField.WEIGHT.getByteLength());
            if (!Cools.isEmpty(weight) && staNo != null) {
            if (!Cools.isEmpty(weight) && staNo != 0) {
                StaProtocol staProtocol = station.get(staNo);
                if (staProtocol == null) {
                    log.warn("称重站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNo);
@@ -246,9 +246,9 @@
        byte[] content = result.Content;
        for (int i = 0; i < DeviceField.DIMENSION_WORD.getArrLength(); i++) {
            int[] seg = DeviceField.DIMENSION_WORD.getSeg();
            Short staNo = siemensS7Net.getByteTransform().TransInt16(
            int staNo = siemensS7Net.getByteTransform().TransInt16(
                    content, seg[0]);
            if (staNo != null) {
            if (staNo != 0) {
                StaProtocol staProtocol = station.get(staNo);
                if (staProtocol == null) {
                    log.warn("异常站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNo);