rev 下发信号
This commit is contained in:
@@ -348,9 +348,9 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
jo.put("mode", mode);
|
jo.put("mode", mode);
|
||||||
jo.put("move", move);
|
jo.put("move", move);
|
||||||
jo.put("action", action);
|
jo.put("action", action);
|
||||||
jo.put("isOnline", this.getIsonline());
|
// jo.put("isOnline", this.getIsonline());
|
||||||
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());
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -406,11 +406,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
|
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
if (inst2 != null) {
|
if (inst2 != null) {
|
||||||
if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
|
if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
|
||||||
try {
|
|
||||||
finish_instruction(inst2);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
TaskDto taskDto = taskserver.findByCode(inst2.getTask_code());
|
TaskDto taskDto = taskserver.findByCode(inst2.getTask_code());
|
||||||
|
|
||||||
String next_device_code = inst2.getNext_device_code();
|
String next_device_code = inst2.getNext_device_code();
|
||||||
@@ -457,18 +453,15 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.writing("to_command", "5");
|
||||||
if (this.getNow_steps_type() == 5) {
|
this.setNow_steps_type(6);
|
||||||
this.writing("to_command", "5");
|
this.setNow_steps_type(0);
|
||||||
this.setNow_steps_type(6);
|
try {
|
||||||
this.setNow_steps_type(0);
|
finish_instruction(inst2);
|
||||||
feedMessage = "";
|
} catch (Exception e) {
|
||||||
} else {
|
e.printStackTrace();
|
||||||
//logServer.deviceExecuteLog(this.device_code, "", "", "未反馈电气信号原因:当前步骤不为放货完成(now_steps_type!=5)");
|
|
||||||
}
|
}
|
||||||
// this.writing("to_onset", "0");
|
feedMessage = "";
|
||||||
// this.writing("to_target", "0");
|
|
||||||
// this.writing("to_task", "0");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1022,11 +1015,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
@Override
|
@Override
|
||||||
public JSONObject feedLmsRealFailedInfo() {
|
public JSONObject feedLmsRealFailedInfo() {
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("device_code",this.getDevice().getDevice_code());
|
jo.put("device_code", this.getDevice().getDevice_code());
|
||||||
jo.put("device_name",this.getDevice().getDevice_name());
|
jo.put("device_name", this.getDevice().getDevice_name());
|
||||||
jo.put("fault_code",String.valueOf(error));
|
jo.put("fault_code", String.valueOf(error));
|
||||||
jo.put("fault_info",ErrorUtil.getDictDetail(error_type, String.valueOf(this.getError())));
|
jo.put("fault_info", ErrorUtil.getDictDetail(error_type, String.valueOf(this.getError())));
|
||||||
jo.put("fault_type",error_type);
|
jo.put("fault_type", error_type);
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,10 +130,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
private int instruction_require_time_out = 3000;
|
private int instruction_require_time_out = 3000;
|
||||||
//行架机械手申请任务成功标识
|
//行架机械手申请任务成功标识
|
||||||
boolean requireSucess = false;
|
boolean requireSucess = false;
|
||||||
boolean requireApplyLabelingSuccess = false;
|
|
||||||
boolean requireApplyLaStrangulationSuccess = false;
|
|
||||||
boolean requireEmptyInSuccess = false;
|
boolean requireEmptyInSuccess = false;
|
||||||
boolean requireEmptyOutSuccess = false;
|
|
||||||
boolean requiresShipDeviceUpdate = true;
|
boolean requiresShipDeviceUpdate = true;
|
||||||
private int instruction_finished_time_out;
|
private int instruction_finished_time_out;
|
||||||
|
|
||||||
@@ -185,11 +182,18 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task);
|
||||||
}
|
}
|
||||||
if (mode != last_mode) {
|
if (mode != last_mode) {
|
||||||
requireSucess = false;
|
|
||||||
requireApplyLabelingSuccess = false;
|
//Boolean flag = ObjectUtil.isEmpty(this.device.getExtraValue().get("special_flag")) ? false : Boolean.valueOf(this.device.getExtraValue().get("special_flag").toString());
|
||||||
requireApplyLaStrangulationSuccess = false;
|
//暂时这样写 后续通过配置判断
|
||||||
requireEmptyInSuccess = false;
|
if (StrUtil.equals(this.device_code, "1018")) {
|
||||||
requireEmptyOutSuccess = false;
|
if (mode == 6 && last_mode == 2) {
|
||||||
|
requireSucess = false;
|
||||||
|
requireEmptyInSuccess = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
requireSucess = false;
|
||||||
|
requireEmptyInSuccess = false;
|
||||||
|
}
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess);
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||||
}
|
}
|
||||||
@@ -316,8 +320,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
case 5:
|
case 5:
|
||||||
//申请贴标
|
//申请贴标
|
||||||
if (move > 0 && !requireSucess) {
|
if (move > 0 && !requireSucess) {
|
||||||
applyLabeling();
|
//applyLabeling();
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
@@ -756,61 +759,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//申请贴标
|
|
||||||
public synchronized void applyLabeling() {
|
|
||||||
Date date = new Date();
|
|
||||||
if (date.getTime() - this.require_apply_labeling_time.getTime() < (long) this.instruction_require_time_out) {
|
|
||||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
this.require_apply_labeling_time = date;
|
|
||||||
String vehicle_code = "";
|
|
||||||
if (task > 0) {
|
|
||||||
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
|
||||||
vehicle_code = instruction.getVehicle_code();
|
|
||||||
} else {
|
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:" + task + "异常");
|
|
||||||
message = "申请贴标电气设备任务号:" + task + "异常";
|
|
||||||
throw new RuntimeException("任务号为空!");
|
|
||||||
}
|
|
||||||
if (StrUtil.isEmpty(vehicle_code)) {
|
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:" + task + "未找到载具号");
|
|
||||||
message = "申请贴标电气设备任务号:" + task + "未找到载具号";
|
|
||||||
throw new RuntimeException("载具号为空!");
|
|
||||||
}
|
|
||||||
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
|
|
||||||
new ApplyLabelingAndBindingRequest();
|
|
||||||
JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0);
|
|
||||||
String start_point_code = null;
|
|
||||||
if (!ObjectUtil.isEmpty(device_json)) {
|
|
||||||
start_point_code = (String) device_json.get("parent_storage_code") == null ? this.device_code : (String) device_json.get("parent_storage_code");
|
|
||||||
}
|
|
||||||
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
|
||||||
applyLabelingAndBindingRequest.setType("1");
|
|
||||||
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,请求参数:" + applyLabelingAndBindingRequest);
|
|
||||||
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
|
||||||
|
|
||||||
if (applyLabelingAndBindingResponse.getstatus() == 200) {
|
|
||||||
message = "申请贴标成功";
|
|
||||||
List list = new ArrayList();
|
|
||||||
Map map = new HashMap();
|
|
||||||
map.put("code", "to_command");
|
|
||||||
map.put("value", "5");
|
|
||||||
list.add(map);
|
|
||||||
this.writing(list);
|
|
||||||
this.writing(list);
|
|
||||||
message = "申请贴标下发电气信号成功";
|
|
||||||
requireApplyLabelingSuccess = true;
|
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,返回参数:" + applyLabelingAndBindingResponse);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
message = "申请贴标失败," + applyLabelingAndBindingResponse.getMessage();
|
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,返回参数:" + applyLabelingAndBindingResponse);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//申请捆扎
|
//申请捆扎
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public synchronized void applyLaStrangulation(String mode) {
|
public synchronized void applyLaStrangulation(String mode) {
|
||||||
@@ -891,7 +839,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
// this.writing(list);
|
// this.writing(list);
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,返回参数:" + applyLabelingAndBindingResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,返回参数:" + applyLabelingAndBindingResponse);
|
||||||
message = "申请捆扎成功";
|
message = "申请捆扎成功";
|
||||||
requireSucess = true;
|
//requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
message = "未返回尺寸信息";
|
message = "未返回尺寸信息";
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,返回参数:" + applyLabelingAndBindingResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,返回参数:" + applyLabelingAndBindingResponse);
|
||||||
|
|||||||
@@ -232,13 +232,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为:" + requireSucess);
|
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为:" + requireSucess);
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为:" + requireSucess);
|
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为:" + requireSucess);
|
||||||
// if (task1 == 0 && task2 == 0 && type == 0) {
|
|
||||||
// logServer.deviceExecuteLog(device_code, "", "", "开始复位当前执行步骤");
|
|
||||||
// this.setNow_steps_type1(0);
|
|
||||||
// this.setNow_steps_type2(0);
|
|
||||||
// this.setNow_steps_type3(0);
|
|
||||||
// logServer.deviceExecuteLog(device_code, "", "", "复位当前执行步骤成功");
|
|
||||||
// }
|
|
||||||
feedMessage = "";
|
feedMessage = "";
|
||||||
notCreateTaskMessage = "";
|
notCreateTaskMessage = "";
|
||||||
notCreateInstMessage = "";
|
notCreateInstMessage = "";
|
||||||
@@ -512,12 +505,12 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task2));
|
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task2));
|
||||||
if (inst2 != null) {
|
if (inst2 != null) {
|
||||||
if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
|
if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
|
||||||
finish_instruction(inst2);
|
|
||||||
if (to_command2 != 5) {
|
if (to_command2 != 5) {
|
||||||
this.writing("to_command2", "5");
|
this.writing("to_command2", "5");
|
||||||
}
|
}
|
||||||
this.setNow_steps_type2(6);
|
this.setNow_steps_type2(6);
|
||||||
this.setNow_steps_type2(0);
|
this.setNow_steps_type2(0);
|
||||||
|
finish_instruction(inst2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -637,12 +630,12 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
|
||||||
if (inst1 != null) {
|
if (inst1 != null) {
|
||||||
if (StrUtil.equals(inst1.getInstruction_status(), "1")) {
|
if (StrUtil.equals(inst1.getInstruction_status(), "1")) {
|
||||||
this.finish_instruction(inst1);
|
|
||||||
if (to_command1 != 5) {
|
if (to_command1 != 5) {
|
||||||
this.writing("to_command1", "5");
|
this.writing("to_command1", "5");
|
||||||
}
|
}
|
||||||
this.setNow_steps_type1(6);
|
this.setNow_steps_type1(6);
|
||||||
this.setNow_steps_type1(0);
|
this.setNow_steps_type1(0);
|
||||||
|
this.finish_instruction(inst1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -673,12 +666,12 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
|
||||||
if (inst1 != null) {
|
if (inst1 != null) {
|
||||||
if (StrUtil.equals(inst1.getInstruction_status(), "1")) {
|
if (StrUtil.equals(inst1.getInstruction_status(), "1")) {
|
||||||
this.finish_instruction(inst1);
|
|
||||||
if (to_command1 != 5) {
|
if (to_command1 != 5) {
|
||||||
this.writing("to_command1", "5");
|
this.writing("to_command1", "5");
|
||||||
}
|
}
|
||||||
this.setNow_steps_type3(10);
|
this.setNow_steps_type3(10);
|
||||||
this.setNow_steps_type3(0);
|
this.setNow_steps_type3(0);
|
||||||
|
this.finish_instruction(inst1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -821,8 +814,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_write_time);
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_write_time);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if(ObjectUtil.isNotEmpty(cache_inst)) {
|
if (ObjectUtil.isNotEmpty(cache_inst)) {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "程序逻辑校验,下发指令信号后电气任务号未变化,再次下发指令号:"+cache_inst.getInstruction_code() +",行架指令类型:"+type );
|
logServer.deviceExecuteLog(this.device_code, "", "", "程序逻辑校验,下发指令信号后电气任务号未变化,再次下发指令号:" + cache_inst.getInstruction_code() + ",行架指令类型:" + type);
|
||||||
|
|
||||||
//前工位任务
|
//前工位任务
|
||||||
if (StrUtil.equals(inst_type, "1")) {
|
if (StrUtil.equals(inst_type, "1")) {
|
||||||
@@ -1601,11 +1594,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
@Override
|
@Override
|
||||||
public JSONObject feedLmsRealFailedInfo() {
|
public JSONObject feedLmsRealFailedInfo() {
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("device_code",this.getDevice().getDevice_code());
|
jo.put("device_code", this.getDevice().getDevice_code());
|
||||||
jo.put("device_name",this.getDevice().getDevice_name());
|
jo.put("device_name", this.getDevice().getDevice_name());
|
||||||
jo.put("fault_code",String.valueOf(error));
|
jo.put("fault_code", String.valueOf(error));
|
||||||
jo.put("fault_info",ErrorUtil.getDictDetail(error_type, String.valueOf(this.getError())));
|
jo.put("fault_info", ErrorUtil.getDictDetail(error_type, String.valueOf(this.getError())));
|
||||||
jo.put("fault_type",error_type);
|
jo.put("fault_type", error_type);
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,6 +142,11 @@
|
|||||||
<el-switch v-model="form.ship_device_update" />
|
<el-switch v-model="form.ship_device_update" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="特殊请求标记复位" label-width="150px">
|
||||||
|
<el-switch v-model="form.special_flag" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -314,7 +319,8 @@ export default {
|
|||||||
is_pickup: true,
|
is_pickup: true,
|
||||||
is_release: true,
|
is_release: true,
|
||||||
link_device_code: [],
|
link_device_code: [],
|
||||||
ship_device_update: true
|
ship_device_update: true,
|
||||||
|
special_flag: true
|
||||||
},
|
},
|
||||||
rules: {}
|
rules: {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user