|
|
@ -46,6 +46,7 @@ import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
|
|
|
|
/** |
|
|
|
* NDC单工位AGV |
|
|
@ -180,9 +181,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
PlcToAgvDeviceDriver plcToAgvDeviceDriver = (PlcToAgvDeviceDriver) device.getDeviceDriver(); |
|
|
|
Map<String, Object> extraValue = plcToAgvDeviceDriver.getExtraValue(); |
|
|
|
if (plcToAgvDeviceDriver.getAGVEnable() != 0) { |
|
|
|
/*if (device_code.contains("_01")) { |
|
|
|
if (device_code.contains("_01")) { |
|
|
|
if (plcToAgvDeviceDriver.getAGVSetOutUpperAllowed() == 1) { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0); |
|
|
|
data = feedBackStatus(data, index, 1, inst, task, 2, false); |
|
|
|
} |
|
|
|
} else if (device_code.contains("_02")) { |
|
|
|
Object plc_to_agv = extraValue.get("upper_lower_levels"); |
|
|
@ -193,8 +194,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
data = feedBackStatus(data, index, 1, inst, task, 2, false); |
|
|
|
} |
|
|
|
} |
|
|
|
} else */ |
|
|
|
if (ObjectUtil.isNotEmpty(extraValue.get("upper_lower_levels"))) { |
|
|
|
} else if (ObjectUtil.isNotEmpty(extraValue.get("upper_lower_levels"))) { |
|
|
|
Object plc_to_agv = extraValue.get("upper_lower_levels"); |
|
|
|
if ("1".equals(plc_to_agv)) { |
|
|
|
plcToAgvDeviceDriver.writing("AGVSetOutReqUpper", "1"); |
|
|
@ -257,7 +257,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} |
|
|
|
if (device.getDeviceDriver() instanceof PlcToAgvDeviceDriver) { |
|
|
|
PlcToAgvDeviceDriver plcToAgvDeviceDriver = (PlcToAgvDeviceDriver) device.getDeviceDriver(); |
|
|
|
/*if (device_code.contains("_01")) { |
|
|
|
if (device_code.contains("_01")) { |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
|
try { |
|
|
|
List list = new ArrayList<>(); |
|
|
|
Map map = new HashMap(); |
|
|
@ -276,10 +277,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} catch (Exception e) { |
|
|
|
log.info("下发AGVInOP信号:{}失败", "0"); |
|
|
|
} |
|
|
|
}); |
|
|
|
data = feedBackStatus(data, index, 2, inst, task, 2, false); |
|
|
|
} else if (device_code.contains("_02")) { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0); |
|
|
|
} else {*/ |
|
|
|
data = feedBackStatus(data, index, 2, inst, task, 2, false); |
|
|
|
} else { |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
|
try { |
|
|
|
List list = new ArrayList<>(); |
|
|
|
Map map = new HashMap(); |
|
|
@ -298,8 +301,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} catch (Exception e) { |
|
|
|
log.info("下发AGVInOP信号:{}失败", "0"); |
|
|
|
} |
|
|
|
}); |
|
|
|
data = feedBackStatus(data, index, 2, inst, task, 2, false); |
|
|
|
/*}*/ |
|
|
|
} |
|
|
|
} else if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
try { |
|
|
|
data = feedBackStatus(data, index, 2, inst, task, 1, false); |
|
|
@ -341,7 +345,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
PlcToAgvDeviceDriver plcToAgvDeviceDriver = (PlcToAgvDeviceDriver) device.getDeviceDriver(); |
|
|
|
if (plcToAgvDeviceDriver.getAGVEnable() != 0) { |
|
|
|
Map<String, Object> extraValue = plcToAgvDeviceDriver.getExtraValue(); |
|
|
|
/*if (device_code.contains("_01")) { |
|
|
|
if (device_code.contains("_01")) { |
|
|
|
Object plc_to_agv = extraValue.get("upper_lower_levels"); |
|
|
|
if (ObjectUtil.isNotNull(plc_to_agv) && "1".equals(plc_to_agv)) { |
|
|
|
plcToAgvDeviceDriver.writing("AGVSetInReqUpper", "1"); |
|
|
@ -352,10 +356,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} |
|
|
|
} else if (device_code.contains("_02")) { |
|
|
|
if (plcToAgvDeviceDriver.getAGVSetInUpperAllowed() == 1) { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0); |
|
|
|
data = feedBackStatus(data, index, 3, inst, task, 2, false); |
|
|
|
} |
|
|
|
} else */ |
|
|
|
if (ObjectUtil.isNotEmpty(extraValue.get("upper_lower_levels"))) { |
|
|
|
} else if (ObjectUtil.isNotEmpty(extraValue.get("upper_lower_levels"))) { |
|
|
|
Object plc_to_agv = extraValue.get("upper_lower_levels"); |
|
|
|
if ("1".equals(plc_to_agv)) { |
|
|
|
plcToAgvDeviceDriver.writing("AGVSetInReqUpper", "1"); |
|
|
@ -424,9 +427,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
transportOrder = ""; |
|
|
|
if (device.getDeviceDriver() instanceof PlcToAgvDeviceDriver) { |
|
|
|
PlcToAgvDeviceDriver plcToAgvDeviceDriver = (PlcToAgvDeviceDriver) device.getDeviceDriver(); |
|
|
|
/*if (device_code.contains("_01")) { |
|
|
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0); |
|
|
|
if (device_code.contains("_01")) { |
|
|
|
data = feedBackStatus(data, index, 4, inst, task, 2, false); |
|
|
|
} else if (device_code.contains("_02")) { |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
|
try { |
|
|
|
List list = new ArrayList<>(); |
|
|
|
Map map = new HashMap(); |
|
|
@ -445,8 +449,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} catch (Exception e) { |
|
|
|
log.info("下发AGVInOP信号:{}失败", "0"); |
|
|
|
} |
|
|
|
}); |
|
|
|
data = feedBackStatus(data, index, 4, inst, task, 2, false); |
|
|
|
} else {*/ |
|
|
|
} else { |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
|
try { |
|
|
|
List list = new ArrayList<>(); |
|
|
|
Map map = new HashMap(); |
|
|
@ -465,8 +471,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
|
} catch (Exception e) { |
|
|
|
log.info("下发AGVInOP信号:{}失败", "0"); |
|
|
|
} |
|
|
|
}); |
|
|
|
data = feedBackStatus(data, index, 4, inst, task, 2, false); |
|
|
|
/* }*/ |
|
|
|
} |
|
|
|
} else if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
try { |
|
|
|
StandardOrdinarySiteDeviceDriver standar = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|