opt: 现场与设备联调测试优化

This commit is contained in:
yanps
2024-04-13 10:00:05 +08:00
parent 08fbf1ea8e
commit 0a3772f510
21 changed files with 62 additions and 95 deletions

View File

@@ -801,7 +801,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("task", task); jo.put("task", task);
jo.put("walk_y", String.valueOf(this.walk_y)); jo.put("walk_y", String.valueOf(this.walk_y));
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError()); jo.put("error", StrUtil.isNotEmpty(ErrorUtil.getDictDetail("nbjhj_error_type", String.valueOf(this.getError())))
?ErrorUtil.getDictDetail("nbjhj_error_type", String.valueOf(this.getError())):this.getError());
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", this.getMessage()); jo.put("message", this.getMessage());
jo.put("is_click", true); jo.put("is_click", true);

View File

@@ -311,6 +311,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
mode = "单机"; mode = "单机";
} else if (this.getMode() == 2) { } else if (this.getMode() == 2) {
mode = "联机"; mode = "联机";
} else if (this.getMode() == 3 && this.move2 == 1) {
mode = "等待人工吊卷";
} else if (this.getMode() == 3) { } else if (this.getMode() == 3) {
mode = "运行中"; mode = "运行中";
} else if (this.getMode() == 4) { } else if (this.getMode() == 4) {
@@ -318,14 +320,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
} }
if (this.getMove1() == 0 && this.getMove2() == 0) { if (this.getMove1() == 0 && this.getMove2() == 0) {
move1 = "无货"; move1 = "吊卷位";
move2 = "无货"; move2 = "无货";
jo.put("hasGoods", false); jo.put("hasGoods", false);
} else if (this.getMove1() == 1 || this.getMove2() == 1) { } else if (this.getMove1() == 1 || this.getMove2() == 1) {
if(this.getMove1() == 1){ if(this.getMove1() == 1){
move1 = "有货"; move1 = "下卷位";
}else if(this.getMove1() == 0){ }else if(this.getMove1() == 0){
move1 = "无货"; move2 = "吊卷位";
} }
if(this.getMove2() == 1){ if(this.getMove2() == 1){
move2 = "有货"; move2 = "有货";

View File

@@ -287,8 +287,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
param.put("product_area", paramService.findByCode("productArea").getValue()); param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param); acsToWmsService.sendDeviceStatus(param);
/*logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);*/ logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
} }
if (status != last_status) { if (status != last_status) {
logServer.deviceItemValue(this.device_code, "status", String.valueOf(status)); logServer.deviceItemValue(this.device_code, "status", String.valueOf(status));

View File

@@ -675,10 +675,10 @@ export default {
const obj = { name: '重量2', value: data[val] } const obj = { name: '重量2', value: data[val] }
this.arr.push(obj) this.arr.push(obj)
} else if (val === 'move1') { } else if (val === 'move1') {
const obj = { name: '光电信号1', value: data[val] } const obj = { name: '设备工位', value: data[val] }
this.arr.push(obj) this.arr.push(obj)
} else if (val === 'move2') { } else if (val === 'move2') {
const obj = { name: '光电信号2', value: data[val] } const obj = { name: '设备有无货', value: data[val] }
this.arr.push(obj) this.arr.push(obj)
} else if (val === 'material1') { } else if (val === 'material1') {
const obj = { name: '物料1', value: this.dict.label.material[data[val]] } const obj = { name: '物料1', value: this.dict.label.material[data[val]] }

View File

@@ -226,13 +226,10 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
container_type = this.itemProtocol.getContainer_type(); container_type = this.itemProtocol.getContainer_type();
error = this.itemProtocol.getError(); error = this.itemProtocol.getError();
task = this.itemProtocol.getTask(); task = this.itemProtocol.getTask();
container_no = this.itemProtocol.getContainer_no();
material_barcode= this.itemProtocol.getMaterialBarcode();
to_command = this.itemProtocol.getTo_command(); to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTotarget(); to_target = this.itemProtocol.getTotarget();
to_task = this.itemProtocol.getTo_task(); to_task = this.itemProtocol.getTo_task();
to_container_no = this.itemProtocol.getContainer_direction(); to_container_no = this.itemProtocol.getContainer_direction();
to_container_type = this.itemProtocol.getContainer_no();
if (mode != last_mode) { if (mode != last_mode) {
@@ -547,28 +544,30 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
} }
private void writeData(String next_addr, List list, Instruction inst) { private void writeData(String next_addr, List list, Instruction inst) {
List list1 = new ArrayList();
Map map = new HashMap(); Map map = new HashMap();
map.put("code", "to_target"); map.put("code", "to_target");
map.put("value", next_addr); map.put("value", next_addr);
list.add(map); list1.add(map);
this.writing(list1);
List list2 = new ArrayList();
Map map1 = new HashMap(); Map map1 = new HashMap();
map1.put("code", "to_task"); map1.put("code", "to_task");
map1.put("value", inst.getInstruction_code()); map1.put("value", inst.getInstruction_code());
list.add(map1); list2.add(map);
Map map2 = new HashMap(); this.writing(list2);
map2.put("code", "to_command"); List list4 = new ArrayList();
map2.put("value", "1");
list.add(map2);
Map map3 = new HashMap(); Map map3 = new HashMap();
map3.put("code", "to_container_type"); map3.put("code", "to_container_type");
map3.put("value", inst.getVehicle_type()); map3.put("value", inst.getVehicle_type());
list.add(map3); list4.add(map3);
Map map4 = new HashMap(); this.writing(list4);
map4.put("code", "to_container_no"); List list3 = new ArrayList();
map4.put("value", "1"); Map map2 = new HashMap();
list.add(map4); map2.put("code", "to_command");
map2.put("value", "1");
this.writing(list); list3.add(map2);
this.writing(list3);
} }
private static void packageData(Instruction instdto, String route_plan_code, TaskDto taskdto, String taskid, String taskcode, String start_device_code, String next_device_code, String start_point_code, String next_point_code, String priority) { private static void packageData(Instruction instdto, String route_plan_code, TaskDto taskdto, String taskid, String taskcode, String start_device_code, String next_device_code, String start_point_code, String next_point_code, String priority) {
@@ -678,32 +677,19 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
jo.put("mode", mode); jo.put("mode", mode);
jo.put("message", LangProcess.msg(message)); jo.put("message", LangProcess.msg(message));
jo.put("error", this.getError()); jo.put("error", this.getError());
String move = "无货";
if(this.move == 1){
move = "有货";
}
jo.put("move", move); jo.put("move", move);
jo.put("task", task);
jo.put("type", container_type);
jo.put("is_click", true); jo.put("is_click", true);
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("requireSucess", requireSucess); jo.put("requireSucess", requireSucess);
return jo; return jo;
} }
// /**
// * 获取任务信息
// */
// public JSONObject getLedMessage(Instruction instdto) {
// JSONObject json = new JSONObject();
// json.put("task_code", instdto.getTask_code());
// json.put("inst_code", instdto.getInstruction_code());
// json.put("start_device_code", instdto.getStart_device_code());
// json.put("next_device_code", instdto.getNext_device_code());
// json.put("material_type", instdto.getMaterial());
// json.put("quantity", instdto.getQuantity());
// json.put("vehicle_code", instdto.getVehicle_code());
// json.put("instruction_status", instdto.getInstruction_status());
// json.put("entry_time", instdto.getCreate_time());
// String acsIp = paramService.findByCode(AcsConfig.ACSIP).getValue();
// json.put("ip", acsIp);
// return json;
// }
/** /**
* 更新指令状态 * 更新指令状态

View File

@@ -45,15 +45,6 @@ public class ItemProtocol {
* 任务号 * 任务号
*/ */
public static String item_task = "task"; public static String item_task = "task";
/**
* 出数字托盘号
*/
public static String item_container_no = "container_no";
/**
* 子卷条码
*/
public static String item_material_barcode = "material_barcode";
/** /**
* 下发命令 * 下发命令
@@ -63,10 +54,6 @@ public class ItemProtocol {
* 下发托盘类型 * 下发托盘类型
*/ */
public static String item_to_container_type = "to_container_type"; public static String item_to_container_type = "to_container_type";
/**
* 下发接纯数字托盘号
*/
public static String item_to_container_no = "to_container_no";
/** /**
* 下发任务号 * 下发任务号
*/ */
@@ -76,11 +63,6 @@ public class ItemProtocol {
*/ */
public static String item_to_target = "to_target"; public static String item_to_target = "to_target";
/**
* 托盘条码
*/
public static String item_barcode = "barcode";
@@ -90,9 +72,6 @@ public class ItemProtocol {
this.driver = driver; this.driver = driver;
} }
public String getMaterialBarcode() {
return this.getOpcStringValue(item_material_barcode);
}
public int getHeartbeat() { public int getHeartbeat() {
return this.getOpcIntegerValue(item_heartbeat); return this.getOpcIntegerValue(item_heartbeat);
} }
@@ -117,9 +96,6 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_action); return this.getOpcIntegerValue(item_action);
} }
public int getContainer_no() {
return this.getOpcIntegerValue(item_container_no);
}
public int getError() { public int getError() {
return this.getOpcIntegerValue(item_error); return this.getOpcIntegerValue(item_error);
@@ -133,9 +109,6 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_task); return this.getOpcIntegerValue(item_to_task);
} }
public String getBarcode() {
return this.getOpcStringValue(item_barcode);
}
@@ -151,9 +124,6 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_container_type); return this.getOpcIntegerValue(item_to_container_type);
} }
public int getTo_container_no() {
return this.getOpcIntegerValue(item_to_container_no);
}
Boolean isonline; Boolean isonline;
@@ -198,12 +168,9 @@ public class ItemProtocol {
list.add(new ItemDto(item_move, "光电信号", "DB101.B3")); list.add(new ItemDto(item_move, "光电信号", "DB101.B3"));
list.add(new ItemDto(item_container_direction, "托盘方向", "DB101.B4")); list.add(new ItemDto(item_container_direction, "托盘方向", "DB101.B4"));
list.add(new ItemDto(item_container_type, "托盘类型", "DB101.B5")); list.add(new ItemDto(item_container_type, "托盘类型", "DB101.B5"));
list.add(new ItemDto(item_container_no, "纯数字托盘号", "DB101.D7"));
list.add(new ItemDto(item_action, "动作类型", "DB101.B6")); list.add(new ItemDto(item_action, "动作类型", "DB101.B6"));
list.add(new ItemDto(item_error, "报警", "DB101.B58")); list.add(new ItemDto(item_error, "报警", "DB101.B58"));
list.add(new ItemDto(item_task, "任务号", "DB101.D68")); list.add(new ItemDto(item_task, "任务号", "DB101.D68"));
list.add(new ItemDto(item_material_barcode, "子卷条码", "DB601.STRING1.50"));
list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50"));
return list; return list;
} }
@@ -212,7 +179,6 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_target, "下发仓位号", "DB102.W2")); list.add(new ItemDto(item_to_target, "下发仓位号", "DB102.W2"));
list.add(new ItemDto(item_to_command, "下发命令", "DB102.W4")); list.add(new ItemDto(item_to_command, "下发命令", "DB102.W4"));
list.add(new ItemDto(item_to_task, "下发任务号", "DB102.D1")); list.add(new ItemDto(item_to_task, "下发任务号", "DB102.D1"));
list.add(new ItemDto(item_to_container_no, "下发接纯数字托盘号", "DB102.D3"));
list.add(new ItemDto(item_to_container_type, "下发托盘类型", "DB102.B5")); list.add(new ItemDto(item_to_container_type, "下发托盘类型", "DB102.B5"));
return list; return list;
} }

