From 2aaf47ead1a69ccbaf6a0167ae161aafd3622114 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 27 十一月 2025 08:14:35 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/impl/ZyStationThread.java | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/impl/ZyStationThread.java b/src/main/java/com/zy/core/thread/impl/ZyStationThread.java
index 5cfe421..d54012a 100644
--- a/src/main/java/com/zy/core/thread/impl/ZyStationThread.java
+++ b/src/main/java/com/zy/core/thread/impl/ZyStationThread.java
@@ -51,6 +51,20 @@
@SuppressWarnings("InfiniteLoopStatement")
public void run() {
this.connect();
+
+ //璁惧璇诲彇
+ Thread readThread = new Thread(() -> {
+ while (true) {
+ try {
+ readStatus();
+ Thread.sleep(200);
+ } catch (Exception e) {
+ log.error("StationThread Fail", e);
+ }
+ }
+ });
+ readThread.start();
+
while (true) {
try {
int step = 1;
@@ -59,10 +73,6 @@
step = task.getStep();
}
switch (step) {
- // 璇绘暟鎹�
- case 1:
- readStatus();
- break;
case 2:
sendCommand((StationCommand) task.getData());
break;
--
Gitblit v1.9.1