opt: 内包间A1优化
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -255,10 +256,16 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
remark = "纸管库的任务号为空";
|
||||
} else if (task1 < 1) {
|
||||
remark = "行架任务为空";
|
||||
} else if (requireSucess) {
|
||||
remark = "requrieSucess为" + requireSucess;
|
||||
} else {
|
||||
remark = "requrieSucess 为: " + requireSucess;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (move == 0 && !requireSucess) {
|
||||
sucess();
|
||||
}else if (move != 0){
|
||||
remark = "套管工位有货";
|
||||
}
|
||||
default:
|
||||
log.info("未知模式");
|
||||
break;
|
||||
@@ -277,6 +284,29 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
last_qty = qty;
|
||||
}
|
||||
|
||||
//取货完成
|
||||
private void sucess() {
|
||||
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
||||
Instruction inst1 = instructionService.findByCode(String.valueOf(task));
|
||||
String task_code = inst1.getTask_code();
|
||||
applyManipulatorActionRequest.setAction("1");
|
||||
applyManipulatorActionRequest.setTask_code1(task_code);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈套管工位取货完成");
|
||||
ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
|
||||
if (applyManipulatorActionResponse1.getstatus() == 200) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "套管工位取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 6);
|
||||
this.writing(map);
|
||||
message = "套管工位取货完成";
|
||||
requireSucess = true;
|
||||
} else {
|
||||
requireSucess = false;
|
||||
message = "套管工位取货失败";
|
||||
//logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货失败,返回参数:" + applyManipulatorActionResponse1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private synchronized void bushingSucess() {
|
||||
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
||||
@@ -432,6 +462,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
move = "有托盘";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("task", task);
|
||||
jo.put("mode", mode);
|
||||
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
|
||||
jo.put("move", move);
|
||||
@@ -440,7 +471,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
jo.put("material1", material1);
|
||||
jo.put("material2", material2);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("message", ObjectUtil.isNotEmpty(remark)?"反馈套管失败的原因:"+remark:remark);
|
||||
jo.put("message", ObjectUtil.isNotEmpty(remark) ? "反馈套管失败的原因:" + remark : remark);
|
||||
|
||||
return jo;
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
//logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
message = "申请放货点LMS失败," + String.valueOf(applyManipulatorActionResponse.getMessage());
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
//logServer.deviceExecuteLog(this.device_code, "", "", "申请放货点请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -503,7 +503,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
message = "申请新取货点失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请新取货点失败,返回参数:" + applyManipulatorActionResponse);
|
||||
//logServer.deviceExecuteLog(this.device_code, "", "", "申请新取货点失败,返回参数:" + applyManipulatorActionResponse);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
message = "申请二次放货点失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点,返回参数:" + applyManipulatorActionResponse);
|
||||
//logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点,返回参数:" + applyManipulatorActionResponse);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,7 +551,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
message = "缓存库取货失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货失败,返回参数:" + applyManipulatorActionResponse1);
|
||||
//logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货失败,返回参数:" + applyManipulatorActionResponse1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -572,14 +572,30 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
message = "缓存库放货失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,返回参数:" + applyManipulatorActionResponse1);
|
||||
//logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,返回参数:" + applyManipulatorActionResponse1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//异常气胀轴反馈
|
||||
/*if (action == 9) {
|
||||
String task_code = inst1.getTask_code();
|
||||
if (action == 9) {
|
||||
try {
|
||||
instructionService.cancel(inst1.getInstruction_id());
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "取消指令完成");
|
||||
TaskDto byTaskCode = taskserver.findByTaskCode(inst1.getTask_code());
|
||||
taskserver.cancel(byTaskCode.getTask_id());
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "取消任务完成");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 9);
|
||||
this.writing(map);
|
||||
feedbackSucess = true;
|
||||
message = "异常气胀轴任务取消成功";
|
||||
} catch (Exception e) {
|
||||
message = "取消任务或指令失败,失败原因"+ e.getMessage();
|
||||
feedbackSucess = false;
|
||||
//logServer.deviceExecuteLog(this.device_code, "", "", "取消任务或指令失败,失败原因"+e.getMessage());
|
||||
}
|
||||
/*String task_code = inst1.getTask_code();
|
||||
applyManipulatorActionRequest.setType("9");
|
||||
applyManipulatorActionRequest.setTask_code1(task_code);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "异常反馈");
|
||||
@@ -601,8 +617,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
message = "取消任务或指令失败,失败原因"+ e.getMessage();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "取消任务或指令失败,失败原因"+e.getMessage());
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
//放货完成
|
||||
@@ -762,6 +778,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
jo.put("x", x_position);
|
||||
jo.put("y", y_position);
|
||||
jo.put("inflatable_shaft_size", this.inflatable_shaft_size);
|
||||
jo.put("version", this.inflatableShaftVersion);
|
||||
jo.put("driver_type", "station");
|
||||
return jo;
|
||||
}
|
||||
@@ -1003,20 +1020,24 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
rgv1 = (RgvDeviceDriver) agv1.getDeviceDriver();
|
||||
rgv2 = (RgvDeviceDriver) agv2.getDeviceDriver();
|
||||
if ((rgv1.getMode() == 2 && rgv1.getMove1() == 1 && rgv1.getMove2() == 0) || (rgv2.getMode() == 2 && rgv2.getMove1() == 1 && rgv2.getMove2() == 0)) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "mode1" + rgv1.getMode() + "mode2" +
|
||||
rgv2.getMode() + "rgv1的move2" + rgv1.getMove2() + "rgv2的move2" + rgv2.getMove2());
|
||||
/*logServer.deviceExecuteLog(device_code, "", "", "mode1" + rgv1.getMode() + "mode2" +
|
||||
rgv2.getMode() + "rgv1的move2" + rgv1.getMove2() + "rgv2的move2" + rgv2.getMove2());*/
|
||||
return true;
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "rgv信号不符合");
|
||||
message = "rgv信号不符合";
|
||||
//logServer.deviceExecuteLog(device_code, "", "", "rgv信号不符合");
|
||||
}
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "关联的站点不是rgv");
|
||||
message = "关联的站点不是rgv";
|
||||
//logServer.deviceExecuteLog(device_code, "", "", "关联的站点不是rgv");
|
||||
}
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "rgv没有关联站点");
|
||||
message = "rgv没有关联站点";
|
||||
//logServer.deviceExecuteLog(device_code, "", "", "rgv没有关联站点");
|
||||
}
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "rgv不是普通站点");
|
||||
message = "rgv不是普通站点";
|
||||
//logServer.deviceExecuteLog(device_code, "", "", "rgv不是普通站点");
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -212,6 +212,8 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
//1-执行任务;2-取货完成;3-放货完成;
|
||||
int flag;
|
||||
|
||||
String msg = "";
|
||||
|
||||
|
||||
int last_inventory_qty = 0;
|
||||
int last_out_finish = 0;
|
||||
@@ -475,7 +477,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
}
|
||||
|
||||
|
||||
public synchronized void request_for_shipment(String mode, String item_out_seq_arr, String item_out_qty_arr) {
|
||||
public synchronized void request_for_shipment(String mode, String item_out_seq_arr, String item_out_qty_arr) {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.require_apply_strangulation_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
@@ -714,9 +716,9 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
} else if (this.getMode() == 4) {
|
||||
mode = "申请出纸管";
|
||||
}
|
||||
if(this.getMove() == 0){
|
||||
if (this.getMove() == 0) {
|
||||
move = "无货";
|
||||
}else if(this.getMove() == 1){
|
||||
} else if (this.getMove() == 1) {
|
||||
move = "有托盘";
|
||||
}
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
|
||||
@@ -65,12 +65,12 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
int error = 0;
|
||||
int move = 0;
|
||||
int task1 = 0;
|
||||
// int task2 = 0;
|
||||
// int task2 = 0;
|
||||
int last_mode = 0;
|
||||
int last_error = 0;
|
||||
int last_move = 0;
|
||||
int last_task1 = 0;
|
||||
// int last_task2 = 0;
|
||||
// int last_task2 = 0;
|
||||
Boolean isonline = true;
|
||||
|
||||
Boolean iserror = false;
|
||||
@@ -104,7 +104,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
// task2 = this.itemProtocol.getTask2();
|
||||
|
||||
if (mode != last_mode) {
|
||||
this.requireSucess=false;
|
||||
this.requireSucess = false;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记");
|
||||
}
|
||||
if (move != last_move) {
|
||||
@@ -176,14 +176,14 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
applyManipulatorActionRequest.setTask_code1(task_code1);
|
||||
applyManipulatorActionRequest.setType("8");
|
||||
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
|
||||
if (applyManipulatorActionResponse.getstatus()==200) {
|
||||
if (applyManipulatorActionResponse.getstatus() == 200) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 6);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "拔轴成功反馈,返回参数:" + applyManipulatorActionResponse);
|
||||
message = "拔轴完成成功";
|
||||
}else{
|
||||
} else {
|
||||
message = applyManipulatorActionResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
@@ -194,9 +194,6 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private synchronized void bushingSucess() {
|
||||
List list = new ArrayList();
|
||||
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
||||
@@ -210,14 +207,14 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
// applyManipulatorActionRequest.setTask_code2(task_code2);
|
||||
applyManipulatorActionRequest.setType("7");
|
||||
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
|
||||
if (applyManipulatorActionResponse.getstatus()==200) {
|
||||
if (applyManipulatorActionResponse.getstatus() == 200) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 5);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴反馈完成,返回参数:" + applyManipulatorActionResponse);
|
||||
message = "套轴完成成功";
|
||||
}else{
|
||||
} else {
|
||||
message = applyManipulatorActionResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
@@ -248,7 +245,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴成功,返回参数:" + applyManipulatorActionResponse);
|
||||
message = "套轴申请成功";
|
||||
}else if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && "2".equals(applyManipulatorActionResponse.getIs_bushing())){
|
||||
} else if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && "2".equals(applyManipulatorActionResponse.getIs_bushing())) {
|
||||
message = applyManipulatorActionResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 98);
|
||||
@@ -256,7 +253,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
requireSucess = true;
|
||||
message = "等待套轴";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "等待套轴,返回参数:" + applyManipulatorActionResponse);
|
||||
}else {
|
||||
} else {
|
||||
message = applyManipulatorActionResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
@@ -290,7 +287,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
*
|
||||
* @param map
|
||||
*/
|
||||
public void writing(Map<String, Object> map) {
|
||||
public void writing(Map<String, Object> map) {
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
Map<String, Object> itemMap = new LinkedHashMap<>();
|
||||
map.forEach((key, value) -> {
|
||||
|
||||
@@ -120,6 +120,15 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
if(!move2.equals(last_move2)){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_move2 + "->" + move2);
|
||||
}
|
||||
if(qty1 != last_qty1){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_qty1 + "->" + qty1);
|
||||
}
|
||||
if(qty2 != last_qty2){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_qty2 + "->" + qty2);
|
||||
}
|
||||
if(task != last_task){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_task + "->" + task);
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception var17) {
|
||||
|
||||
@@ -469,7 +469,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
applyManipulatorActionRequest.setTask_code1(inst.getTask_code());
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + applyManipulatorActionRequest);
|
||||
try {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
ApplyManipulatorActionResponse response = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
|
||||
if (response == null || response.getstatus() == 200) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user