opt: 拔轴机优化

This commit is contained in:
yanps
2024-05-09 19:07:36 +08:00
parent de4ef00659
commit b0f9b1c038
5 changed files with 18 additions and 54 deletions

View File

@@ -20,7 +20,7 @@ ItemProtocol {
//光电信号
public static String item_move = "move1";
//动作信号
public static String item_action = "action";
public static String item_action = "action1";
//行走列
public static String item_walk_y = "walk_y";
//任务号

View File

@@ -275,6 +275,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
this.writing(map);
logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse);
message = "申请行架任务成功";
requireSucess = true;
} else {
message = applyManipulatorActionResponse.getMessage();
map.put("to_command", 99);
@@ -355,7 +356,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("message", message);
jo.put("notCreateTaskMessage", notCreateTaskMessage);
jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
jo.put("feedMessage", LangProcess.msg(feedMessage));

View File

@@ -243,10 +243,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
if (requireSucess) {
remark = "universal_remark5";
remark = "未复位";
}
this.setNotCreateTaskMessage(remark);
//}
}
}
@@ -1128,7 +1127,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("isError", this.getIserror());
jo.put("message", message);
jo.put("notCreateTaskMessage", notCreateTaskMessage);
jo.put("notCreateInstMessage", notCreateInstMessage);
jo.put("notCreateInstMessage", notCreateInstMessage);
jo.put("feedMessage", feedMessage);
jo.put("requireActionSucess", requireActionSucess);
jo.put("driver_type", "siemens_conveyor");

View File

@@ -409,26 +409,6 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String interactionJson = taskDto.getInteraction_json();
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
Map<String, Object> map = new LinkedHashMap<>();
/*if(ObjectUtil.isNotEmpty(interactionJsonDTO)){
toDevice(interactionJsonDTO.getToPull(),"to_pull",map);
toDevice(interactionJsonDTO.getIsBushing(),"is_bushing",map);
toDevice(interactionJsonDTO.getToSize(),"to_size",map);
toDevice(interactionJsonDTO.getToBarcode(),"to_barcode",map);
toDevice(interactionJsonDTO.getToMaterial1(),"to_material1",map);
toDevice(interactionJsonDTO.getToMaterial2(),"to_material2",map);
toDevice(interactionJsonDTO.getToSpec1(),"to_spec1",map);
toDevice(interactionJsonDTO.getToSpec2(),"to_spec2",map);
toDevice(interactionJsonDTO.getToQty1(),"to_qty1",map);
toDevice(interactionJsonDTO.getToSize1(),"to_size1",map);
toDevice(interactionJsonDTO.getToSize2(),"to_size2",map);
toDevice(interactionJsonDTO.getToMaterial3(),"to_material3",map);
toDevice(interactionJsonDTO.getToMaterial4(),"to_material4",map);
toDevice(interactionJsonDTO.getToSpec3(),"to_spec3",map);
toDevice(interactionJsonDTO.getToSpec4(),"to_spec4",map);
toDevice(interactionJsonDTO.getToQty2(),"to_qty2",map);
toDevice(interactionJsonDTO.getToSize3(),"to_size3",map);
toDevice(interactionJsonDTO.getToSize4(),"to_size4",map);
}*/
map.put("to_command", CommonFinalParam.ONE);
map.put("to_onset", start_addr);
map.put("to_task", instruction.getInstruction_code());
@@ -511,26 +491,6 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
Map<String, Object> map = new LinkedHashMap<>();
/*if(ObjectUtil.isNotEmpty(interactionJsonDTO)){
toDevice(interactionJsonDTO.getToPull(),"to_pull",map);
toDevice(interactionJsonDTO.getIsBushing(),"is_bushing",map);
toDevice(interactionJsonDTO.getToSize(),"to_size",map);
toDevice(interactionJsonDTO.getToBarcode(),"to_barcode",map);
toDevice(interactionJsonDTO.getToMaterial1(),"to_material1",map);
toDevice(interactionJsonDTO.getToMaterial2(),"to_material2",map);
toDevice(interactionJsonDTO.getToSpec1(),"to_spec1",map);
toDevice(interactionJsonDTO.getToSpec2(),"to_spec2",map);
toDevice(interactionJsonDTO.getToQty1(),"to_qty1",map);
toDevice(interactionJsonDTO.getToSize1(),"to_size1",map);
toDevice(interactionJsonDTO.getToSize2(),"to_size2",map);
toDevice(interactionJsonDTO.getToMaterial3(),"to_material3",map);
toDevice(interactionJsonDTO.getToMaterial4(),"to_material4",map);
toDevice(interactionJsonDTO.getToSpec3(),"to_spec3",map);
toDevice(interactionJsonDTO.getToSpec4(),"to_spec4",map);
toDevice(interactionJsonDTO.getToQty2(),"to_qty2",map);
toDevice(interactionJsonDTO.getToSize3(),"to_size3",map);
toDevice(interactionJsonDTO.getToSize4(),"to_size4",map);
}*/
map.put("to_command", CommonFinalParam.ONE);
map.put("to_onset", start_addr);
map.put("to_task", instdto.getInstruction_code());
@@ -663,7 +623,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
jo.put("message", LangProcess.msg(message));
jo.put("notCreateTaskMessage", notCreateTaskMessage);
jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
jo.put("feedMessage", LangProcess.msg(feedMessage));
jo.put("feedMessage",feedMessage);
jo.put("driver_type", "siemens_conveyor");
jo.put("is_click", true);
jo.put("x", x_position);

View File

@@ -413,10 +413,12 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
}
if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time")) {
// 存在上次点位值为null情况 则不记录日志
LuceneLogDto luceneLogDto = new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1),
String.valueOf(his), String.valueOf(value));
luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc());
log.info("{}", JSON.toJSONString(luceneLogDto));
if(!(his instanceof Double) && !(value instanceof Double)){
LuceneLogDto luceneLogDto = new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1),
String.valueOf(his), String.valueOf(value));
luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc());
log.info("{}", JSON.toJSONString(luceneLogDto));
}
}
} else {
// if(his instanceof int[]){
@@ -433,10 +435,12 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
// log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value});
if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time")) {
LuceneLogDto luceneLogDto = new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1),
String.valueOf(his), String.valueOf(value));
luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc());
log.info("{}", JSON.toJSONString(luceneLogDto));
if(!(his instanceof Double) && !(value instanceof Double)){
LuceneLogDto luceneLogDto = new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1),
String.valueOf(his), String.valueOf(value));
luceneLogDto.setLogType(LogTypeEnum.DEVICE_LOG.getDesc());
log.info("{}", JSON.toJSONString(luceneLogDto));
}
}
}
}