opt: 仙工驱动监控页面实现国际化,NDC反馈行架还原

This commit is contained in:
yanps
2024-07-02 17:24:26 +08:00
parent d795315fe1
commit f9fc6e8a50
10 changed files with 142 additions and 141 deletions

View File

@@ -243,34 +243,6 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
if (ObjectUtil.isNotEmpty(device)) {
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
// String region = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("region");
// if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) {
// String linkDeviceCode = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("link_device_code");
// Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);
// if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
// OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver();
// String s = Integer.parseInt(region) == 1 ? "one" : Integer.parseInt(region) == 2 ?
// "two" : Integer.parseInt(region) == 3 ? "three" : null;
// Class<? extends OvenGantryManipulatorDeviceDriver> aClass = hxhj.getClass();
// String regionCode = "region_" + s;
// String s1 = Integer.parseInt(region) == 1 ? "2" : Integer.parseInt(region) == 2 ?
// "6" : Integer.parseInt(region) == 3 ? "8" : null;
// if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) {
// hxhj.writing("to_"+regionCode, s1);
// log.info("下发AGV进入区域{}信号值为:{}", region, s1);
// } else {
// log.info("区域{}信号{}未清除,导致不满足下发AGV进入区域信号", region, regionCode);
// }
// if (hxhj.getMode() == 2 && StrUtil.isNotEmpty(s1) && ((Integer) aClass.getField(regionCode).get(hxhj) == 2)) {
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
// requireSucessRegion = true;
// } else {
// log.error("AGV进入区域{}信号{}行架未接收{},请检查;或行架正在执行中:{}", region, regionCode,s1, hxhj.getMode());
// }
// } else {
// log.error("未设置关联设备或关联的不是烘箱行架设备{}导致信号未反馈", linkDeviceCode);
// }
// } else {
try {
standardAutodoorDeviceDriver.writing("to_open", "1");
standardAutodoorDeviceDriver.writing("to_close", "0");
@@ -298,37 +270,6 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
if (ObjectUtil.isNotEmpty(device)) {
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
// String region = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("region");
// if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) {
// String linkDeviceCode = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("link_device_code");
// if(requireSucessTake || requireSucessPut){
// Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode);
// if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
// OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver();
// String s = Integer.parseInt(region) == 1 ? "one" : Integer.parseInt(region) == 2 ?
// "two" : Integer.parseInt(region) == 3 ? "three" : null;
// Class<? extends OvenGantryManipulatorDeviceDriver> aClass = hxhj.getClass();
// String regionCode = "region_" + s;
// if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) != 0)) {
// hxhj.writing("to_"+regionCode, "0");
// log.info("下发AGV离开区域{}信号值为:{}", region, 0);
// } else {
// log.info("区域{}信号{}为0,不需要下发AGV离开区域信号", region, regionCode);
// }
// if (hxhj.getMode() == 2 && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) {
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
// requireSucessPut = false;
// requireSucessTake = false;
// } else {
// log.error("AGV离开区域{}信号{}行架未接收0,请检查;或行架正在执行中:{}", region, regionCode, hxhj.getMode());
// }
// } else {
// log.error("未设置关联设备或关联的不是烘箱行架设备{}导致信号未反馈", linkDeviceCode);
// }
// }else{
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
// }
// } else {
try {
standardAutodoorDeviceDriver.writing("to_close", "1");
standardAutodoorDeviceDriver.writing("to_open", "0");
@@ -355,13 +296,6 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver();
agvNdcTwoDeviceDriver.processSocket(arr);
if(phase == 0x05 && "3".equals(inst.getInstruction_type()) && requireSucessRegion){
requireSucessPut = true;
requireSucessRegion = false;
}else if(phase == 0x0E && "8".equals(inst.getInstruction_type()) && requireSucessRegion){
requireSucessTake = true;
requireSucessRegion = false;
}
} else if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
agvNdcOneDeviceDriver.processSocket(arr);

View File

@@ -867,9 +867,9 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
celldto.setY("0");
celldto.setZ("0");
celldto.setAddress(Integer.parseInt(CodeUtil.getNewCode("NDCADDRESS_NO")));
celldto.setCreate_by("init");
celldto.setCreate_time(SecurityUtils.getCurrentNickName());
// wo.insert((JSONObject) JSONObject.toJSON(celldto));
celldto.setCreate_by(SecurityUtils.getCurrentNickName());
String now = DateUtil.now();
celldto.setCreate_time(now);
StorageCell entity = ConvertUtil.convert(celldto, StorageCell.class);
storageCellMapper.insert(entity);
}
@@ -888,9 +888,9 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
celldto.setY("0");
celldto.setZ("0");
celldto.setAddress(Integer.parseInt(CodeUtil.getNewCode("NDCADDRESS_NO")));
celldto.setCreate_by("init");
celldto.setCreate_time(SecurityUtils.getCurrentNickName());
// wo.insert((JSONObject) JSONObject.toJSON(celldto));
celldto.setCreate_by(SecurityUtils.getCurrentNickName());
String now = DateUtil.now();
celldto.setCreate_time(now);
StorageCell entity = ConvertUtil.convert(celldto, StorageCell.class);
storageCellMapper.insert(entity);
}

View File

@@ -232,16 +232,16 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device
map.put("errors", isError);
map.put("upload_scene_status", upload_scene_status);
map.put("procBusiness", procBusiness ? "": "");
map.put("current_order", current_order);
// map.put("current_order", current_order);
map.put("connection_status", "1".equals(connection_status) ? "连接上" : "断连");
map.put("dispatchable", dispatchable ? "可接单" : "不可接单");
map.put("dispatchable_status", dispatchable_status == 1?"设置可接单" : dispatchable_status == 2?"设置不可接单(小车占用资源)" : dispatchable_status == 3?"设置不可接单(小车不占用资源)" : "未知");
map.put("current_map_invalid", !current_map_invalid ? "机器人不在地图场景中": "机器人在地图场景中");
map.put("disconnect", !disconnect ? "机器人断连" : "机器人连接上");
map.put("low_battery", !low_battery ? "低电量": "正常");
map.put("suspended", !suspended ? "订单被暂停,需要人工手动恢复": "正常");
map.put("current_map_invalid", current_map_invalid ? "机器人不在地图场景中": "机器人在地图场景中");
map.put("disconnect", disconnect ? "机器人断连" : "机器人连接上");
map.put("low_battery", low_battery ? "低电量": "正常");
map.put("suspended", suspended ? "订单被暂停,需要人工手动恢复": "正常");
map.put("message", message);
map.put("unconfirmed_reloc", !unconfirmed_reloc ? "未确认定位" : "正常");
map.put("unconfirmed_reloc", unconfirmed_reloc ? "未确认定位" : "正常");
map.put("unlock", unlock == 0 ? "控制权在core手上" : unlock == 1 ? "控制权被其他人抢走" : unlock == 2 ?"控制权没有被抢占" : "未知");
JSONObject jo = new JSONObject(map);
return jo;

View File

@@ -223,6 +223,8 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("qty", this.getQty());
jo.put("type", this.getType() == 3 ? "三寸": this.getType() == 6 ? "六寸" : "未知");
jo.put("driver_type", "siemens_conveyor");
jo.put("is_click", true);
return jo;