add:产线接驳台、拆封盖对接位驱动使用
This commit is contained in:
@@ -16,6 +16,8 @@ import org.nl.acs.device_driver.FeedLmsRealFailed;
|
||||
import org.nl.acs.device_driver.agv.utils.OneAgvPhase;
|
||||
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
|
||||
import org.nl.acs.device_driver.zz_driver.production_line_docking_station.ProductionLineDockingStationDeviceDriver;
|
||||
import org.nl.acs.device_driver.zz_driver.remove_seal_cover_position.RemoveSealCoverPositionDriver;
|
||||
import org.nl.acs.device_driver.zz_driver.unpacking_conveyor.UnpackingConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.zz_driver.unpacking_machine.UnpackingMachineDeviceDriver;
|
||||
import org.nl.acs.ext.wms.data.ApplyPlugPullSitResponse;
|
||||
@@ -157,6 +159,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||
UnpackingMachineDeviceDriver unpackingMachineDeviceDriver;
|
||||
UnpackingConveyorDeviceDriver unpackingConveyorDeviceDriver;
|
||||
ProductionLineDockingStationDeviceDriver productionLineDockingStationDeviceDriver;
|
||||
RemoveSealCoverPositionDriver removeSealCoverPositionDriver;
|
||||
|
||||
//分配 车id
|
||||
//(不需要WCS反馈)
|
||||
@@ -269,6 +273,66 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
}
|
||||
|
||||
//产线接驳台
|
||||
if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) {
|
||||
productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver();
|
||||
// 请求进入
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 1);
|
||||
try {
|
||||
productionLineDockingStationDeviceDriver.writing(map);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + productionLineDockingStationDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content(message)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) {
|
||||
removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver();
|
||||
// 请求进入
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 1);
|
||||
try {
|
||||
removeSealCoverPositionDriver.writing(map);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (removeSealCoverPositionDriver.getAction() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + removeSealCoverPositionDriver.getAction() + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content(message)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//取货完毕
|
||||
//(需要WCS反馈)
|
||||
@@ -356,6 +420,44 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) {
|
||||
productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver();
|
||||
// 取货完毕
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 2);
|
||||
try {
|
||||
productionLineDockingStationDeviceDriver.writing(map);
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) {
|
||||
removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver();
|
||||
// 取货完毕
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 2);
|
||||
try {
|
||||
removeSealCoverPositionDriver.writing(map);
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(data)) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data));
|
||||
@@ -459,6 +561,64 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) {
|
||||
productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver();
|
||||
// 请求进入
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 3);
|
||||
try {
|
||||
productionLineDockingStationDeviceDriver.writing(map);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + productionLineDockingStationDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content(message)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) {
|
||||
removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver();
|
||||
// 请求进入
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 3);
|
||||
try {
|
||||
removeSealCoverPositionDriver.writing(map);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (removeSealCoverPositionDriver.getAction() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + removeSealCoverPositionDriver.getAction() + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content(message)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//放货完毕
|
||||
//(需要WCS反馈)
|
||||
@@ -540,6 +700,44 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) {
|
||||
productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver();
|
||||
// 取货完毕
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 4);
|
||||
try {
|
||||
productionLineDockingStationDeviceDriver.writing(map);
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) {
|
||||
removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver();
|
||||
// 取货完毕
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 4);
|
||||
try {
|
||||
removeSealCoverPositionDriver.writing(map);
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 到达取货2
|
||||
@@ -638,6 +836,64 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) {
|
||||
productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver();
|
||||
// 请求进入
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 1);
|
||||
try {
|
||||
productionLineDockingStationDeviceDriver.writing(map);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + productionLineDockingStationDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content(message)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) {
|
||||
removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver();
|
||||
// 请求进入
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 1);
|
||||
try {
|
||||
removeSealCoverPositionDriver.writing(map);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (removeSealCoverPositionDriver.getAction() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + removeSealCoverPositionDriver.getAction() + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content(message)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 取货完毕2
|
||||
else if (phase == 0x0E) {
|
||||
@@ -720,6 +976,44 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) {
|
||||
productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver();
|
||||
// 取货完毕
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 2);
|
||||
try {
|
||||
productionLineDockingStationDeviceDriver.writing(map);
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) {
|
||||
removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver();
|
||||
// 取货完毕
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 2);
|
||||
try {
|
||||
removeSealCoverPositionDriver.writing(map);
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 到达放货2
|
||||
else if (phase == 0x10) {
|
||||
@@ -817,6 +1111,65 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) {
|
||||
productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver();
|
||||
// 请求进入
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 3);
|
||||
try {
|
||||
productionLineDockingStationDeviceDriver.writing(map);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + productionLineDockingStationDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content(message)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) {
|
||||
removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver();
|
||||
// 请求进入
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 3);
|
||||
try {
|
||||
removeSealCoverPositionDriver.writing(map);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (removeSealCoverPositionDriver.getAction() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + removeSealCoverPositionDriver.getAction() + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content(message)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 放货完毕2
|
||||
else if (phase == 0x12) {
|
||||
@@ -888,6 +1241,44 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) {
|
||||
productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver();
|
||||
// 取货完毕
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 4);
|
||||
try {
|
||||
productionLineDockingStationDeviceDriver.writing(map);
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) {
|
||||
removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver();
|
||||
// 取货完毕
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_command", 4);
|
||||
try {
|
||||
removeSealCoverPositionDriver.writing(map);
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user