#
LSH
2023-05-22 1e0d3c640d6cfdf8856acf3e50d53cf520784d48
#
5个文件已修改
32 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/command/CrnCommand.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/protocol/CrnProtocol.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensCrnThread.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -747,7 +747,8 @@
            crnCommand.setSourcePosZ(crnStn.getLev().shortValue());     // 源库位层
            crnCommand.setDestinationPosX(locMast.getRow1().shortValue());     // 目标库位排
            crnCommand.setDestinationPosY(locMast.getBay1().shortValue());     // 目标库位列
            crnCommand.setDestinationPosZ(locMast.getLev1().shortValue());     // 目标库位层
            crnCommand.setDestinationPosZ(locMast.getLev1().shortValue());     // 目标库位层\
            crnCommand.setBarcode(wrkMast.getBarcode());
            if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
            } else {
@@ -890,6 +891,7 @@
                    crnCommand.setDestinationPosX(crnStn.getRow().shortValue());     // 目标库位排
                    crnCommand.setDestinationPosY(crnStn.getBay().shortValue());     // 目标库位列
                    crnCommand.setDestinationPosZ(crnStn.getLev().shortValue());     // 目标库位层
                    crnCommand.setBarcode(wrkMast.getBarcode());
                    if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
                        log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
                    } else {
src/main/java/com/zy/core/model/command/CrnCommand.java
@@ -74,6 +74,8 @@
    // 任务确认 0:未确认 1:已确认
    private Short command = 0;
    private String barcode= "";
    public void setTaskMode(Short taskMode){
        this.taskMode = taskMode;
        this.taskModeType = CrnTaskModeType.get(taskModeType);
src/main/java/com/zy/core/model/protocol/CrnProtocol.java
@@ -24,6 +24,10 @@
    public CrnModeType modeType;
    private String Barcode;
    private boolean BarcodeResult;
    /**
     * 1 = 急停
     */
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -150,7 +150,7 @@
     */
    private void readStatus(){
        try {
            OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 50);
            OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 65);
            if (result.IsSuccess) {
                if (null == crnProtocol) {
                    crnProtocol = new CrnProtocol();
@@ -170,12 +170,14 @@
                crnProtocol.setTemp3(siemensNet.getByteTransform().TransInt16(result.Content, 24));
                crnProtocol.setTemp4(siemensNet.getByteTransform().TransInt16(result.Content, 26));
                crnProtocol.setxSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 28));
                crnProtocol.setySpeed(siemensNet.getByteTransform().TransInt16(result.Content, 30));
                crnProtocol.setzSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 32));
                crnProtocol.setxDistance(siemensNet.getByteTransform().TransInt16(result.Content, 34));
                crnProtocol.setyDistance(siemensNet.getByteTransform().TransInt16(result.Content, 36));
                crnProtocol.setxDuration(siemensNet.getByteTransform().TransInt16(result.Content, 38));
                crnProtocol.setyDuration(siemensNet.getByteTransform().TransInt16(result.Content, 40));
                crnProtocol.setySpeed(siemensNet.getByteTransform().TransInt16(result.Content, 32));
                crnProtocol.setzSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 36));
                crnProtocol.setxDistance(siemensNet.getByteTransform().TransInt16(result.Content, 40));
                crnProtocol.setyDistance(siemensNet.getByteTransform().TransInt16(result.Content, 44));
                crnProtocol.setxDuration(siemensNet.getByteTransform().TransInt16(result.Content, 48));
                crnProtocol.setyDuration(siemensNet.getByteTransform().TransInt16(result.Content, 52));
                crnProtocol.setBarcodeResult(siemensNet.getByteTransform().TransBool(result.Content, 56));
                crnProtocol.setBarcode(siemensNet.getByteTransform().TransString(result.Content, 58,6,"UTF-8"));
                OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId()));
@@ -250,6 +252,8 @@
        array[10] = command.getDestinationStaNo();
        array[11] = command.getCommand();
        OperateResult result = siemensNet.Write("DB100.0", array);
        OperateResult result2 = siemensNet.Write("DB100.20", command.getBarcode());
        if (command.getAckFinish() == 0) {
            short commandFinish = 1;
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -175,10 +175,10 @@
        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.190",(short)(barcodeSize*12));
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.190",(short)(barcodeSize*6));
        if (result2.IsSuccess) {
            for (int i = 0; i < barcodeSize; i++) {
                String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*12,12, "UTF-8");
                String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*6,6, "UTF-8");
//                String barcode=new String(result2.Content,i*12,12);
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
                if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {