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