src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/core/cache/MessageQueue.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/core/thread/LedThread.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application-prod.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/license.lic | 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/static/wcs/js/console1.map.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/static/wcs/js/console2.map.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/static/wcs/js/console3.map.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -1916,14 +1916,21 @@ // 获取led线程 LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId()); // led显示默认内容 if (reset && !ledThread.isLedMk()) { if (reset) { ledThread.setLedMk(true); if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(4, new ArrayList<>()))) { if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) { log.error(""+mark+" - 1"+" - {}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); } else { } } // if (reset) { // if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) { // log.error(""+mark+" - 1"+" - {}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); // } else { // // } // } } // log.info(""+mark+" - 0"+" - 执行完成:其他 ===>> LED显示器复位,显示默认信息"); } src/main/java/com/zy/core/cache/MessageQueue.java
@@ -1,6 +1,5 @@ package com.zy.core.cache; import com.zy.asrs.utils.CommandUtils; import com.zy.core.Slave; import com.zy.core.enums.SlaveType; import com.zy.core.model.Task; src/main/java/com/zy/core/thread/LedThread.java
@@ -28,6 +28,8 @@ import onbon.bx05.utils.DisplayStyleFactory; import java.awt.*; import java.io.IOException; import java.net.InetAddress; import java.util.Date; import java.util.HashSet; import java.util.List; @@ -52,20 +54,11 @@ public LedThread(Slave slave) { this.slave = slave; try { Bx5GEnv.initial(3000); screen = new Bx5GScreenClient("my"); } catch (Exception e) { e.printStackTrace(); log.info("led连接构造器错误 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); } } @Override @SuppressWarnings({"InfiniteLoopStatement", "unchecked"}) public void run() { connect(); close(); while (true) { try { Task task = MessageQueue.poll(SlaveType.Led, slave.getId()); @@ -78,6 +71,7 @@ // 复位 case 2: reset(); // this.ledMk = false; break; case 5: error((String) task.getData()); @@ -149,63 +143,35 @@ } private void reset() throws Bx5GException { if (!connect()) { return; } // if (resetStatus) { // return; // } pf = new ProgramBxFile( 0, screen.getProfile()); pf.setFrameShow(false); // 分别输入X,Y,width,height area = new TextCaptionBxArea( 0,0,96,48, screen.getProfile()); // 创建一个数据页 TextBxPage page = new TextBxPage(); // List<String> list = null; // try { // String ledDefaultMsg = Parameter.get().getLedDefaultMsg(); // list = JSON.parseArray(ledDefaultMsg, String.class); // } catch (Exception ignore) { // } // if (!Cools.isEmpty(list)) { // for (String str : list) { // page.newLine(str); // } // } else { // page.newLine("自动化立体仓库"); // page.newLine("西格迈股份有限公司"); // } page.newLine("力源智能仓储"); // 设置字体 page.setFont(new Font("宋体",Font.PLAIN,13)); // 设置文本颜色 page.setForeground(Color.red); // 设置显示特技为快速打出 page.setDisplayStyle(styles[6]); area.clearPages(); area.addPage(page); pf.addArea(area); // 更新节目 if (pf.validate() != null) { log.info("pf out of range"); } else { // 更新节目 screen.writeProgram(pf); // resetStatus = true; } close(); errorMsg.delete(0, errorMsg.length()); } @Override public boolean connect() { boolean connRes = false; // ======= 🌐 添加网络可达性检测 ======= try { connRes = screen.connect(slave.getIp(),slave.getPort()); screen.turnOn(); } catch (Exception ignore) { InetAddress address = InetAddress.getByName(slave.getIp()); if (!address.isReachable(2000)) { log.warn("设备不可达,跳过连接: {}", slave.getIp()); return false; // 提前返回,避免无意义连接尝试 } } catch (IOException e) { log.error("IP检测异常: {}", e.getMessage()); return false; // 可视情况决定是否 return } // ======= 尝试连接设备 ======= try { connRes = screen.connect(slave.getIp(), slave.getPort()); screen.turnOn(); // 如果 connect 成功再开屏 } catch (Exception e) { log.error("连接异常: {}", e.getMessage(), e); // 避免捕获后无提示 } // ======= 设备错误状态处理 ======= DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); if (connRes) { log.info("led连接成功 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); @@ -214,8 +180,10 @@ log.error("led连接失败!!! ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); deviceErrorService.addDeviceError("led", slave.getId(), "led连接失败"); } return connRes; } @Override public void close() { @@ -465,6 +433,7 @@ screen.disconnect(); } private void error(String msg) { log.error("错误信息为:{}",msg); errorMsg.delete(0, errorMsg.length()); errorMsg.append(msg); } src/main/resources/application-prod.yml
@@ -281,7 +281,7 @@ ip: 192.168.110.212 port: 5005 devpPlcId: ${wcs-slave.devp[0].id} staArr: 1014 staArr: 1014,1015 # LED4 成品库2F led[3]: id: 4 src/main/resources/application.yml
@@ -1,5 +1,5 @@ server: port: 8081 port: 8080 servlet: context-path: /@pom.build.finalName@ src/main/resources/license.licBinary files differ
src/main/webapp/static/wcs/js/console1.map.js
@@ -136,7 +136,7 @@ ], "areas": [{ "type": "Control_floor", "id": "tabControl_floor1", "id": "tabControl_floor2", "text": "楼层", "top": 66, "left": 580, src/main/webapp/static/wcs/js/console2.map.js
@@ -131,7 +131,7 @@ }], "areas": [{ "type": "Control_floor", "id": "tabControl_floor1", "id": "tabControl_floor3", "text": "楼层", "top": 66, "left": 580, src/main/webapp/static/wcs/js/console3.map.js
@@ -136,7 +136,7 @@ ], "areas": [{ "type": "Control_floor", "id": "tabControl_floor1", "id": "tabControl_floor4", "text": "楼层", "top": 66, "left": 580,