#
LSH
2024-03-29 bfdfccb86822c0340d74132ed560bf505add7820
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -336,7 +336,7 @@
//        crnCommand.setDestinationStaNo(command.getDestinationStaNo());
        crnCommand.setCommand(command.getCommand());
        if (command.getTaskNo() == 0 && command.getAckFinish() == 0 && command.getAuto() != 1) {
            command.setTaskNo((short) 9999);
            command.setTaskNo((short) 999);
        }
        command.setCrnNo(slave.getId());
@@ -348,12 +348,12 @@
        }
        array[1] = command.getTaskNo();
        array[2] = command.getTaskMode();
        array[3] = command.getSourcePosZ();
        array[4] = command.getSourcePosX();
        array[5] = command.getSourcePosY();
        array[6] = command.getDestinationPosZ();
        array[7] = command.getDestinationPosX();
        array[8] = command.getDestinationPosY();
        array[3] = command.getSourcePosX();
        array[4] = command.getSourcePosY();
        array[5] = command.getSourcePosZ();
        array[6] = command.getDestinationPosX();
        array[7] = command.getDestinationPosY();
        array[8] = command.getDestinationPosZ();
        array[9] = command.getCommand();
        // 作业信息
@@ -409,9 +409,9 @@
                one.setDestinationPosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 16));
//                one.setSourceStaNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 18));
//                one.setDestinationStaNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 20));
                if (!crnCommand.getTaskNo().equals(one.getTaskNo()) && !crnCommand.getAckFinish().equals(one.getAckFinish())
                        && !crnCommand.getSourcePosZ().equals(one.getSourcePosZ()) &&  !crnCommand.getSourcePosX().equals(one.getSourcePosX()) && !crnCommand.getSourcePosY().equals(one.getSourcePosY())
                        && !crnCommand.getDestinationPosZ().equals(one.getDestinationPosZ()) &&  !crnCommand.getDestinationPosX().equals(one.getDestinationPosX()) && !crnCommand.getDestinationPosY().equals(one.getDestinationPosY())
                if (!crnCommand.getTaskNo().equals(one.getTaskNo()) || !crnCommand.getAckFinish().equals(one.getAckFinish())
                        || !crnCommand.getSourcePosZ().equals(one.getSourcePosZ()) ||  !crnCommand.getSourcePosX().equals(one.getSourcePosX()) || !crnCommand.getSourcePosY().equals(one.getSourcePosY())
                        || !crnCommand.getDestinationPosZ().equals(one.getDestinationPosZ()) ||  !crnCommand.getDestinationPosX().equals(one.getDestinationPosX()) || !crnCommand.getDestinationPosY().equals(one.getDestinationPosY())
                ){
                    log.error("堆垛机命令地址写入后回读失败[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one));
                    log.error("堆垛机命令回读失败后,重新添加任务到队列 ===>> [id:{}],{}", slave.getId(), JSON.toJSON(crnCommand));
@@ -454,7 +454,7 @@
//        crnCommand.setDestinationStaNo(command.getDestinationStaNo());
        crnCommand.setCommand(command.getCommand());
        if (command.getTaskNo() == 0 && command.getAckFinish() == 0 && command.getAuto() != 1) {
            command.setTaskNo((short) 9999);
            command.setTaskNo((short) 999);
        }
        command.setCrnNo(slave.getId());
@@ -466,17 +466,16 @@
        }
        array[1] = command.getTaskNo();
        array[2] = command.getTaskMode();
        array[3] = command.getSourcePosZ();
        array[4] = command.getSourcePosX();
        array[5] = command.getSourcePosY();
        array[6] = command.getDestinationPosZ();
        array[7] = command.getDestinationPosX();
        array[8] = command.getDestinationPosY();
        array[3] = command.getSourcePosX();
        array[4] = command.getSourcePosY();
        array[5] = command.getSourcePosZ();
        array[6] = command.getDestinationPosX();
        array[7] = command.getDestinationPosY();
        array[8] = command.getDestinationPosZ();
        array[9] = command.getCommand();
        // 作业信息
        OperateResult result = siemensNet.Write("DB100.0", array);
        // 日志记录
//        try {
            if (command.getAckFinish() != 1) {
                BasCrnOptService bean = SpringUtils.getBean(BasCrnOptService.class);
                BasCrnOpt basCrnOpt = new BasCrnOpt(