opt: 出烘箱,信号断连优化

This commit is contained in:
yanps
2024-02-20 14:03:10 +08:00
parent d703d4ee29
commit 3021a83d0c
18 changed files with 200 additions and 102 deletions

View File

@@ -266,6 +266,9 @@ public class BoxPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriv
} else if (this.getAction() == 4) { } else if (this.getAction() == 4) {
action = "放货完成"; action = "放货完成";
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move); jo.put("move", move);

View File

@@ -479,6 +479,9 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
} else if (this.getMove() == 1) { } else if (this.getMove() == 1) {
move = "有托盘"; move = "有托盘";
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("task", task); jo.put("task", task);
jo.put("mode", mode); jo.put("mode", mode);

View File

@@ -336,6 +336,9 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
move = "有托盘有货"; move = "有托盘有货";
jo.put("hasGoods", true); jo.put("hasGoods", true);
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("temperature", temperature); jo.put("temperature", temperature);
jo.put("finish", finish); jo.put("finish", finish);
@@ -351,6 +354,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("move", move); jo.put("move", move);
jo.put("action", action); jo.put("action", action);
jo.put("task", this.getTask()); jo.put("task", this.getTask());
jo.put("message", this.getMessage());
return jo; return jo;
} }

View File

@@ -755,8 +755,9 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = "1";
} }
if(deviceStatus){ if(deviceStatus && error == 0){
iserror = true; iserror = true;
message = "信号连接超时!";
} }
if(error == 0 && !deviceStatus){ if(error == 0 && !deviceStatus){
iserror = false; iserror = false;

View File

@@ -123,6 +123,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
//行架机械手申请任务成功标识 //行架机械手申请任务成功标识
boolean requireSucess = false; boolean requireSucess = false;
public boolean deviceStatus = false;
private int instruction_finished_time_out; private int instruction_finished_time_out;
int branchProtocol = 0; int branchProtocol = 0;
@@ -172,6 +174,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
to_onset = this.itemProtocol.getTo_onset(); to_onset = this.itemProtocol.getTo_onset();
x_position = this.itemProtocol.getX_position(); x_position = this.itemProtocol.getX_position();
y_position = this.itemProtocol.getY_position(); y_position = this.itemProtocol.getY_position();
deviceStatus = this.itemProtocol.getDevice_status();
// if(heartbeat != last_heartbeat){ // if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat); // logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// } // }
@@ -386,6 +390,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDto.getTask_code()); Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDto.getTask_code());
if(ObjectUtil.isNotEmpty(instruction)){
String start_device_code = instruction.getStart_device_code(); String start_device_code = instruction.getStart_device_code();
String next_device_code = instruction.getNext_device_code(); String next_device_code = instruction.getNext_device_code();
Device nextdevice = deviceAppService.findDeviceByCode(next_device_code); Device nextdevice = deviceAppService.findDeviceByCode(next_device_code);
@@ -485,6 +490,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
this.setNow_steps_type(2); this.setNow_steps_type(2);
this.setRequireSucess(true); this.setRequireSucess(true);
return true; return true;
}
} else { } else {
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode); List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtoList)) { if (ObjectUtil.isNotEmpty(taskDtoList)) {
@@ -560,8 +566,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
String route_plan_code = task.getRoute_plan_code(); String route_plan_code = task.getRoute_plan_code();
String next_point_code = task.getNext_point_code(); String next_point_code = task.getNext_point_code();
String next_device_code = task.getNext_device_code(); String next_device_code = task.getNext_device_code();
String put_device_code = task.getPut_device_code();
String put_point_code = task.getPut_point_code();
Instruction instdto = new Instruction(); Instruction instdto = new Instruction();
instdto.setPut_device_code(put_device_code);
instdto.setPut_point_code(put_point_code);
instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setRoute_plan_code(route_plan_code); instdto.setRoute_plan_code(route_plan_code);
instdto.setRemark(task.getRemark()); instdto.setRemark(task.getRemark());
@@ -843,7 +853,13 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} else if (now_steps_type == 5) { } else if (now_steps_type == 5) {
steps_type += "放货完成"; steps_type += "放货完成";
} }
if(deviceStatus && error == 0){
iserror = true;
message = "信号连接超时!";
}
if(error == 0 && !deviceStatus){
iserror = false;
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move); jo.put("move", move);
@@ -1128,7 +1144,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
} }
if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { /*if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver();
// hongXiangConveyorDeviceDriver.writing("to_close_door", "1"); // hongXiangConveyorDeviceDriver.writing("to_close_door", "1");
@@ -1147,7 +1163,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
} }
} }*/
this.writing("to_command", "5"); this.writing("to_command", "5");
this.setNow_steps_type(6); this.setNow_steps_type(6);
this.setNow_steps_type(0); this.setNow_steps_type(0);

View File

@@ -70,6 +70,7 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
int to_command =0; int to_command =0;
int to_target =0; int to_target =0;
String material = null; String material = null;
String message = null;
Boolean isonline = true; Boolean isonline = true;
@@ -96,7 +97,6 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
@Override @Override
public void execute() { public void execute() {
String message = null;
device_code = this.getDeviceCode(); device_code = this.getDeviceCode();
heartbeat = this.itemProtocol.getHeartbeat(); heartbeat = this.itemProtocol.getHeartbeat();
@@ -137,10 +137,8 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
if(error > 0){ if(error > 0){
this.setIserror(true); this.setIserror(true);
} else { } else {
if(error > 0){
this.setIserror(false); this.setIserror(false);
} }
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号out_finish" + last_out_finish + "->" + out_finish); logServer.deviceExecuteLog(this.device_code, "", "", "信号out_finish" + last_out_finish + "->" + out_finish);
} }
@@ -217,6 +215,9 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
} else if (this.getMode() == 4) { } else if (this.getMode() == 4) {
mode = "出库中"; mode = "出库中";
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
@@ -224,6 +225,8 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("out_finish", out_finish); jo.put("out_finish", out_finish);
jo.put("material", material); jo.put("material", material);
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("isError", iserror);
jo.put("message", message);
return jo; return jo;
} }

