From 23bc853bf89485a3a85c3dc022e539547ab7ebe5 Mon Sep 17 00:00:00 2001
From: cpT <1@123>
Date: 星期日, 29 六月 2025 17:52:40 +0800
Subject: [PATCH] #改造

---
 src/main/java/com/zy/core/MainProcess.java |   65 ++++++++++++++++----------------
 1 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index 8fdd89c..cf57af9 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -5,11 +5,9 @@
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.PreDestroy;
-import java.util.ArrayList;
 
 /**
  * WCS涓绘祦绋�
@@ -24,8 +22,7 @@
     private MainServiceImpl mainService;
     // 鎵�灞炵嚎绋�
     private Thread thread;
-    // 棰戠巼
-    private int i = 0;
+    private Thread thread2;
 
     /**
      * =====>>  寮�濮嬪伐浣�
@@ -34,56 +31,60 @@
         thread = new Thread(() -> {
             while (!Thread.currentThread().isInterrupted()) {
                 try {
-
                     // 闂撮殧
-                    Thread.sleep(1000);
-
+                    Thread.sleep(400);
                     // 绯荤粺杩愯鐘舵�佸垽鏂�
                     if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
                         continue;
                     }
-
-                    // 婕旂ず
-//                    mainService.crnDemoOfLocMove1();
                     // 鍏ュ簱  ===>> 鍏ュ簱绔欏埌鍫嗗灈鏈虹珯锛屾牴鎹潯鐮佹壂鎻忕敓鎴愬叆搴撳伐浣滄。
                     mainService.generateStoreWrkFile(); // 缁勬墭
-                    // 鍑哄簱  ===>>  鍫嗗灈鏈哄嚭搴撶珯鍒板嚭搴撶珯
-                    mainService.crnStnToOutStn();
+//                    mainService.generateStoreWrkFileIsEmptyMk(); // 缁勬墭  绌烘墭
+                    mainService.generateStoreWrkFileWalk(); // 浠诲姟涓嬪彂
                     // 鍏ュ嚭搴�  ===>>  鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
                     mainService.crnIoExecute();
                     // 鍏ュ簱  ===>> 鎵ц瀵瑰伐浣滄。鐨勫畬鎴愭搷浣�
                     mainService.storeFinished();
-
-                    // 鍫嗗灈鏈哄紓甯镐俊鎭褰�
-                    mainService.recCrnErr();
-                    // 鍏ュ簱  ===>> 绌烘爤鏉垮垵濮嬪寲鍏ュ簱,鍙夎溅鍏ュ簱绔欐斁璐�
-//                    mainService.storeEmptyPlt();
-
-//                    mainService.outOfDevp();
-
-                    // 鍏朵粬  ===>> // 鍏ュ嚭搴撴ā寮忓垏鎹㈠嚱鏁�
-                    i++;
-                    if (i > 1) {
-//                        mainService.ioConvert();
-                        i = 0;
-                    }
-
-                    //鑷姩娲惧彂浠诲姟
-                    mainService.autoDistribute();
-                    //鑷姩瀹屾垚浠诲姟
-                    mainService.autoCompleteTask();
-
+                    // 浠诲姟涓嬪彂
+                    mainService.taskStart();
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
             }
         });
         thread.start();
+
+        thread2 = new Thread(() -> {
+            while (!Thread.currentThread().isInterrupted()) {
+                try {
+                    // 闂撮殧
+                    Thread.sleep(200);
+                    // 绯荤粺杩愯鐘舵�佸垽鏂�
+                    if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
+                        continue;
+                    }
+                    // 鍑哄簱  ===>>  鍫嗗灈鏈哄嚭搴撶珯鍒板嚭搴撶珯
+                    mainService.crnStnToOutStn();
+                    // 鍫嗗灈鏈哄紓甯镐俊鎭褰�
+                    mainService.recCrnErr();
+                    // 鍑哄簱  ===>>  鍫嗗灈鏈�5鍒嗛挓鏃犱换鍔″垯鍥炲埌婧愮偣
+//                    mainService.crnStnToOutStnSou();
+                    // 鍑哄簱  ===>> 宸ヤ綔妗d俊鎭啓鍏ed鏄剧ず鍣�
+//                    mainService.ledExecute(9);
+                    // 鍏朵粬  ===>> LED鏄剧ず鍣ㄥ浣嶏紝鏄剧ず榛樿淇℃伅
+//                    mainService.ledReset(10);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+        thread2.start();
     }
 
     @PreDestroy
     public void shutDown(){
         if (thread != null) thread.interrupt();
+        if (thread2 != null) thread2.interrupt();
     }
 
 }

--
Gitblit v1.9.1