opt: 监控大屏显示设备信息优化

This commit is contained in:
yanps
2024-05-14 19:56:50 +08:00
parent 4741f9952d
commit 00d823ccd3
7 changed files with 150 additions and 112 deletions

View File

@@ -360,53 +360,66 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
@Override @Override
public JSONObject getDeviceStatusName() { public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject(); Map<String, Object> map = new LinkedHashMap<>();
String mode = ""; String mode = "";
String action = ""; String action = "";
String move = ""; String move = "";
if (this.getMode() == 0) { if (this.getMode() == 0) {
mode = LangProcess.msg("universal_off-line"); mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) { }/* else if (this.getMode() == 1) {
mode = LangProcess.msg("universal_stand-alone"); mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) { } */else if (this.getMode() == 1) {
mode = LangProcess.msg("universal_standby"); mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) { }/* else if (this.getMode() == 3) {
mode = LangProcess.msg("universal_operation"); mode = LangProcess.msg("universal_operation");
} }*/
String requireSucess = "0"; String requireSucess = LangProcess.msg("universal_actionMessage4");
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = LangProcess.msg("universal_actionMessage5");
} }
jo.put("requireSucess", requireSucess); map.put("requireSucess", requireSucess);
if (this.getMove() == 0) { if (this.getMove() == 0) {
move = LangProcess.msg("universal_no"); move = LangProcess.msg("universal_no");
jo.put("hasGoods", false); map.put("hasGoods", false);
} else if (this.getMove() == 1) { } else if (this.getMove() == 1) {
move = LangProcess.msg("universal_yes"); move = LangProcess.msg("universal_yes");
jo.put("hasGoods", true); map.put("hasGoods", true);
} else if (this.getMove() == 2) { } else if (this.getMove() == 2) {
move = LangProcess.msg("universal_two_yes"); move = LangProcess.msg("universal_two_yes");
jo.put("hasGoods", true); map.put("hasGoods", true);
} }
if(error == 0 && iserror){ if(error == 0 && iserror){
message = "universal_message11"; message = LangProcess.msg("universal_message11");
} }
jo.put("device_name", this.getDevice().getDevice_name()); String door = "关门状态";
jo.put("temperature", temperature); if(this.door == 1){
jo.put("finish", finish); door = "开门状态";
jo.put("isOnline", this.getIsonline()); }else if(this.door == 0){
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); door = "门执行中";
jo.put("isError", this.getIserror()); }
jo.put("countdown_house", countdown_house); String finish = "未完成";
jo.put("countdown_min", countdown_min); if(this.finish == 1){
jo.put("countdown_sec", countdown_sec); finish = "已完成";
jo.put("door", door); }
jo.put("mode", mode); map.put("device_name", this.getDevice().getDevice_name());
jo.put("move", move); map.put("finish", finish);
jo.put("action", action); map.put("isOnline", this.getIsonline());
jo.put("message", message);
jo.put("task", this.getTask()); map.put("isError", this.getIserror());
map.put("door", door);
map.put("mode", mode);
map.put("move", move);
/*map.put("action", action);
map.put("message", message);*/
/*map.put("task", this.getTask());*/
map.put("error", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError())));
map.put("temperature", temperature);
map.put("countdown_house", countdown_house);
map.put("countdown_min", countdown_min);
map.put("countdown_sec", countdown_sec);
JSONObject jo = new JSONObject(map);
return jo; return jo;
} }

View File

@@ -124,7 +124,7 @@ public class ItemProtocol {
} ; } ;
Boolean isonline; Boolean isonline;
Boolean isError; Boolean isError = false;
public int getOpcIntegerValue(String protocol) { public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol); Integer value = this.driver.getIntegeregerValue(protocol);

View File

