rev:删除agv进出自动门对烘箱逻辑判断
This commit is contained in:
@@ -243,34 +243,34 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
if (ObjectUtil.isNotEmpty(device)) {
|
if (ObjectUtil.isNotEmpty(device)) {
|
||||||
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
||||||
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
|
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
|
||||||
String region = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("region");
|
// String region = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("region");
|
||||||
if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) {
|
// if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) {
|
||||||
String linkDeviceCode = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("link_device_code");
|
// String linkDeviceCode = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("link_device_code");
|
||||||
Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);
|
// Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);
|
||||||
if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
|
// if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
|
||||||
OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver();
|
// OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver();
|
||||||
String s = Integer.parseInt(region) == 1 ? "one" : Integer.parseInt(region) == 2 ?
|
// String s = Integer.parseInt(region) == 1 ? "one" : Integer.parseInt(region) == 2 ?
|
||||||
"two" : Integer.parseInt(region) == 3 ? "three" : null;
|
// "two" : Integer.parseInt(region) == 3 ? "three" : null;
|
||||||
Class<? extends OvenGantryManipulatorDeviceDriver> aClass = hxhj.getClass();
|
// Class<? extends OvenGantryManipulatorDeviceDriver> aClass = hxhj.getClass();
|
||||||
String regionCode = "region_" + s;
|
// String regionCode = "region_" + s;
|
||||||
String s1 = Integer.parseInt(region) == 1 ? "2" : Integer.parseInt(region) == 2 ?
|
// String s1 = Integer.parseInt(region) == 1 ? "2" : Integer.parseInt(region) == 2 ?
|
||||||
"6" : Integer.parseInt(region) == 3 ? "8" : null;
|
// "6" : Integer.parseInt(region) == 3 ? "8" : null;
|
||||||
if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) {
|
// if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) {
|
||||||
hxhj.writing("to_"+regionCode, s1);
|
// hxhj.writing("to_"+regionCode, s1);
|
||||||
log.info("下发AGV进入区域{}信号值为:{}", region, s1);
|
// log.info("下发AGV进入区域{}信号值为:{}", region, s1);
|
||||||
} else {
|
// } else {
|
||||||
log.info("区域{}信号{}未清除,导致不满足下发AGV进入区域信号", region, regionCode);
|
// log.info("区域{}信号{}未清除,导致不满足下发AGV进入区域信号", region, regionCode);
|
||||||
}
|
// }
|
||||||
if (hxhj.getMode() == 2 && StrUtil.isNotEmpty(s1) && ((Integer) aClass.getField(regionCode).get(hxhj) == 2)) {
|
// if (hxhj.getMode() == 2 && StrUtil.isNotEmpty(s1) && ((Integer) aClass.getField(regionCode).get(hxhj) == 2)) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
requireSucessRegion = true;
|
// requireSucessRegion = true;
|
||||||
} else {
|
// } else {
|
||||||
log.error("AGV进入区域{}信号{}行架未接收{},请检查;或行架正在执行中:{}", region, regionCode,s1, hxhj.getMode());
|
// log.error("AGV进入区域{}信号{}行架未接收{},请检查;或行架正在执行中:{}", region, regionCode,s1, hxhj.getMode());
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
log.error("未设置关联设备或关联的不是烘箱行架设备{}导致信号未反馈", linkDeviceCode);
|
// log.error("未设置关联设备或关联的不是烘箱行架设备{}导致信号未反馈", linkDeviceCode);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
try {
|
try {
|
||||||
standardAutodoorDeviceDriver.writing("to_open", "1");
|
standardAutodoorDeviceDriver.writing("to_open", "1");
|
||||||
standardAutodoorDeviceDriver.writing("to_close", "0");
|
standardAutodoorDeviceDriver.writing("to_close", "0");
|
||||||
@@ -285,7 +285,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
log.info("未下发NDC信号原因: 下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose());
|
log.info("未下发NDC信号原因: 下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
log.info(agvaddr + "对应设备号为空!");
|
log.info(agvaddr + "对应设备号为空!");
|
||||||
}
|
}
|
||||||
@@ -298,37 +298,37 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
if (ObjectUtil.isNotEmpty(device)) {
|
if (ObjectUtil.isNotEmpty(device)) {
|
||||||
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
||||||
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
|
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
|
||||||
String region = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("region");
|
// String region = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("region");
|
||||||
if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) {
|
// if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) {
|
||||||
String linkDeviceCode = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("link_device_code");
|
// String linkDeviceCode = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("link_device_code");
|
||||||
if(requireSucessTake || requireSucessPut){
|
// if(requireSucessTake || requireSucessPut){
|
||||||
Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);
|
// Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);
|
||||||
if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
|
// if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
|
||||||
OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver();
|
// OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver();
|
||||||
String s = Integer.parseInt(region) == 1 ? "one" : Integer.parseInt(region) == 2 ?
|
// String s = Integer.parseInt(region) == 1 ? "one" : Integer.parseInt(region) == 2 ?
|
||||||
"two" : Integer.parseInt(region) == 3 ? "three" : null;
|
// "two" : Integer.parseInt(region) == 3 ? "three" : null;
|
||||||
Class<? extends OvenGantryManipulatorDeviceDriver> aClass = hxhj.getClass();
|
// Class<? extends OvenGantryManipulatorDeviceDriver> aClass = hxhj.getClass();
|
||||||
String regionCode = "region_" + s;
|
// String regionCode = "region_" + s;
|
||||||
if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) != 0)) {
|
// if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) != 0)) {
|
||||||
hxhj.writing("to_"+regionCode, "0");
|
// hxhj.writing("to_"+regionCode, "0");
|
||||||
log.info("下发AGV离开区域{}信号值为:{}", region, 0);
|
// log.info("下发AGV离开区域{}信号值为:{}", region, 0);
|
||||||
} else {
|
// } else {
|
||||||
log.info("区域{}信号{}为0,不需要下发AGV离开区域信号", region, regionCode);
|
// log.info("区域{}信号{}为0,不需要下发AGV离开区域信号", region, regionCode);
|
||||||
}
|
// }
|
||||||
if (hxhj.getMode() == 2 && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) {
|
// if (hxhj.getMode() == 2 && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
requireSucessPut = false;
|
// requireSucessPut = false;
|
||||||
requireSucessTake = false;
|
// requireSucessTake = false;
|
||||||
} else {
|
// } else {
|
||||||
log.error("AGV离开区域{}信号{}行架未接收0,请检查;或行架正在执行中:{}", region, regionCode, hxhj.getMode());
|
// log.error("AGV离开区域{}信号{}行架未接收0,请检查;或行架正在执行中:{}", region, regionCode, hxhj.getMode());
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
log.error("未设置关联设备或关联的不是烘箱行架设备{}导致信号未反馈", linkDeviceCode);
|
// log.error("未设置关联设备或关联的不是烘箱行架设备{}导致信号未反馈", linkDeviceCode);
|
||||||
}
|
// }
|
||||||
}else{
|
// }else{
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
try {
|
try {
|
||||||
standardAutodoorDeviceDriver.writing("to_close", "1");
|
standardAutodoorDeviceDriver.writing("to_close", "1");
|
||||||
standardAutodoorDeviceDriver.writing("to_open", "0");
|
standardAutodoorDeviceDriver.writing("to_open", "0");
|
||||||
@@ -338,7 +338,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
}
|
}
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
log.info(device_code + "对应设备号为空!");
|
log.info(device_code + "对应设备号为空!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user