View File

@@ -759,6 +759,10 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = "1";
} }
if(error == 0 && iserror){
this.message = "信号连接超时!";
}
map.put("message", message);
map.put("requireSucess", requireSucess); map.put("requireSucess", requireSucess);
map.put("driver_type", "conveyor"); map.put("driver_type", "conveyor");
JSONObject jo = new JSONObject(map); JSONObject jo = new JSONObject(map);

View File

@@ -335,6 +335,9 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
} }
jo.put("hasGoods", true); jo.put("hasGoods", true);
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move1", move1); jo.put("move1", move1);

View File

@@ -628,6 +628,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = "1";
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move); jo.put("move", move);

View File

@@ -463,6 +463,9 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = "1";
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move); jo.put("move", move);
@@ -471,8 +474,8 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("last_task", last_task); jo.put("last_task", last_task);
jo.put("task_code", task_code); jo.put("task_code", task_code);
jo.put("hand_barcode", hand_barcode); jo.put("hand_barcode", hand_barcode);
jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null ? null : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code()); jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null
// jo.put("last_task", last_task); ? null : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code());
jo.put("inst_message", this.inst_message); jo.put("inst_message", this.inst_message);
jo.put("last_inst_message", this.last_inst_message); jo.put("last_inst_message", this.last_inst_message);
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());

View File

@@ -456,7 +456,9 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = "1";
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move); jo.put("move", move);
@@ -465,7 +467,8 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null ? vehicle_code : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code()); jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null
? vehicle_code : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code());
jo.put("message", this.getMessage()); jo.put("message", this.getMessage());
jo.put("is_click", true); jo.put("is_click", true);
jo.put("requireSucess", requireSucess); jo.put("requireSucess", requireSucess);

View File

@@ -349,6 +349,9 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = "1";
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move); jo.put("move", move);

View File

@@ -1217,8 +1217,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = "1";
} }
if(error == 0 && iserror){
type = 4;
}
jo.put("requireSucess", requireSucess); jo.put("requireSucess", requireSucess);
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("status", status); jo.put("status", status);
@@ -1279,6 +1281,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
map.put("8", "双任务后工位放货完成"); map.put("8", "双任务后工位放货完成");
map.put("9", "双任务前工位允许放货"); map.put("9", "双任务前工位允许放货");
map.put("10", "双任务前工位放货完成"); map.put("10", "双任务前工位放货完成");
}else if(type == 4){
return "信号连接超时!";
} else { } else {
return "未执行任务"; return "未执行任务";
} }

View File