@@ -192,7 +192,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
requireActionSucess = false; requireActionSucess = false;
} }
if (!requireActionSucess) { if (mode == 3 && !requireActionSucess) {
update_instruction_status(); update_instruction_status();
} }
@@ -200,7 +200,6 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
var17.printStackTrace(); var17.printStackTrace();
feedMessage = var17.getMessage(); feedMessage = var17.getMessage();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
} }
if (mode == 0) { if (mode == 0) {
@@ -1082,7 +1081,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
@Override @Override
public JSONObject getDeviceStatusName() { public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject(); Map<String, Object> map = new LinkedHashMap<>();
String mode = ""; String mode = "";
String move = ""; String move = "";
String action = ""; String action = "";
@@ -1103,11 +1103,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
move = LangProcess.msg("universal_yes"); move = LangProcess.msg("universal_yes");
} }
String requireSucess = "0"; String requireSucess = LangProcess.msg("universal_actionMessage4");
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = LangProcess.msg("universal_actionMessage5");
} }
jo.put("requireSucess", requireSucess); map.put("requireSucess", requireSucess);
if (this.getAction() == 1) { if (this.getAction() == 1) {
action = LangProcess.msg("universal_delivery"); action = LangProcess.msg("universal_delivery");
} else if (this.getAction() == 2) { } else if (this.getAction() == 2) {
@@ -1118,30 +1118,31 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
action = LangProcess.msg("universal_releasing_completed"); action = LangProcess.msg("universal_releasing_completed");
} }
if (error == 0 && iserror) { if (error == 0 && iserror) {
this.setMessage(LangProcess.msg("universal_message4")); this.setMessage(LangProcess.msg("universal_message11"));
} }
String requireActionSucess = LangProcess.msg("universal_actionMessage4"); String requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage4");
if(this.requireActionSucess){ if(this.requireActionSucess){
requireActionSucess = LangProcess.msg("universal_actionMessage5"); requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage5");
} }
jo.put("device_name", this.getDevice().getDevice_name()); map.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); map.put("mode", mode);
jo.put("move", move); map.put("move", move);
jo.put("action", action); map.put("action", action);
jo.put("task", task); map.put("task", task);
jo.put("walk_y", walk_y); map.put("walk_y", this.walk_y);
jo.put("isOnline", this.getIsonline()); map.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); map.put("requireActionSucess", requireActionSucess);
jo.put("isError", this.getIserror()); map.put("error", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(this.getError())));
jo.put("message", message); map.put("isError", this.getIserror());
jo.put("notCreateTaskMessage", notCreateTaskMessage); map.put("message", message);
jo.put("notCreateInstMessage", notCreateInstMessage); map.put("feedMessage", feedMessage);
jo.put("feedMessage", feedMessage); map.put("notCreateTaskMessage", notCreateTaskMessage);
jo.put("requireActionSucess", requireActionSucess); map.put("notCreateInstMessage", notCreateInstMessage);
jo.put("driver_type", "siemens_conveyor"); map.put("driver_type", "siemens_conveyor");
jo.put("is_click", true); map.put("is_click", true);
jo.put("x", x_position); JSONObject jo = new JSONObject(map);
jo.put("y", y_position); /*jo.put("x", x_position);
jo.put("y", y_position);*/
return jo; return jo;
} }

View File

