From 9ea215c6123067b28a0711c93e3a4210988245c8 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Sat, 31 Dec 2022 17:16:01 +0800 Subject: [PATCH] GX --- .../HongXiangConveyorDeviceDriver.java | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java index 1b035f16b..1affdce1e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -15,6 +15,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest; +import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.instruction.service.InstructionService; @@ -155,14 +156,20 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple currentC = this.itemProtocol.getItem_currentC(); if (mode != last_mode) { - this.setRequireSucess(false); + //this.setRequireSucess(false); } if (move != last_move) { if (move == 0) { thingToNothing(); } } - if (error != last_error) { + if (finish != last_finish) { + if (finish == 1) { + logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireSucess:" + requireSucess); + requireSucess = false; + logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireSucess:" + requireSucess); + } + logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_finish + "->" + finish); } @@ -174,10 +181,11 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple } else { if (move == 0 && last_move == 1) { - requireSucess = false; + //requireSucess = false; } - if (finish == 1 && last_finish == 0 && !requireSucess) { + if (finish == 1 && !requireSucess) { + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "开始烘箱完成反馈lms~"); //烘箱完成反馈LMS apply_finish(); } @@ -207,7 +215,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple protected void thingToNothing() { - this.setRequireSucess(false); + //this.setRequireSucess(false); } public void writing(int command) { @@ -333,8 +341,13 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple } applyLabelingAndBindingRequest.setDevice_code(start_point_code); applyLabelingAndBindingRequest.setType("3"); - acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); - requireSucess = true; + ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); + if (applyLabelingAndBindingResponse.getstatus() == 200) { + requireSucess = true; + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "烘箱完成反馈lms响应消息:" + String.valueOf(applyLabelingAndBindingResponse)); + } else { + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "烘箱完成反馈lms响应消息:" + String.valueOf(applyLabelingAndBindingResponse)); + } return true; } }