opt: 套管工位实现套管完成业务

This commit is contained in:
yanps
2023-12-13 10:53:17 +08:00
parent 82a8540504
commit d7c8665c54
2 changed files with 42 additions and 7 deletions

View File

@@ -206,7 +206,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceExecuteLog(this.device_code, "", "", "信号qty" + last_qty + "->" + qty); logServer.deviceExecuteLog(this.device_code, "", "", "信号qty" + last_qty + "->" + qty);
} }
if (move != 0 && task > 0 && task1 > 0) { if (move != 0 && task > 0 ) {
update_instruction_status(); update_instruction_status();
} }
@@ -241,12 +241,16 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
case 3: case 3:
log.info("运行中"); log.info("运行中");
break; break;
default: case 4:
if (move == 1 && !requireSucess) { if (move == 1 && !requireSucess && task > 0 && task1 > 0) {
//申请套管校验 //申请套管校验
apply_for_casing_inspection(material1, material2); // apply_for_casing_inspection(material1, material2);
bushingSucess();
} }
break; break;
default:
log.info("未知模式");
break;
} }
} }
last_heartbeat = heartbeat; last_heartbeat = heartbeat;
@@ -262,6 +266,37 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
last_qty = qty; last_qty = qty;
} }
private synchronized void bushingSucess() {
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
ApplyManipulatorActionResponse applyManipulatorActionResponse;
Instruction inst1 = instructionService.findByCode(String.valueOf(task1));
// Instruction inst2 = instructionService.findByCode(String.valueOf(task2));
String task_code1 = inst1.getTask_code();
// String task_code2 = inst2.getTask_code();
applyManipulatorActionRequest.setDevice_code(device_code);
applyManipulatorActionRequest.setTask_code1(task_code1);
// applyManipulatorActionRequest.setTask_code2(task_code2);
applyManipulatorActionRequest.setType("7");
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse.getstatus() == 200) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 4);
this.writing(map);
requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse);
message = "套轴完成成功";
} else {
message = applyManipulatorActionResponse.getMessage();
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 99);
this.writing(map);
requireSucess = true;
message = "套轴失败";
logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse);
}
}
/** /**
* 更新指令状态 * 更新指令状态
*/ */

View File

@@ -117,8 +117,8 @@ public class ItemProtocol {
list.add(new ItemDto(item_move, "光电信号", "DB101.W4")); list.add(new ItemDto(item_move, "光电信号", "DB101.W4"));
list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB101.W6")); list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB101.W6"));
list.add(new ItemDto(item_error, "报警", "DB101.W8")); list.add(new ItemDto(item_error, "报警", "DB101.W8"));
list.add(new ItemDto(item_task, "任务号1", "DB101.D116")); list.add(new ItemDto(item_task, "任务号1", "DB101.DW116"));
list.add(new ItemDto(item_task1, "任务号2", "DB101.D118")); list.add(new ItemDto(item_task1, "任务号2", "DB101.DW118"));
list.add(new ItemDto(item_material1, "物料1", "DB101.STRING10.50")); list.add(new ItemDto(item_material1, "物料1", "DB101.STRING10.50"));
list.add(new ItemDto(item_material2, "物料2", "DB101.STRING62.50")); list.add(new ItemDto(item_material2, "物料2", "DB101.STRING62.50"));
list.add(new ItemDto(item_qty, "数量", "DB101.W114")); list.add(new ItemDto(item_qty, "数量", "DB101.W114"));