|
@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.nl.acs.agv.XgAgvEnum; |
|
|
import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; |
|
|
import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; |
|
|
import org.nl.acs.device_driver.sdk.PhotoelectricDetectionDeviceDriver; |
|
|
import org.nl.acs.device_driver.sdk.PhotoelectricDetectionDeviceDriver; |
|
|
import org.nl.acs.log.service.DeviceExecuteLogService; |
|
|
import org.nl.acs.log.service.DeviceExecuteLogService; |
|
@ -44,9 +45,9 @@ public class AgvWaitUtil { |
|
|
// 标准版输送线驱动
|
|
|
// 标准版输送线驱动
|
|
|
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|
|
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|
|
// 通知输送线申请取货-1
|
|
|
// 通知输送线申请取货-1
|
|
|
driver.writing("toCommand",1); |
|
|
driver.writing("toCommand",XgAgvEnum.APPLY_GET.getCode()); |
|
|
// 判断是否满足条件:action = 1(允许取货) && move = 1(有货)
|
|
|
// 判断是否满足条件:action = 1(允许取货) && move = 1(有货)
|
|
|
if (driver.getMove() == 1 && driver.getAction() == 1) { |
|
|
if (driver.getMove() == XgAgvEnum.SSX_ACTION_GET.getCode() && driver.getAction() == XgAgvEnum.SSX_MOVE_NO.getCode()) { |
|
|
String message = "允许AGV取货。"; |
|
|
String message = "允许AGV取货。"; |
|
|
driver.setMessage(message); |
|
|
driver.setMessage(message); |
|
|
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message); |
|
|
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message); |
|
@ -83,8 +84,8 @@ public class AgvWaitUtil { |
|
|
// 标准版输送线驱动
|
|
|
// 标准版输送线驱动
|
|
|
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|
|
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|
|
// 通知输送线取货完成-2
|
|
|
// 通知输送线取货完成-2
|
|
|
driver.writing("toCommand",2); |
|
|
driver.writing("toCommand",XgAgvEnum.APPLY_GET_SUCCESS.getCode()); |
|
|
if (driver.getMove() == 0) { |
|
|
if (driver.getMove() == XgAgvEnum.SSX_MOVE_YES.getCode()) { |
|
|
String message = "允许AGV取货后离开。"; |
|
|
String message = "允许AGV取货后离开。"; |
|
|
driver.setMessage(message); |
|
|
driver.setMessage(message); |
|
|
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message); |
|
|
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message); |
|
@ -123,9 +124,9 @@ public class AgvWaitUtil { |
|
|
// 标准版输送线驱动
|
|
|
// 标准版输送线驱动
|
|
|
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|
|
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|
|
// 通知输送线申请放货-3
|
|
|
// 通知输送线申请放货-3
|
|
|
driver.writing("toCommand",3); |
|
|
driver.writing("toCommand",XgAgvEnum.APPLY_PUT.getCode()); |
|
|
// 判断是否满足条件:action = 2(允许放货) && move = 0(无货)
|
|
|
// 判断是否满足条件:action = 2(允许放货) && move = 0(无货)
|
|
|
if (driver.getMove() == 0 && driver.getAction() == 2) { |
|
|
if (driver.getMove() == XgAgvEnum.SSX_MOVE_YES.getCode() && driver.getAction() == XgAgvEnum.SSX_ACTION_PUT.getCode()) { |
|
|
String message = "允许AGV放货。"; |
|
|
String message = "允许AGV放货。"; |
|
|
driver.setMessage(message); |
|
|
driver.setMessage(message); |
|
|
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message); |
|
|
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message); |
|
@ -170,8 +171,8 @@ public class AgvWaitUtil { |
|
|
// 标准版输送线驱动
|
|
|
// 标准版输送线驱动
|
|
|
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|
|
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); |
|
|
// 通知输送线放货完成-4
|
|
|
// 通知输送线放货完成-4
|
|
|
driver.writing("toCommand",4); |
|
|
driver.writing("toCommand",XgAgvEnum.APPLY_PUT_SUCCESS.getCode()); |
|
|
if (driver.getMove() == 1) { |
|
|
if (driver.getMove() == XgAgvEnum.SSX_MOVE_NO.getCode()) { |
|
|
String message = "允许AGV放货后离开。"; |
|
|
String message = "允许AGV放货后离开。"; |
|
|
driver.setMessage(message); |
|
|
driver.setMessage(message); |
|
|
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message); |
|
|
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message); |
|
|