From 1b160b340bd6fe5f34cedbd01c80b9530d530d91 Mon Sep 17 00:00:00 2001 From: zwl <1051256694@qq.com> Date: 星期三, 14 五月 2025 18:58:46 +0800 Subject: [PATCH] 初始化 --- src/main/java/com/zy/core/thread/LedThread.java | 49 +++++++++++++++++++++++++------------------------ 1 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/zy/core/thread/LedThread.java b/src/main/java/com/zy/core/thread/LedThread.java index 569df3c..f8586ee 100644 --- a/src/main/java/com/zy/core/thread/LedThread.java +++ b/src/main/java/com/zy/core/thread/LedThread.java @@ -11,6 +11,7 @@ import com.zy.core.Slave; import com.zy.core.ThreadHandler; import com.zy.core.cache.MessageQueue; +import com.zy.core.enums.CommandStatusType; import com.zy.core.enums.SlaveType; import com.zy.core.model.Task; import com.zy.core.model.command.LedCommand; @@ -64,29 +65,29 @@ public void run() { connect(); close(); - while (true) { - try { - Task task = MessageQueue.poll(SlaveType.Led, slave.getId()); - if (task != null) { - switch (task.getStep()) { - // 鍐欐暟鎹� - case 1: - write((List<LedCommand>)task.getData()); - break; - // 澶嶄綅 - case 2: - reset(); - break; - default: - break; - } - } - - Thread.sleep(400); - } catch (Exception e) { - e.printStackTrace(); - } - } +// while (true) { +// try { +// Task task = MessageQueue.poll(SlaveType.Led, slave.getId()); +// if (task != null) { +// switch (task.getStep()) { +// // 鍐欐暟鎹� +// case 1: +// write((List<LedCommand>)task.getData()); +// break; +// // 澶嶄綅 +// case 2: +// reset(); +// break; +// default: +// break; +// } +// } +// +// Thread.sleep(400); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } } private void write(List<LedCommand> list) throws Bx5GException { @@ -120,7 +121,7 @@ //鏇存柊鎸囦护鐘舵�� CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class); CommandInfo commandInfo = command.getCommandInfo(); - commandInfo.setCommandStatus(2); + commandInfo.setCommandStatus(CommandStatusType.COMPLETE.id); commandInfoService.updateById(commandInfo); } -- Gitblit v1.9.1