View File

@@ -121,7 +121,7 @@ public class ItemProtocol {
/** /**
*木箱宽度 *木箱宽度
*/ */
public static String item_to_weight = "to_weight"; public static String item_to_weight = "to_width";
/** /**
*木箱高度 *木箱高度
*/ */

View File

@@ -144,9 +144,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
String hand_material_barcode = null; String hand_material_barcode = null;
//数量 //高度
int qty = 0; int height = 0;
int last_qty = 0; int last_height = 0;
//托盘方向 //托盘方向
int carrier_direction = 0; int carrier_direction = 0;
@@ -219,7 +219,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
to_container_type = this.itemProtocol.getTo_container_type(); to_container_type = this.itemProtocol.getTo_container_type();
container_type = this.itemProtocol.getContainer_type(); container_type = this.itemProtocol.getContainer_type();
carrier_direction = this.itemProtocol.getCarrier_direction(); carrier_direction = this.itemProtocol.getCarrier_direction();
qty = this.itemProtocol.getQty(); height = this.itemProtocol.getHeight();
weight = this.itemProtocol.getWeight(); weight = this.itemProtocol.getWeight();
barcode = this.itemProtocol.getBarcode(); barcode = this.itemProtocol.getBarcode();
material_barcode = this.itemProtocol.getMaterialBarcode(); material_barcode = this.itemProtocol.getMaterialBarcode();
@@ -338,7 +338,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
last_hj_task = hj_task; last_hj_task = hj_task;
last_container_type = container_type; last_container_type = container_type;
last_carrier_direction = carrier_direction; last_carrier_direction = carrier_direction;
last_qty = qty; last_height = height;
last_weight = weight; last_weight = weight;
last_barcode = barcode; last_barcode = barcode;
} }