@@ -221,6 +221,9 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
this.setIsonline(true); this.setIsonline(true);
this.setIserror(false); this.setIserror(false);
message = ""; message = "";
if(requireSucess){
message = LangProcess.msg("universal_actionMessage5");
}
//插拔轴机工位申请任务 //插拔轴机工位申请任务
switch (mode) { switch (mode) {
case 1: case 1:
@@ -588,8 +591,19 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
mode = LangProcess.msg("universal_standby"); mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) { } else if (this.getMode() == 3) {
mode = LangProcess.msg("universal_operation"); mode = LangProcess.msg("universal_operation");
} else if(this.mode == 4) {
mode = "请求套轴轴";
} else if(this.mode == 5){
mode = "套轴完成反馈";
} else if(this.mode == 6){
mode = "请求拔轴";
} else if(this.mode == 7){
mode = "拔轴完成反馈";
} else if(this.mode == 8){
mode = "缓存库已满,申请行架任务";
} }
if (this.getMove() == 0) { if (this.getMove() == 0) {
move = LangProcess.msg("universal_no"); move = LangProcess.msg("universal_no");
jo.put("hasGoods", false); jo.put("hasGoods", false);
@@ -600,6 +614,10 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
move = LangProcess.msg("universal_two_yes"); move = LangProcess.msg("universal_two_yes");
jo.put("hasGoods", true); jo.put("hasGoods", true);
} }
String requireSucess = LangProcess.msg("universal_actionMessage4");
if (this.requireSucess) {
requireSucess = LangProcess.msg("universal_actionMessage5");
}
jo.put("requireSucess", requireSucess); jo.put("requireSucess", requireSucess);
if (this.getAction() == 1) { if (this.getAction() == 1) {
action = LangProcess.msg("universal_delivery"); action = LangProcess.msg("universal_delivery");
@@ -613,11 +631,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
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("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message)); jo.put("message", message);
return jo; return jo;
} }

View File

@@ -617,11 +617,10 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
@Override @Override
public JSONObject getDeviceStatusName() { public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject(); Map<String, Object> map = new LinkedHashMap<>();
String mode = ""; String mode = "";
String move = ""; String move = "";
String action = ""; String action = "";
String walkY = "";
if (this.getMode() == 0) { if (this.getMode() == 0) {
mode = LangProcess.msg("universal_off-line"); mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) { } else if (this.getMode() == 1) {
@@ -638,11 +637,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
move = LangProcess.msg("universal_yes"); move = LangProcess.msg("universal_yes");
} }
String requireSucess = "0"; String requireSucess = LangProcess.msg("universal_actionMessage4");
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = LangProcess.msg("universal_actionMessage5");
} }
jo.put("requireSucess", requireSucess); map.put("requireSucess", requireSucess);
if (this.getAction() == 1) { if (this.getAction() == 1) {
action = LangProcess.msg("universal_delivery"); action = LangProcess.msg("universal_delivery");
} else if (this.getAction() == 2) { } else if (this.getAction() == 2) {
@@ -651,29 +650,32 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
action = LangProcess.msg("universal_releasing"); action = LangProcess.msg("universal_releasing");
} else if (this.getAction() == 4) { } else if (this.getAction() == 4) {
action = LangProcess.msg("universal_releasing_completed"); action = LangProcess.msg("universal_releasing_completed");
}else {
action = "无动作";
} }
if(error == 0 && this.itemProtocol.isError){ if(error == 0 && this.itemProtocol.isError){
iserror = true; iserror = true;
}else if(error == 0 && !this.itemProtocol.isError){ }else if(error == 0 && !this.itemProtocol.isError){
iserror = false; iserror = false;
} }
jo.put("device_name", this.getDevice().getDevice_name()); map.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); map.put("mode", mode);
jo.put("move", move); map.put("move", move);
jo.put("action", action); map.put("action", action);
jo.put("task", task); map.put("task", task);
jo.put("walk_y", walkY); map.put("walk_y", walkY);
jo.put("isOnline", this.getIsonline()); map.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); map.put("isError", this.getIserror());
jo.put("isError", this.getIserror()); map.put("feedMessage", feedMessage);
jo.put("message", message); map.put("driver_type", "siemens_conveyor");
jo.put("notCreateTaskMessage", notCreateTaskMessage); map.put("is_click", true);
jo.put("notCreateInstMessage", notCreateInstMessage); map.put("message", message);
jo.put("feedMessage", feedMessage); map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("driver_type", "siemens_conveyor"); map.put("notCreateTaskMessage", notCreateTaskMessage);
jo.put("is_click", true); map.put("notCreateInstMessage", notCreateInstMessage);
jo.put("x", xPosition); /*jo.put("x", xPosition);
jo.put("y", yPosition); jo.put("y", yPosition);*/
JSONObject jo = new JSONObject(map);
return jo; return jo;
} }

View File