@@ -464,6 +464,9 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
move = "有托盘有货"; move = "有托盘有货";
jo.put("hasGoods", true); jo.put("hasGoods", true);
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move); jo.put("move", move);
@@ -472,6 +475,7 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
jo.put("error", this.getError()); jo.put("error", this.getError());
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("task", this.getTask()); jo.put("task", this.getTask());
jo.put("message", message);
return jo; return jo;
} }

View File

@@ -873,6 +873,9 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp
if (this.applySucess) { if (this.applySucess) {
applySucess = "1"; applySucess = "1";
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("requireSucess", requireSucess); jo.put("requireSucess", requireSucess);
jo.put("applySucess", applySucess); jo.put("applySucess", applySucess);
jo.put("driver_type", "standard_conveyor_control_with_scanner"); jo.put("driver_type", "standard_conveyor_control_with_scanner");
@@ -885,6 +888,7 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp
jo.put("error", this.getError()); jo.put("error", this.getError());
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("task", this.getTask()); jo.put("task", this.getTask());
jo.put("message", message);
return jo; return jo;
} }

View File

@@ -1105,6 +1105,9 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
move = "有托盘有货"; move = "有托盘有货";
jo.put("hasGoods", true); jo.put("hasGoods", true);
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("driver_type", "standard_conveyor_control_with_scanner"); jo.put("driver_type", "standard_conveyor_control_with_scanner");
jo.put("mode", mode); jo.put("mode", mode);

View File

@@ -57,6 +57,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
//有货标记 //有货标记
protected boolean has_goods_tag = false; protected boolean has_goods_tag = false;
int heartbeat = 0;
int mode = 0; int mode = 0;
int error = 0; int error = 0;
int move = 0; int move = 0;
@@ -133,6 +134,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
try { try {
device_code = this.getDeviceCode(); device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode(); mode = this.itemProtocol.getMode();
heartbeat = this.itemProtocol.getHeartbeat();
error = this.itemProtocol.getError(); error = this.itemProtocol.getError();
move = this.itemProtocol.getMove(); move = this.itemProtocol.getMove();
action = this.itemProtocol.getAction(); action = this.itemProtocol.getAction();
@@ -233,6 +235,9 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
move = "有托盘有货"; move = "有托盘有货";
jo.put("hasGoods", true); jo.put("hasGoods", true);
} }
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move); jo.put("move", move);
@@ -243,6 +248,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
jo.put("task", this.getTask()); jo.put("task", this.getTask());
jo.put("is_click", true); jo.put("is_click", true);
jo.put("is_force", this.getIs_force()); jo.put("is_force", this.getIs_force());
jo.put("message", message);
return jo; return jo;
} }

View File

@@ -413,6 +413,34 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
// 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统 // 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统
if (!StrUtil.equals(task.getAgv_system_type(), "0") if (!StrUtil.equals(task.getAgv_system_type(), "0")
&& ObjectUtil.isNotEmpty(task.getAgv_system_type())) { && ObjectUtil.isNotEmpty(task.getAgv_system_type())) {
if(StrUtil.isBlank(dto.getAgv_inst_type())){
String agv_system_type = task.getAgv_system_type();
String task_type = task.getTask_type();
if (!StrUtil.equals(agv_system_type, "1")) {
// task_type
//1、生箔 Itype=1:取空,取满,放空,放满;
//2、分切 Itype=3取满、取空、放满、放空
//3、普通任务 Itype=2:取货、放货;
//4、叉车任务
//5、输送任务
//6、行架
//7、立库
if (StrUtil.equals(task_type, "1")) {
dto.setAgv_inst_type("1");
} else if (StrUtil.equals(task_type, "3")) {
dto.setAgv_inst_type("2");
} else if (StrUtil.equals(task_type, "2")) {
dto.setAgv_inst_type("3");
} else if (StrUtil.equals(task_type, "8")) {
dto.setAgv_inst_type("2");
} else {
log.info("未找到对应的AGV指令类型任务号:" + task.getTask_code() + ",task_type:" + task.getTask_type()) ;
}
} else {
dto.setAgv_inst_type("4");
}
dto.setAgv_system_type(task.getAgv_system_type());
}
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
log.warn("下发AGV指令数据,"+ "指令号:" + dto.getInstruction_code() + ",AGV系统类型:"+ dto.getAgv_system_type() log.warn("下发AGV指令数据,"+ "指令号:" + dto.getInstruction_code() + ",AGV系统类型:"+ dto.getAgv_system_type()
+ ",AGV指令类型:" + dto.getInstruction_type() ); + ",AGV指令类型:" + dto.getInstruction_type() );