|
|
@ -2,6 +2,7 @@ package org.nl.acs.device_driver.basedriver.agv.ndcone; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import lombok.Data; |
|
|
@ -39,7 +40,9 @@ import org.nl.acs.opc.DeviceAppService; |
|
|
|
import org.nl.acs.task.service.TaskService; |
|
|
|
import org.nl.acs.task.service.dto.TaskDto; |
|
|
|
import org.nl.acs.task.service.impl.TaskServiceImpl; |
|
|
|
|
|
|
|
import org.nl.modules.lucene.service.LuceneExecuteLogService; |
|
|
|
import org.nl.modules.lucene.service.dto.LuceneLogDto; |
|
|
|
import org.nl.modules.system.service.ParamService; |
|
|
|
import org.nl.modules.system.service.impl.ParamServiceImpl; |
|
|
|
import org.nl.modules.wql.util.SpringContextHolder; |
|
|
@ -64,14 +67,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
TaskService taskService=SpringContextHolder.getBean(TaskServiceImpl.class); |
|
|
|
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); |
|
|
|
NDCAgvService NDCAgvService = SpringContextHolder.getBean(NDCAgvService.class); |
|
|
|
DeviceExecuteLogService lucene = SpringContextHolder.getBean(DeviceExecuteLogService.class); |
|
|
|
DeviceExecuteLogService logService = SpringContextHolder.getBean(DeviceExecuteLogService.class); |
|
|
|
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); |
|
|
|
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); |
|
|
|
NDCAgvService AgvService = SpringContextHolder.getBean(NDCAgvService.class); |
|
|
|
OneAgvPhase oneAgvPhase = new OneAgvPhase(); |
|
|
|
ParamService acsConfigService = SpringContextHolder.getBean(ParamServiceImpl.class); |
|
|
|
WmsToAcsService wmsToAcsService=SpringContextHolder.getBean(WmsToAcsService.class); |
|
|
|
|
|
|
|
LuceneExecuteLogService lucene = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); |
|
|
|
|
|
|
|
int agvaddr = 0; |
|
|
|
int agvaddr_copy = 0; |
|
|
@ -87,6 +90,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
int status = 0; //三色灯状态
|
|
|
|
int error = 0; |
|
|
|
int last_error = 0; |
|
|
|
|
|
|
|
String error_message = ""; |
|
|
|
boolean flag = false; |
|
|
|
|
|
|
@ -114,7 +118,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
agvaddr = arr[18] * 256 + arr[19]; |
|
|
|
//车号
|
|
|
|
int carno = arr[20]; |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "接收agv上报信息:" + "phase--" + phase + " index--" + index + " 指令号--" + ikey + " 站点号--" + agvaddr + " 车号--" + carno); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "接收agv上报信息:" + "phase--" + phase + " index--" + index + " 指令号--" + ikey + " 站点号--" + agvaddr + " 车号--" + carno); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "接收agv上报信息:" + "phase--" + phase + " index--" + index + " 指令号--" + ikey + " 站点号--" + agvaddr + " 车号--" + carno)); |
|
|
|
Instruction link_inst = null; |
|
|
|
List<Instruction> insts = null; |
|
|
|
Instruction inst = null; |
|
|
@ -170,8 +175,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
if (phase == 0x02) { |
|
|
|
inst.setCarno(String.valueOf(carno)); |
|
|
|
instructionService.update(inst); |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈车号:" + carno + ",指令号:" + ikey); |
|
|
|
|
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈车号:" + carno + ",指令号:" + ikey); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agvphase:" + phase + "反馈车号:" + carno + ",指令号:" + ikey)); |
|
|
|
//到达取货点
|
|
|
|
//(需要WCS反馈)
|
|
|
|
} else if (phase == 0x03) { |
|
|
@ -179,14 +184,16 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(inst)) { |
|
|
|
log.info("未找到指令:" + ikey); |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "未找到指令 [" + ikey + "]")); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (agvaddr == 0) { |
|
|
|
agvaddr = agvaddr_copy; |
|
|
|
} |
|
|
|
if (agvaddr < 1) { |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agv地址参数有误,phase:" + phase)); |
|
|
|
return; |
|
|
|
} |
|
|
|
device_code = deviceService.queryDeviceCodeByAddress(agvaddr); |
|
|
@ -207,14 +214,16 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (ObjectUtil.isEmpty(device_code)) { |
|
|
|
log.info(agvaddr + "对应设备号为空!"); |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", agvaddr + "对应设备号为空"); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", agvaddr + "对应设备号为空"); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, agvaddr + "对应设备号为空")); |
|
|
|
return; |
|
|
|
} |
|
|
|
//校验agv上报站点编号与指令起始点相同
|
|
|
|
if (ObjectUtil.isEmpty(inst)) { |
|
|
|
log.info("未找到编号{}对应的指令", ikey); |
|
|
|
agv_message = "未找到编号"+ikey +"对应的指令"; |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "未找到关联编号对应的指令" + ikey)); |
|
|
|
return; |
|
|
|
} |
|
|
|
//标准版-机械手对接位
|
|
|
@ -248,7 +257,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV取货。"; |
|
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
|
agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-工位(交互模板)
|
|
|
@ -282,7 +292,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV取货。"; |
|
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
|
agv_message = lnshStationDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-压制对接位
|
|
|
@ -294,6 +305,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
&& (conveyorPressStationDeviceDriver.getIo_action() == 3 || conveyorPressStationDeviceDriver.getIo_action() == 1) |
|
|
|
&& (conveyorPressStationDeviceDriver.getAction() == 3 || conveyorPressStationDeviceDriver.getAction() == 1)) { |
|
|
|
data = AgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
conveyorPressStationDeviceDriver.writing(2); |
|
|
|
conveyorPressStationDeviceDriver.setMessage(""); |
|
|
|
flag = true; |
|
|
|
} else { |
|
|
@ -314,7 +326,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV取货。"; |
|
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
|
agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//普通站点
|
|
|
@ -331,7 +344,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
data = AgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
flag = true; |
|
|
|
} else { |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}无货,无法反馈"); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}无货,无法反馈"); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "AGV请求取货设备{}无货,无法反馈")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -346,6 +360,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
instructionService.update(inst); |
|
|
|
data = AgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
conveyorBarcodeDeviceDriver.setMessage(""); |
|
|
|
conveyorBarcodeDeviceDriver.writing(2); |
|
|
|
flag = true; |
|
|
|
} else { |
|
|
|
String message = ""; |
|
|
@ -359,7 +374,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV取货。"; |
|
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
|
agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-叠盘机 LnshFoldDiscSiteDeviceDriverl
|
|
|
@ -372,6 +388,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
// && (lnshFoldDiscSiteDeviceDriver.getAction() == 3 || lnshFoldDiscSiteDeviceDriver.getAction() == 1)
|
|
|
|
inst.setExecute_status("1"); |
|
|
|
instructionService.update(inst); |
|
|
|
lnshFoldDiscSiteDeviceDriver.writing(2); |
|
|
|
data = AgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(""); |
|
|
|
flag = true; |
|
|
@ -393,7 +410,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV取货。"; |
|
|
|
agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; |
|
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -409,7 +427,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} |
|
|
|
if (flag) { |
|
|
|
log.info("==================允许AGV取货=================="); |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", "允许AGV取货。"); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", "允许AGV取货。"); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "允许AGV取货。")); |
|
|
|
} |
|
|
|
//取货完毕
|
|
|
|
//(需要WCS反馈)
|
|
|
@ -417,14 +436,16 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
log.info("================AGV取货完成请求离开================"); |
|
|
|
if (ObjectUtil.isEmpty(inst)) { |
|
|
|
log.info("未找到指令:" + ikey); |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "未找到指令 [" + ikey + "]")); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (agvaddr == 0) { |
|
|
|
agvaddr = agvaddr_copy; |
|
|
|
} |
|
|
|
if (agvaddr < 1) { |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agv地址参数有误,phase:" + phase)); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (agvaddr != 0) { |
|
|
@ -444,13 +465,15 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(device_code)) { |
|
|
|
log.info(agvaddr + "对应设备号为空!"); |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "对应设备号为空" + device_code); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "对应设备号为空" + device_code); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "对应设备号为空" + device_code)); |
|
|
|
return; |
|
|
|
} |
|
|
|
//校验agv上报站点编号与指令起始点相同
|
|
|
|
if (ObjectUtil.isEmpty(inst)) { |
|
|
|
log.info("未找到关联编号{}对应的指令", ikey); |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "未找到关联编号对应的指令" + ikey)); |
|
|
|
return; |
|
|
|
} |
|
|
|
//标准版-机械手对接位
|
|
|
@ -481,13 +504,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV取货后离开。"; |
|
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
|
agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-工位(交互模板) LnshStationDeviceDriver
|
|
|
|
if(device.getDeviceDriver() instanceof LnshStationDeviceDriver){ |
|
|
|
lnshStationDeviceDriver = (LnshStationDeviceDriver) device.getDeviceDriver(); |
|
|
|
lnshStationDeviceDriver.writing(5); |
|
|
|
lnshStationDeviceDriver.writing(3); |
|
|
|
if (lnshStationDeviceDriver.getMode() != 0 |
|
|
|
&& lnshStationDeviceDriver.getMove() == 0 |
|
|
|
&& (lnshStationDeviceDriver.getIo_action() == 3 || lnshStationDeviceDriver.getIo_action() == 2) |
|
|
@ -512,13 +536,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV取货后离开。"; |
|
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
|
agv_message = lnshStationDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-压制对接位
|
|
|
|
if(device.getDeviceDriver() instanceof ConveyorPressStationDeviceDriver){ |
|
|
|
conveyorPressStationDeviceDriver = (ConveyorPressStationDeviceDriver) device.getDeviceDriver(); |
|
|
|
conveyorPressStationDeviceDriver.writing(2); |
|
|
|
conveyorPressStationDeviceDriver.writing(3); |
|
|
|
if (conveyorPressStationDeviceDriver.getMode() != 0 |
|
|
|
&& conveyorPressStationDeviceDriver.getMove() == 0 |
|
|
|
&& (conveyorPressStationDeviceDriver.getIo_action() == 3 || conveyorPressStationDeviceDriver.getIo_action() == 2) |
|
|
@ -543,7 +568,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV取货后离开。"; |
|
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
|
agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//普通站点
|
|
|
@ -565,7 +591,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
//标准版-下发条码输送线
|
|
|
|
if(device.getDeviceDriver() instanceof ConveyorBarcodeDeviceDriver){ |
|
|
|
conveyorBarcodeDeviceDriver = (ConveyorBarcodeDeviceDriver) device.getDeviceDriver(); |
|
|
|
conveyorBarcodeDeviceDriver.writing(5); |
|
|
|
conveyorBarcodeDeviceDriver.writing(3); |
|
|
|
if (conveyorBarcodeDeviceDriver.getMode() != 0) { |
|
|
|
inst.setExecute_status("5"); |
|
|
|
instructionService.update(inst); |
|
|
@ -587,13 +613,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV取货后离开。"; |
|
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
|
agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-叠盘机
|
|
|
|
if(device.getDeviceDriver() instanceof LnshFoldDiscSiteDeviceDriver){ |
|
|
|
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
lnshFoldDiscSiteDeviceDriver.writing(5); |
|
|
|
lnshFoldDiscSiteDeviceDriver.writing(3); |
|
|
|
if (lnshFoldDiscSiteDeviceDriver.getMode() != 0 |
|
|
|
// && lnshFoldDiscSiteDeviceDriver.getContainer_qty() == 0
|
|
|
|
// && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 3 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 2)
|
|
|
@ -618,7 +645,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV取货后离开。"; |
|
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
|
agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StrUtil.equals(inst.getStart_device_code(), device_code)) { |
|
|
@ -637,7 +665,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
|
|
|
|
} |
|
|
|
if (ObjectUtil.isNotEmpty(data)) { |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data)); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data)); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agvphase:" + phase + "反馈:" + Bytes2HexString(data))); |
|
|
|
} |
|
|
|
// if (flag) {
|
|
|
|
// String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue();
|
|
|
@ -650,14 +679,15 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
// ar.add(param);
|
|
|
|
// acsToWmsService.feedbackTaskStatusToWms(ar);
|
|
|
|
// } catch (Exception e) {
|
|
|
|
// lucene.deviceExecuteLog(device_code, "", "", "AGV取货完成离开后,反馈上位系统失败!");
|
|
|
|
// logService.deviceExecuteLog(device_code, "", "", "AGV取货完成离开后,反馈上位系统失败!");
|
|
|
|
// e.printStackTrace();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
if (flag) { |
|
|
|
log.info("================允许AGV取货后离开================="); |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", "允许AGV取货后离开。"); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", "允许AGV取货后离开。"); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "允许AGV取货后离开。")); |
|
|
|
} |
|
|
|
//到达放货点
|
|
|
|
//(需要WCS反馈)
|
|
|
@ -665,14 +695,16 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
log.info("==================AGV请求放货=================="); |
|
|
|
if (ObjectUtil.isEmpty(inst)) { |
|
|
|
log.info("未找到指令:" + ikey); |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "未找到指令 [" + ikey + "]")); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (agvaddr == 0) { |
|
|
|
agvaddr = agvaddr_copy; |
|
|
|
} |
|
|
|
if (agvaddr < 1) { |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agv地址参数有误,phase:" + phase)); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (agvaddr != 0) { |
|
|
@ -729,7 +761,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV放货。"; |
|
|
|
agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; |
|
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-工位(交互模板)
|
|
|
@ -763,7 +796,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV放货。"; |
|
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
|
agv_message = lnshStationDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-压制对接位
|
|
|
@ -797,7 +831,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV放货。"; |
|
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
|
agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//普通站点
|
|
|
@ -839,7 +874,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV放货。"; |
|
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
|
agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-叠盘机
|
|
|
@ -874,7 +910,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV放货。"; |
|
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
|
agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StrUtil.equals(inst.getNext_device_code(), device_code)) { |
|
|
@ -892,7 +929,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} |
|
|
|
if (flag) { |
|
|
|
log.info("==================允许AGV放货=================="); |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", "允许AGV放货。"); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", "允许AGV放货。"); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "允许AGV放货。")); |
|
|
|
} |
|
|
|
|
|
|
|
//放货完毕
|
|
|
@ -901,14 +939,16 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
log.info("================AGV放货完成请求离开================"); |
|
|
|
if (ObjectUtil.isEmpty(inst)) { |
|
|
|
log.info("未找到指令:" + ikey); |
|
|
|
lucene.deviceExecuteLog("未找到指令号对应的指令:", "", "", String.valueOf(ikey)); |
|
|
|
logService.deviceExecuteLog("未找到指令号对应的指令:", "", "", String.valueOf(ikey)); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, String.valueOf(ikey))); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (agvaddr == 0) { |
|
|
|
agvaddr = agvaddr_copy; |
|
|
|
} |
|
|
|
if (agvaddr < 1) { |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "agv地址参数有误,phase:" + phase); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agv地址参数有误,phase:" + phase)); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (agvaddr != 0) { |
|
|
@ -962,7 +1002,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV放货后离开。"; |
|
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
|
agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-工位(交互模板)
|
|
|
@ -992,7 +1033,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV放货后离开。"; |
|
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
|
agv_message = lnshStationDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-压制对接位(需要给电气目标站)
|
|
|
@ -1037,7 +1079,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV放货后离开。"; |
|
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
|
agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//普通站点
|
|
|
@ -1082,7 +1125,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV放货后离开。"; |
|
|
|
agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; |
|
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//标准版-叠盘机
|
|
|
@ -1113,12 +1157,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
message += "不允许AGV放货后离开。"; |
|
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
|
agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", message); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", message); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (flag) { |
|
|
|
log.info("================允许AGV放货后离开================="); |
|
|
|
lucene.deviceExecuteLog(device_code, "", "", "允许AGV放货后离开。"); |
|
|
|
logService.deviceExecuteLog(device_code, "", "", "允许AGV放货后离开。"); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "允许AGV放货后离开。")); |
|
|
|
} |
|
|
|
} |
|
|
|
//到达位置点
|
|
|
@ -1162,7 +1208,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} |
|
|
|
if (!ObjectUtil.isEmpty(data)) { |
|
|
|
phase = 0; |
|
|
|
lucene.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data)); |
|
|
|
logService.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data)); |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "agvphase:" + phase + "反馈:" + Bytes2HexString(data))); |
|
|
|
NDCSocketConnectionAutoRun.write(data); |
|
|
|
} |
|
|
|
|
|
|
|