@@ -232,21 +232,25 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
.content("反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage()) .content("反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage())
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
message = "反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage();
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
} }
} else { } else if(mode == 3){
feedMessage = "行架机械手:"; feedMessage = "行架机械手:";
if (mode != 3) { /*if (mode != 3) {
feedMessage = feedMessage + "mode不为运行中状态,"; feedMessage = feedMessage + "mode不为运行中状态,";
} }*/
if (action != 5) { if (action != 5) {
feedMessage = feedMessage + "action不为反馈重量状态,"; feedMessage = feedMessage + "action不为反馈重量状态,";
} }
if (move != 1) { if (move != 1) {
feedMessage = feedMessage + "move不为有货状态,"; feedMessage = feedMessage + "move不为有货状态,";
} }
if (task == 0) { if(StrUtil.isEmpty(sub_volume_no)){
feedMessage = feedMessage + "task为0。"; feedMessage = feedMessage + "子卷号为空,";
}
if(requireSucess){
feedMessage = feedMessage + "请求动作未复位!";
} }
} }
@@ -573,7 +577,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
@Override @Override
public JSONObject getDeviceStatusName() { public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject(); Map<String, Object> map = new LinkedHashMap<>();
String mode = ""; String mode = "";
String move = ""; String move = "";
String action = ""; String action = "";
@@ -595,11 +599,11 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} }
String requireSucess = "0"; String requireSucess = LangProcess.msg("universal_actionMessage4");
if (this.requireSucess) { if (this.requireSucess) {
requireSucess = "1"; requireSucess = LangProcess.msg("universal_actionMessage5");
} }
jo.put("requireSucess", requireSucess); map.put("requireSucess", requireSucess);
if (this.getAction() == 1) { if (this.getAction() == 1) {
action = LangProcess.msg("universal_delivery"); action = LangProcess.msg("universal_delivery");
} else if (this.getAction() == 2) { } else if (this.getAction() == 2) {
@@ -608,29 +612,28 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
action = LangProcess.msg("universal_releasing"); action = LangProcess.msg("universal_releasing");
} else if (this.getAction() == 4) { } else if (this.getAction() == 4) {
action = LangProcess.msg("universal_releasing_completed"); action = LangProcess.msg("universal_releasing_completed");
}else if (this.getAction() == 5){
action = "反馈子卷重量";
}else if (this.getAction() == 0){
action = "无动作";
} }
if(error == 0 && this.itemProtocol.isError){ if(error == 0 && this.itemProtocol.isError){
iserror = true; iserror = true;
}else if(error == 0 && !this.itemProtocol.isError){ }else if(error == 0 && !(this.itemProtocol.isError)){
iserror = false; iserror = false;
} }
jo.put("device_name", this.getDevice().getDevice_name()); map.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); map.put("mode", mode);
jo.put("move", move); map.put("move", move);
jo.put("action", action); map.put("action", action);
jo.put("task", task); map.put("isOnline", this.getIsonline());
jo.put("walk_y", walk_y); map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isOnline", this.getIsonline()); map.put("isError", this.getIserror());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); map.put("message", message);
jo.put("isError", this.getIserror()); map.put("feedMessage", feedMessage);
jo.put("message", LangProcess.msg(message)); map.put("driver_type", "siemens_conveyor");
jo.put("notCreateTaskMessage", notCreateTaskMessage); map.put("is_click", true);
jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); JSONObject jo = new JSONObject(map);
jo.put("feedMessage",feedMessage);
jo.put("driver_type", "siemens_conveyor");
jo.put("is_click", true);
jo.put("x", x_position);
jo.put("y", y_position);
return jo; return jo;
} }

View File

@@ -505,7 +505,7 @@ export default {
this.arr = [] // 清空 this.arr = [] // 清空
if (item.device_code && item.data) { if (item.device_code && item.data) {
console.log('item', item) console.log('item', item)
let tempDeviceName = '' /* let tempDeviceName = ''
if (this.language === 'zh') { if (this.language === 'zh') {
tempDeviceName = item.data.zh_device_name tempDeviceName = item.data.zh_device_name
} }
@@ -514,12 +514,10 @@ export default {
} }
if (this.language === 'in') { if (this.language === 'in') {
tempDeviceName = item.data.in_device_name tempDeviceName = item.data.in_device_name
} } */
this.arr = [ this.arr = [
{ name: i18n.t('monitor.click.equipment_number'), value: item.device_code }, { name: i18n.t('monitor.click.equipment_number'), value: item.device_code },
// { name: tempDeviceName, value: item.device_name } { name: i18n.t('monitor.click.device_name'), value: item.device_name }
{ name: i18n.t('monitor.click.device_name'), value: tempDeviceName }
// { name: i18n.t('monitor.click.device_name'), value: item.device_name }
] ]
const data = item.data const data = item.data
for (const val in data) { for (const val in data) {
@@ -689,6 +687,9 @@ export default {
} else if (val === 'requireSucess') { } else if (val === 'requireSucess') {
const obj = { name: i18n.t('monitor.click.request_success_flag'), value: data[val] } const obj = { name: i18n.t('monitor.click.request_success_flag'), value: data[val] }
this.arr.push(obj) this.arr.push(obj)
} else if (val === 'requireActionSucess') {
const obj = { name: '信号成功标记', value: data[val] }
this.arr.push(obj)
} else if (val === 'applySucess') { } else if (val === 'applySucess') {
const obj = { name: 'applySucess', value: data[val] } const obj = { name: 'applySucess', value: data[val] }
this.arr.push(obj) this.arr.push(obj)
@@ -699,7 +700,7 @@ export default {
const obj = { name: i18n.t('monitor.click.inventory_quantity'), value: data[val] } const obj = { name: i18n.t('monitor.click.inventory_quantity'), value: data[val] }
this.arr.push(obj) this.arr.push(obj)
} else if (val === 'hand_barcode') { } else if (val === 'hand_barcode') {
const obj = { name: 'hand_barcode', value: data[val] } const obj = { name: '子卷编号', value: data[val] }
this.arr.push(obj) this.arr.push(obj)
} else if (val === 'x') { } else if (val === 'x') {
const obj = { name: 'X', value: data[val] } const obj = { name: 'X', value: data[val] }