View File

@@ -32,9 +32,9 @@ public class ItemProtocol {
*/ */
public static String item_error = "error"; public static String item_error = "error";
/** /**
* 数量 * 高度
*/ */
public static String item_qty = "qty"; public static String item_height = "height";
/** /**
* 任务号 * 任务号
*/ */
@@ -112,8 +112,8 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_task); return this.getOpcIntegerValue(item_task);
} }
public int getQty(){ public int getHeight(){
return this.getOpcIntegerValue(item_qty); return this.getOpcIntegerValue(item_height);
} }
public int getCarrier_direction(){ public int getCarrier_direction(){
@@ -189,7 +189,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_task, "任务号", "DB1.D6")); list.add(new ItemDto(item_task, "任务号", "DB1.D6"));
list.add(new ItemDto(item_container_type, "托盘类型", "DB1.B7")); list.add(new ItemDto(item_container_type, "托盘类型", "DB1.B7"));
list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB1.B8")); list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB1.B8"));
list.add(new ItemDto(item_qty, "数量", "DB1.B9")); list.add(new ItemDto(item_height, "高度", "DB1.B9"));
list.add(new ItemDto(item_weight, "重量", "DB1.B10")); list.add(new ItemDto(item_weight, "重量", "DB1.B10"));
list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50")); list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50"));
list.add(new ItemDto(item_material_barcode, "子卷条码", "DB601.STRING1.50")); list.add(new ItemDto(item_material_barcode, "子卷条码", "DB601.STRING1.50"));

