opt: 出烘箱,信号断连优化
This commit is contained in:
@@ -266,6 +266,9 @@ public class BoxPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriv
|
||||
} else if (this.getAction() == 4) {
|
||||
action = "放货完成";
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
|
||||
@@ -479,6 +479,9 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
} else if (this.getMove() == 1) {
|
||||
move = "有托盘";
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("task", task);
|
||||
jo.put("mode", mode);
|
||||
|
||||
@@ -336,6 +336,9 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
move = "有托盘有货";
|
||||
jo.put("hasGoods", true);
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("temperature", temperature);
|
||||
jo.put("finish", finish);
|
||||
@@ -351,6 +354,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
jo.put("move", move);
|
||||
jo.put("action", action);
|
||||
jo.put("task", this.getTask());
|
||||
jo.put("message", this.getMessage());
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -755,8 +755,9 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
if (this.requireSucess) {
|
||||
requireSucess = "1";
|
||||
}
|
||||
if(deviceStatus){
|
||||
if(deviceStatus && error == 0){
|
||||
iserror = true;
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
if(error == 0 && !deviceStatus){
|
||||
iserror = false;
|
||||
|
||||
@@ -123,6 +123,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
//行架机械手申请任务成功标识
|
||||
boolean requireSucess = false;
|
||||
|
||||
public boolean deviceStatus = false;
|
||||
|
||||
private int instruction_finished_time_out;
|
||||
|
||||
int branchProtocol = 0;
|
||||
@@ -172,6 +174,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
to_onset = this.itemProtocol.getTo_onset();
|
||||
x_position = this.itemProtocol.getX_position();
|
||||
y_position = this.itemProtocol.getY_position();
|
||||
deviceStatus = this.itemProtocol.getDevice_status();
|
||||
|
||||
// if(heartbeat != last_heartbeat){
|
||||
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat);
|
||||
// }
|
||||
@@ -386,105 +390,107 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
|
||||
Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDto.getTask_code());
|
||||
String start_device_code = instruction.getStart_device_code();
|
||||
String next_device_code = instruction.getNext_device_code();
|
||||
Device nextdevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
Device startdevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
PhotoelectricInspectionSiteDeviceDriver photoelectricInspectionSiteDeviceDriver;
|
||||
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
if (startdevice.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver) {
|
||||
photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) startdevice.getDeviceDriver();
|
||||
if (photoelectricInspectionSiteDeviceDriver.getMove() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + photoelectricInspectionSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
if(ObjectUtil.isNotEmpty(instruction)){
|
||||
String start_device_code = instruction.getStart_device_code();
|
||||
String next_device_code = instruction.getNext_device_code();
|
||||
Device nextdevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
Device startdevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
PhotoelectricInspectionSiteDeviceDriver photoelectricInspectionSiteDeviceDriver;
|
||||
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
if (startdevice.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver) {
|
||||
photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) startdevice.getDeviceDriver();
|
||||
if (photoelectricInspectionSiteDeviceDriver.getMove() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + photoelectricInspectionSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
|
||||
if (standardInspectSiteDeviceDriver.getMove() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
|
||||
if (standardInspectSiteDeviceDriver.getMove() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
|
||||
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
|
||||
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
|
||||
if (standardInspectSiteDeviceDriver.getMove() != 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
|
||||
if (standardInspectSiteDeviceDriver.getMove() != 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
||||
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//判断关联的同一列烘箱设备是否都关门 都关门返回false,有一个不关门就返回true
|
||||
boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code);
|
||||
//未关门结束
|
||||
if (isCloseDoor) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
||||
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
instruction.setInstruction_status("1");
|
||||
instruction.setUpdate_time(DateUtil.now());
|
||||
instructionService.update(instruction);
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
|
||||
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
}
|
||||
//判断关联的同一列烘箱设备是否都关门 都关门返回false,有一个不关门就返回true
|
||||
boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code);
|
||||
//未关门结束
|
||||
if (isCloseDoor) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
instruction.setInstruction_status("1");
|
||||
instruction.setUpdate_time(DateUtil.now());
|
||||
instructionService.update(instruction);
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
|
||||
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
|
||||
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
+ instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code()
|
||||
+ ",指令终点:" + instruction.getNext_device_code());
|
||||
this.writing("to_onset", start_addr);
|
||||
this.writing("to_target", next_addr);
|
||||
this.writing("to_task", instruction.getInstruction_code());
|
||||
this.writing("to_command", "1");
|
||||
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_open_door");
|
||||
map.put("value", "1");
|
||||
list.add(map);
|
||||
try {
|
||||
hongXiangConveyorDeviceDriver.writing(list);
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "起点设备:" + start_device_code + "未打开烘箱门,导致now_steps_type不等于: 2 ;now_steps_type:" + now_steps_type);
|
||||
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
|
||||
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
}
|
||||
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_open_door");
|
||||
map.put("value", "1");
|
||||
list.add(map);
|
||||
try {
|
||||
hongXiangConveyorDeviceDriver.writing(list);
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "终点设备:" + next_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type);
|
||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
+ instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code()
|
||||
+ ",指令终点:" + instruction.getNext_device_code());
|
||||
this.writing("to_onset", start_addr);
|
||||
this.writing("to_target", next_addr);
|
||||
this.writing("to_task", instruction.getInstruction_code());
|
||||
this.writing("to_command", "1");
|
||||
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_open_door");
|
||||
map.put("value", "1");
|
||||
list.add(map);
|
||||
try {
|
||||
hongXiangConveyorDeviceDriver.writing(list);
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "起点设备:" + start_device_code + "未打开烘箱门,导致now_steps_type不等于: 2 ;now_steps_type:" + now_steps_type);
|
||||
}
|
||||
}
|
||||
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_open_door");
|
||||
map.put("value", "1");
|
||||
list.add(map);
|
||||
try {
|
||||
hongXiangConveyorDeviceDriver.writing(list);
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "终点设备:" + next_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type);
|
||||
}
|
||||
}
|
||||
this.setNow_steps_type(2);
|
||||
this.setRequireSucess(true);
|
||||
return true;
|
||||
}
|
||||
this.setNow_steps_type(2);
|
||||
this.setRequireSucess(true);
|
||||
return true;
|
||||
} else {
|
||||
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
||||
@@ -560,8 +566,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
String route_plan_code = task.getRoute_plan_code();
|
||||
String next_point_code = task.getNext_point_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();
|
||||
instdto.setPut_device_code(put_device_code);
|
||||
instdto.setPut_point_code(put_point_code);
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(route_plan_code);
|
||||
instdto.setRemark(task.getRemark());
|
||||
@@ -843,7 +853,13 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
} else if (now_steps_type == 5) {
|
||||
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("mode", mode);
|
||||
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();
|
||||
// hongXiangConveyorDeviceDriver.writing("to_close_door", "1");
|
||||
|
||||
@@ -1147,7 +1163,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
this.writing("to_command", "5");
|
||||
this.setNow_steps_type(6);
|
||||
this.setNow_steps_type(0);
|
||||
|
||||
@@ -70,6 +70,7 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
int to_command =0;
|
||||
int to_target =0;
|
||||
String material = null;
|
||||
String message = null;
|
||||
|
||||
Boolean isonline = true;
|
||||
|
||||
@@ -96,7 +97,6 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
|
||||
device_code = this.getDeviceCode();
|
||||
heartbeat = this.itemProtocol.getHeartbeat();
|
||||
@@ -137,9 +137,7 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
if(error > 0){
|
||||
this.setIserror(true);
|
||||
} else {
|
||||
if(error > 0){
|
||||
this.setIserror(false);
|
||||
}
|
||||
this.setIserror(false);
|
||||
}
|
||||
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) {
|
||||
mode = "出库中";
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
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("material", material);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("isError", iserror);
|
||||
jo.put("message", message);
|
||||
|
||||
return jo;
|
||||
}
|
||||
|
||||
@@ -759,6 +759,10 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
if (this.requireSucess) {
|
||||
requireSucess = "1";
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
this.message = "信号连接超时!";
|
||||
}
|
||||
map.put("message", message);
|
||||
map.put("requireSucess", requireSucess);
|
||||
map.put("driver_type", "conveyor");
|
||||
JSONObject jo = new JSONObject(map);
|
||||
|
||||
@@ -335,6 +335,9 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
}
|
||||
jo.put("hasGoods", true);
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move1", move1);
|
||||
|
||||
@@ -628,6 +628,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
if (this.requireSucess) {
|
||||
requireSucess = "1";
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
|
||||
@@ -463,6 +463,9 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
if (this.requireSucess) {
|
||||
requireSucess = "1";
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
@@ -471,8 +474,8 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
jo.put("last_task", last_task);
|
||||
jo.put("task_code", task_code);
|
||||
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("last_task", last_task);
|
||||
jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null
|
||||
? null : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code());
|
||||
jo.put("inst_message", this.inst_message);
|
||||
jo.put("last_inst_message", this.last_inst_message);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
|
||||
@@ -456,7 +456,9 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
|
||||
if (this.requireSucess) {
|
||||
requireSucess = "1";
|
||||
}
|
||||
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
@@ -465,7 +467,8 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
|
||||
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("is_click", true);
|
||||
jo.put("requireSucess", requireSucess);
|
||||
|
||||
@@ -349,6 +349,9 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
|
||||
if (this.requireSucess) {
|
||||
requireSucess = "1";
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
|
||||
@@ -1217,8 +1217,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
if (this.requireSucess) {
|
||||
requireSucess = "1";
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
type = 4;
|
||||
}
|
||||
jo.put("requireSucess", requireSucess);
|
||||
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("status", status);
|
||||
@@ -1279,6 +1281,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
map.put("8", "双任务后工位放货完成");
|
||||
map.put("9", "双任务前工位允许放货");
|
||||
map.put("10", "双任务前工位放货完成");
|
||||
}else if(type == 4){
|
||||
return "信号连接超时!";
|
||||
} else {
|
||||
return "未执行任务";
|
||||
}
|
||||
|
||||
@@ -464,6 +464,9 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
|
||||
move = "有托盘有货";
|
||||
jo.put("hasGoods", true);
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
@@ -472,6 +475,7 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
|
||||
jo.put("error", this.getError());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("task", this.getTask());
|
||||
jo.put("message", message);
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -873,6 +873,9 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp
|
||||
if (this.applySucess) {
|
||||
applySucess = "1";
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("requireSucess", requireSucess);
|
||||
jo.put("applySucess", applySucess);
|
||||
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("isError", this.getIserror());
|
||||
jo.put("task", this.getTask());
|
||||
jo.put("message", message);
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -1105,6 +1105,9 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
move = "有托盘有货";
|
||||
jo.put("hasGoods", true);
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("driver_type", "standard_conveyor_control_with_scanner");
|
||||
jo.put("mode", mode);
|
||||
|
||||
@@ -57,6 +57,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
//有货标记
|
||||
protected boolean has_goods_tag = false;
|
||||
|
||||
int heartbeat = 0;
|
||||
int mode = 0;
|
||||
int error = 0;
|
||||
int move = 0;
|
||||
@@ -133,6 +134,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
heartbeat = this.itemProtocol.getHeartbeat();
|
||||
error = this.itemProtocol.getError();
|
||||
move = this.itemProtocol.getMove();
|
||||
action = this.itemProtocol.getAction();
|
||||
@@ -233,6 +235,9 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
move = "有托盘有货";
|
||||
jo.put("hasGoods", true);
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
@@ -243,6 +248,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
jo.put("task", this.getTask());
|
||||
jo.put("is_click", true);
|
||||
jo.put("is_force", this.getIs_force());
|
||||
jo.put("message", message);
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -413,6 +413,34 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
// 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统
|
||||
if (!StrUtil.equals(task.getAgv_system_type(), "0")
|
||||
&& 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);
|
||||
log.warn("下发AGV指令数据,"+ "指令号:" + dto.getInstruction_code() + ",AGV系统类型:"+ dto.getAgv_system_type()
|
||||
+ ",AGV指令类型:" + dto.getInstruction_type() );
|
||||
|
||||
Reference in New Issue
Block a user