This commit is contained in:
2023-01-29 21:01:49 +08:00
parent cfc4233fbd
commit 1ccd021f83
2 changed files with 49 additions and 2 deletions

View File

@@ -126,8 +126,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
task = this.itemProtocol.getTask(); task = this.itemProtocol.getTask();
if (mode != last_mode) { if (mode != last_mode) {
if (mode == 2) { if (mode == 2) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号复位前requireSuccess" + requireSucess);
this.setRequireSucess(false); this.setRequireSucess(false);
message = null; message = null;
logServer.deviceExecuteLog(this.device_code, "", "", "信号复位后requireSuccess" + requireSucess);
} }
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
@@ -559,7 +562,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
instructionService.create(instdto); instructionService.create(instdto);
} catch (Exception e) { } catch (Exception e) {
notCreateInstMessage = e.getMessage(); notCreateInstMessage = e.getMessage();
e.printStackTrace(); logServer.deviceExecuteLog(this.getDevice_code(), "", "", "创建指令时出现异常:" + e.getMessage());
return false; return false;
} }
//创建指令后修改任务状态 //创建指令后修改任务状态
@@ -571,10 +574,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code()); Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code());
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
notCreateInstMessage = "设备:" + startDevice.getDevice_code() + "未设置电气调度号!"; notCreateInstMessage = "设备:" + startDevice.getDevice_code() + "未设置电气调度号!";
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
} }
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
notCreateInstMessage = "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"; notCreateInstMessage = "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!";
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
} }
String start_addr = startDevice.getExtraValue().get("address").toString(); String start_addr = startDevice.getExtraValue().get("address").toString();
@@ -692,6 +697,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
} catch (Exception e) { } catch (Exception e) {
isClose = true; isClose = true;
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "检查烘箱是否关门时出现异常:" + e.getMessage());
notCreateInstMessage = "检查烘箱是否关门时出现异常:" + e.getMessage(); notCreateInstMessage = "检查烘箱是否关门时出现异常:" + e.getMessage();
} }
return isClose; return isClose;
@@ -761,6 +767,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} else if (this.getMove() == 1) { } else if (this.getMove() == 1) {
move = "有货"; move = "有货";
} }
String requireSucess = "0"; String requireSucess = "0";
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = "1";

View File

@@ -1470,7 +1470,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("is_disable1", this.getIs_disable()); jo.put("is_disable1", this.getIs_disable());
jo.put("is_disable", is_disable); jo.put("is_disable", is_disable);
jo.put("message", "此时,type = 1时," + this.getNow_steps_type1() + ",type = 2时," + this.getNow_steps_type2() + ",type = 3时," + this.getNow_steps_type3()); jo.put("message", this.messageInfo(type));
jo.put("is_click", true); jo.put("is_click", true);
jo.put("driver_type", "slit_two_manipulator"); jo.put("driver_type", "slit_two_manipulator");
jo.put("notCreateTaskMessage", notCreateTaskMessage); jo.put("notCreateTaskMessage", notCreateTaskMessage);
@@ -1479,6 +1479,46 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
return jo; return jo;
} }
public String messageInfo(int type) {
String set_type = "";
JSONObject map = new JSONObject();
if (type == 1) {
set_type = String.valueOf(now_steps_type1);
map.put("0", "前工位单任务未执行");
map.put("1", "前工位单任务改变指令状态");
map.put("2", "前工位单任务下发电气任务信息");
map.put("3", "单任务前工位允许取货");
map.put("4", "单任务前工位取货完成");
map.put("5", "单任务前工位允许放货");
map.put("6", "单任务前工位放货完成");
} else if (type == 2) {
set_type = String.valueOf(now_steps_type2);
map.put("0", "后工位单任务未执行");
map.put("1", "后工位单任务改变指令状态");
map.put("2", "后工位单任务下发电气任务信息");
map.put("3", "单任务后工位允许取货");
map.put("4", "单任务后工位取货完成");
map.put("5", "单任务后工位允许放货");
map.put("6", "单任务后工位放货完成");
} else if (type == 3) {
set_type = String.valueOf(now_steps_type3);
map.put("0", "双任务未执行");
map.put("1", "双任务改变指令状态");
map.put("2", "双任务下发电气任务信息");
map.put("3", "双任务后工位允许取货");
map.put("4", "双任务后工位取货完成");
map.put("5", "双任务前工位允许取货");
map.put("6", "双任务前工位取货完成");
map.put("7", "双任务后工位允许放货");
map.put("8", "双任务后工位放货完成");
map.put("9", "双任务前工位允许放货");
map.put("10", "双任务前工位放货完成");
} else {
return "未执行任务";
}
return map.getString(set_type);
}
@Override @Override
public void setDeviceStatus(JSONObject data) { public void setDeviceStatus(JSONObject data) {
String is_disable = data.getString("is_disable"); String is_disable = data.getString("is_disable");