View File

@@ -11,7 +11,7 @@ public class InteractionJsonDTO {
private String maxNo; private String maxNo;
/** /**
*木箱最大数量 *木箱放入数量
*/ */
private String boxNo; private String boxNo;

View File

@@ -233,8 +233,8 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
} }
//放货完成 //任务完成
if (action == 4 && move == 0) { if (action == 5 && move == 0) {
if (inst != null) { if (inst != null) {
try { try {
logServer.deviceExecuteLog(this.device_code, "", "", "放货完成"); logServer.deviceExecuteLog(this.device_code, "", "", "放货完成");
@@ -351,7 +351,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
notCreateInstMessage = "universal_notCreateInstMessage1"; notCreateInstMessage = "universal_notCreateInstMessage1";
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
} }
//存在托盘才可以申请任务 /*//存在托盘才可以申请任务
BeltConveyorDeviceDriver beltConveyorDeviceDriver; BeltConveyorDeviceDriver beltConveyorDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver(); beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver();
@@ -359,7 +359,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
notCreateInstMessage = "universal_notCreateInstMessage2"; notCreateInstMessage = "universal_notCreateInstMessage2";
return false; return false;
} }
} }*/
String taskid = taskDto.getTask_id(); String taskid = taskDto.getTask_id();
@@ -451,6 +451,12 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
map9.put("value", interactionJsonDTO.getLayer()); map9.put("value", interactionJsonDTO.getLayer());
list.add(map9); list.add(map9);
} }
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getContainerType())) {
Map<String, Object> map10 = new HashMap<>();
map10.put("code", "to_type");
map10.put("value", interactionJsonDTO.getContainerType());
list.add(map10);
}
} }
this.writing(list); this.writing(list);
} }

View File

@@ -28,4 +28,9 @@ public class InteractionJsonDTO {
*/ */
private String layer; private String layer;
/**
* 托盘类型
*/
private String containerType;
} }

Binary file not shown.

Binary file not shown.

View File

@@ -252,8 +252,6 @@ import deviceCrud from '@/api/acs/device/device'
import { getDeviceByCodes } from '@/api/acs/device/deviceStageMonitor' import { getDeviceByCodes } from '@/api/acs/device/deviceStageMonitor'
import '@logicflow/core/dist/style/index.css' import '@logicflow/core/dist/style/index.css'
import '@logicflow/extension/lib/style/index.css' import '@logicflow/extension/lib/style/index.css'
import paramCrud from '@/api/system/param'
import { LogicFlow } from '@logicflow/core' import { LogicFlow } from '@logicflow/core'
import { registerCustomElement } from '@/views/system/logicflow/editor/components/node' import { registerCustomElement } from '@/views/system/logicflow/editor/components/node'
import i18n from '@/i18n' import i18n from '@/i18n'
@@ -520,6 +518,9 @@ export default {
} else if (val === 'last_inst_message') { } else if (val === 'last_inst_message') {
const obj = { name: i18n.t('monitor.click.last_instruction_message'), value: data[val] } const obj = { name: i18n.t('monitor.click.last_instruction_message'), value: data[val] }
this.arr.push(obj) this.arr.push(obj)
} else if (val === 'container_type') {
const obj = { name: '托盘类型', value: data[val] }
this.arr.push(obj)
} else if (val === 'barcode') { } else if (val === 'barcode') {
const obj = { name: i18n.t('monitor.click.barcode'), value: data[val] } const obj = { name: i18n.t('monitor.click.barcode'), value: data[val] }
this.arr.push(obj) this.arr.push(obj)