opt: 烘箱区域反馈行架调整,还原agv偏移功能

This commit is contained in:
yanps
2024-07-01 09:51:23 +08:00
parent 1f9ee5dfe7
commit 3290cc8ff9
4 changed files with 201 additions and 89 deletions

View File

@@ -62,7 +62,7 @@ public interface NDCAgvService {
* @param result
* @return
*/
public byte[] sendAgvTwoModeInst(int phase, int index, int result,int offset,int quantity);
/*public byte[] sendAgvTwoModeInst(int phase, int index, int result,int offset,int quantity);*/
/**
* 下发一号agv指令

View File

@@ -336,7 +336,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
return b;
}
@Override
/*@Override
public byte[] sendAgvTwoModeInst(int phase, int index, int result,int offset,int quantity) {
if (phase < 0 || index < 0)
return null;
@@ -368,7 +368,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
System.out.println("反馈agv动作数据:" + Bytes2HexString(b));
return b;
}
}*/
@Override

View File

@@ -23,6 +23,7 @@ import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDr
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.ranging_stations.RangingStationsDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.waste_foil_weighing_station.WasteFoilWeighingStationDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
@@ -266,7 +267,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -286,7 +287,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -304,23 +305,47 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1
&& standardInspectSiteDeviceDriver.getError() == 0)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction()
, standardInspectSiteDeviceDriver.getError(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(message)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String region = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("region");
if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) {
String linkDeviceCode = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("link_device_code");
Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);
if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver();
String s = Integer.parseInt(region) == 2 ? "one" : Integer.parseInt(region) == 6 ?
"two" : Integer.parseInt(region) == 8 ? "three" : null;
Class<? extends OvenGantryManipulatorDeviceDriver> aClass = hxhj.getClass();
String regionCode = "region_" + s;
if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) {
hxhj.writing("to_" + regionCode, region);
log.info("下发AGV进入区域{}信号值为:{}", s, region);
} else {
log.info("区域{}信号{}未清除,导致不满足下发AGV进入区域信号", s, regionCode);
}
if (hxhj.getMode() == 2 && StrUtil.isNotEmpty(region) && ((Integer) aClass.getField(regionCode).get(hxhj) == Integer.parseInt(region))) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.error("AGV进入区域{}信号{}行架未接收{},请检查;或行架正在执行中:{}", region, regionCode, Integer.parseInt(region), hxhj.getMode());
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else {
message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction()
, standardInspectSiteDeviceDriver.getError(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(message)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
}
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
@@ -331,7 +356,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -356,7 +381,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if (hongXiangStationDeviceDriver.getMove() > 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -383,7 +408,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -401,7 +426,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
}/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
String device_code1 = device.getDevice_code();
@@ -458,7 +483,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else {
log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey);
}
} else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
}*/ else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
if (wasteFoilWeighingStationDriver.getMove() == 1 && wasteFoilWeighingStationDriver.getAction() == 1
&& wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2) {
@@ -466,7 +491,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", "2");
wasteFoilWeighingStationDriver.writing(map);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -488,7 +513,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -554,7 +579,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
&& StrUtil.equals("true", this.device.getExtraValue().get("wait").toString())
&& StrUtil.equals(task.getTask_type(), "1")) {
standardOrdinarySiteDeviceDriver.setOption(0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -562,7 +587,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -572,13 +597,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
String task_code = inst.getTask_code();
EXECUTOR.submit(() -> {
if(ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())){
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("task_code", task_code);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(standardOrdinarySiteDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -593,7 +618,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
e.printStackTrace();
}
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -602,13 +627,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
luceneExecuteLogService.deviceExecuteLog(logDto);
String task_code = inst.getTask_code();
EXECUTOR.submit(() -> {
if(ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())){
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("task_code", task_code);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
@@ -623,7 +648,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if (hongXiangStationDeviceDriver.getMove() > 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -650,7 +675,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -677,13 +702,37 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if ((standardInspectSiteDeviceDriver.getMove() != 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String region = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("region");
if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) {
String linkDeviceCode = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("link_device_code");
Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);
if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver();
String s = Integer.parseInt(region) == 2 ? "one" : Integer.parseInt(region) == 6 ?
"two" : Integer.parseInt(region) == 8 ? "three" : null;
Class<? extends OvenGantryManipulatorDeviceDriver> aClass = hxhj.getClass();
String regionCode = "region_" + s;
if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) != 0)) {
hxhj.writing("to_"+regionCode, "0");
log.info("下发AGV离开区域{}信号值为:{}", region, 0);
} else {
log.info("区域{}信号{}为0,不需要下发AGV离开区域信号", s, regionCode);
}
if (hxhj.getMode() == 2 && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.error("AGV离开区域{}信号{}行架未接收0,请检查;或行架正在执行中:{}", s, regionCode, hxhj.getMode());
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
}
} else {
message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction()
@@ -703,7 +752,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", "3");
wasteFoilWeighingStationDriver.writing(map);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -725,7 +774,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -795,7 +844,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -815,7 +864,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -832,7 +881,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -858,7 +907,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -884,7 +933,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if (hongXiangStationDeviceDriver.getMove() > 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -911,7 +960,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -929,7 +978,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
}/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
String device_code1 = device.getDevice_code();
@@ -980,8 +1029,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else {
log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
}*/ else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1240,7 +1289,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1260,7 +1309,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1287,7 +1336,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1312,7 +1361,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if (hongXiangStationDeviceDriver.getMove() == 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1334,7 +1383,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.writing(1);
if ((standardInspectSiteDeviceDriver.getMove() == 0 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1352,7 +1401,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
}/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
String device_code1 = device.getDevice_code();
@@ -1403,7 +1452,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else {
log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey);
}
} else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
}*/ else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
if (wasteFoilWeighingStationDriver.getMove() == 0 && wasteFoilWeighingStationDriver.getAction() == 1
&& wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2) {
@@ -1411,7 +1460,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", "4");
wasteFoilWeighingStationDriver.writing(map);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1433,7 +1482,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1497,7 +1546,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
// } else {
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
// }
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1513,7 +1562,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
e.printStackTrace();
}
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1528,7 +1577,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if (hongXiangStationDeviceDriver.getMove() > 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1571,7 +1620,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1594,13 +1643,37 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.writing(0);
if ((standardInspectSiteDeviceDriver.getMove() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String region = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("region");
if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) {
String linkDeviceCode = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("link_device_code");
Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);
if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver();
String s = Integer.parseInt(region) == 2 ? "one" : Integer.parseInt(region) == 6 ?
"two" : Integer.parseInt(region) == 8 ? "three" : null;
Class<? extends OvenGantryManipulatorDeviceDriver> aClass = hxhj.getClass();
String regionCode = "region_" + s;
if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) != 0)) {
hxhj.writing("to_"+ regionCode, "0");
log.info("下发AGV离开区域{}信号值为:{}", region, 0);
} else {
log.info("区域{}信号{}为0,不需要下发AGV离开区域信号", s, regionCode);
}
if (hxhj.getMode() == 2 && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.error("AGV离开区域{}信号{}行架未接收0,请检查;或行架正在执行中:{}", s, regionCode, hxhj.getMode());
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
}
}
} else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
@@ -1610,7 +1683,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", "5");
wasteFoilWeighingStationDriver.writing(map);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1632,7 +1705,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1698,7 +1771,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
// } else {
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
// }
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1716,7 +1789,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1741,7 +1814,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e.printStackTrace();
}
if (hongXiangStationDeviceDriver.getMove() == 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1768,7 +1841,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)
@@ -1786,7 +1859,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
}/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
String device_code1 = device.getDevice_code();
@@ -1843,8 +1916,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else {
log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
}*/ else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "反馈:" + data)