add: 联调
This commit is contained in:
@@ -534,6 +534,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
||||
message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("finish_task"))
|
||||
&& StrUtil.equals("true", device.getExtraValue().get("finish_task").toString())) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
standardOrdinarySiteDeviceDriver.setOption(0);
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
}
|
||||
@@ -1509,12 +1514,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
|
||||
//申请烘箱行架任务
|
||||
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task"))
|
||||
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task").toString())) {
|
||||
if (manipulatorAgvStationDeviceDriver.getTo_command() != 4 && !manipulatorAgvStationDeviceDriver.getOvenGantryTask()) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
String task_code = inst.getTask_code();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("task_code", task_code);
|
||||
@@ -1538,31 +1543,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
|
||||
}
|
||||
}
|
||||
//行架取货完成后反馈ndc
|
||||
// if ((manipulatorAgvStationDeviceDriver.getAction() == 4)) {
|
||||
//
|
||||
// manipulatorAgvStationDeviceDriver.setOvenGantryTask(false);
|
||||
// LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
// .device_code(this.getDeviceCode())
|
||||
// .content("agvphase:" + phase + "反馈:" + data)
|
||||
// .build();
|
||||
// logDto.setLog_level(4);
|
||||
// luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
// } else {
|
||||
// log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||
// LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
// .device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
// .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
// .build();
|
||||
// logDto.setLog_level(4);
|
||||
// luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
// }
|
||||
|
||||
} else {
|
||||
// try {
|
||||
// manipulatorAgvStationDeviceDriver.writing(4);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(4);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
@@ -1783,6 +1770,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
//废泊处理的时候要判断是否允许任务完成
|
||||
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("finish_task"))
|
||||
&& StrUtil.equals("true", device.getExtraValue().get("finish_task").toString())) {
|
||||
if (standardOrdinarySiteDeviceDriver.getOption() == 3) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
} else {
|
||||
log.info("等待LMS系统进行确认允许任务完成信号,设备号{},option值{}", standardOrdinarySiteDeviceDriver.getDevice_code(), standardOrdinarySiteDeviceDriver.getOption());
|
||||
logServer.deviceExecuteLog(device.getDevice_code(), "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(standardOrdinarySiteDeviceDriver.getDevice_code())
|
||||
.content("等待LMS系统进行确认允许任务完成信号,设备号" + standardOrdinarySiteDeviceDriver.getDevice_code() + ",option当前值" + standardOrdinarySiteDeviceDriver.getOption())
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
@@ -1813,19 +1816,50 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
|
||||
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(5);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
//行架到达安全位
|
||||
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task"))
|
||||
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task").toString())) {
|
||||
//行架取货完成后反馈ndc
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 4)) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
manipulatorAgvStationDeviceDriver.setOvenGantryTask(false);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(5);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
|
||||
} else {
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(5);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
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);
|
||||
|
||||
}
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
manipulatorAgvStationDeviceDriver.setOvenGantryTask(true);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
|
||||
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
||||
try {
|
||||
@@ -2034,23 +2068,42 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
|
||||
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
|
||||
//申请烘箱行架任务
|
||||
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task"))
|
||||
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task").toString())) {
|
||||
if (manipulatorAgvStationDeviceDriver.getTo_command() != 4 && !manipulatorAgvStationDeviceDriver.getOvenGantryTask()) {
|
||||
String task_code = inst.getTask_code();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("task_code", task_code);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("申请烘箱行架任务,参数:" + jsonObject)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
String response = acsToWmsService.applyOvenGantryTask(jsonObject);
|
||||
JSONObject jo = JSON.parseObject(response);
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("申请烘箱行架任务,参数,接口返回:" + jo)
|
||||
.build();
|
||||
logDto2.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||
if (jo.getInteger("status") == 200) {
|
||||
manipulatorAgvStationDeviceDriver.setOvenGantryTask(true);
|
||||
manipulatorAgvStationDeviceDriver.writing(4);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(4);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//收卷辊放货忽略取货校验
|
||||
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check"))
|
||||
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check").toString())) {
|
||||
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 {
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(4);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
@@ -2060,7 +2113,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
|
||||
}
|
||||
|
||||
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
||||
try {
|
||||
@@ -2204,18 +2256,51 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
|
||||
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(5);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
//行架到达安全位
|
||||
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task"))
|
||||
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task").toString())) {
|
||||
//行架取货完成后反馈ndc
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 4)) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
manipulatorAgvStationDeviceDriver.setOvenGantryTask(false);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(5);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
|
||||
} else {
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(5);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
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);
|
||||
|
||||
}
|
||||
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 if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
|
||||
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
|
||||
try {
|
||||
|
||||
@@ -80,7 +80,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
public int error = 0;
|
||||
public int door = 0;
|
||||
public float temperature = 0;
|
||||
public int to_temperature = 0;
|
||||
public float to_temperature = 0;
|
||||
public int countdown_house = 0;
|
||||
public int countdown_min = 0;
|
||||
public int countdown_sec = 0;
|
||||
@@ -88,7 +88,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
public int task = 0;
|
||||
public int error1 = 0;
|
||||
public int material = 0;
|
||||
public int consumption = 0;
|
||||
public float consumption = 0;
|
||||
public float voltageA = 0;
|
||||
public float voltageB = 0;
|
||||
public float voltageC = 0;
|
||||
@@ -110,7 +110,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
public int last_task = 0;
|
||||
public int last_error1 = 0;
|
||||
public int last_material = 0;
|
||||
public int last_consumption = 0;
|
||||
public float last_consumption = 0;
|
||||
public float last_voltageA = 0;
|
||||
public float last_voltageB = 0;
|
||||
public float last_voltageC = 0;
|
||||
@@ -118,6 +118,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
public float last_currentB = 0;
|
||||
public float last_currentC = 0;
|
||||
|
||||
|
||||
Boolean isonline = true;
|
||||
|
||||
Boolean iserror = false;
|
||||
@@ -140,8 +141,8 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
device_code = this.getDeviceCode();
|
||||
device_code
|
||||
= this.getDeviceCode();
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
move = this.itemProtocol.getItem_move();
|
||||
@@ -251,15 +252,19 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
String str = acsToWmsService.outHotTaskApply(apply);
|
||||
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("烘箱完成反馈LMS,参数,接口返回:" + jo)
|
||||
.build();
|
||||
logDto2.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||
message = "烘箱完成反馈LMS,参数,接口返回:" + jo;
|
||||
return;
|
||||
if (jo.getInteger("status") == 200) {
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("烘箱完成反馈LMS,参数,接口返回:" + jo)
|
||||
.build();
|
||||
logDto2.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||
message = "烘箱完成反馈LMS,参数,接口返回:" + jo;
|
||||
requireSucess = true;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ public class ItemProtocol {
|
||||
public int getItem_error1(){
|
||||
return this.getOpcIntegerValue(item_error1);
|
||||
} ;
|
||||
public int getItem_consumption(){
|
||||
return this.getOpcIntegerValue(item_consumption);
|
||||
public float getItem_consumption(){
|
||||
return this.getOpcFloatValue(item_consumption);
|
||||
} ;
|
||||
public float getItem_voltageA(){
|
||||
return this.getOpcFloatValue(item_voltageA);
|
||||
@@ -107,8 +107,8 @@ public class ItemProtocol {
|
||||
return this.getOpcFloatValue(item_currentC);
|
||||
} ;
|
||||
|
||||
public int getItem_to_temperature(){
|
||||
return this.getOpcIntegerValue(item_to_temperature);
|
||||
public float getItem_to_temperature(){
|
||||
return this.getOpcFloatValue(item_to_temperature);
|
||||
} ;
|
||||
|
||||
Boolean isonline;
|
||||
|
||||
@@ -953,8 +953,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
if (StrUtil.isNotEmpty(taskDto.getOven_time())) {
|
||||
//下发烘箱时间
|
||||
int time = Integer.parseInt(taskDto.getOven_time());
|
||||
int hours = (time / (60 * 60)); // 整数小时
|
||||
int minutes = (time % (60 * 60)) / 60; // 剩余分钟
|
||||
int hours = time / 60; // 整数小时
|
||||
int minutes = time % 60 ; // 剩余分钟
|
||||
map.put("to_time_house", String.valueOf(hours));
|
||||
map.put("to_time_min", String.valueOf(minutes));
|
||||
hongXiangConveyorDeviceDriver.writing(map);
|
||||
@@ -1050,6 +1050,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public synchronized boolean finish_instruction(Instruction inst) throws Exception {
|
||||
instructionService.finish(inst);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user