From f2d1970cfd6d105e28d0a51a5313f30f81dbe63a Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期三, 05 十一月 2025 13:40:34 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/core/MainProcess.java |   90 +++++++++++++++++++++++++++++++++++----------
 1 files changed, 70 insertions(+), 20 deletions(-)

diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index ec52590..75f8e79 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -25,16 +25,20 @@
     private Thread thread2;
     private Thread thread3;
     private Thread thread4;
+    private Thread thread5;
 
     /**
      * =====>>  寮�濮嬪伐浣�
      */
-    public void start(){
+    public void start() {
         thread = new Thread(this::crnAndDevRun);
         thread.start();
 
         thread2 = new Thread(this::crnAndDevOtherRun);
         thread2.start();
+
+        thread5 = new Thread(this::demoRun5);
+        thread5.start();
 
         thread3 = new Thread(this::demoRun);
         thread3.start();
@@ -73,6 +77,7 @@
             }
         }
     }
+
     private void crnAndDevOtherRun() {
         while (!Thread.currentThread().isInterrupted()) {
             try {
@@ -116,10 +121,36 @@
                     continue;
                 }
                 // 鍑哄簱  ===>>  鍫嗗灈鏈哄嚭搴撶珯鍒板嚭搴撶珯
-                mainService.crnStnToOutStn();
+                mainService.crnStnToOutStnDemo();
                 // 鍏ュ嚭搴�  ===>>  鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
-                mainService.crnIoExecute();
-                // 鍏朵粬  ===>> LED鏄剧ず鍣ㄦ樉绀烘椂闂�
+                mainService.crnIoExecuteDemo();
+                // 鍏ュ簱  ===>> 鎵ц瀵瑰伐浣滄。鐨勫畬鎴愭搷浣�
+                mainService.storeFinishedDemo();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private void demoRun5() {
+        while (!Thread.currentThread().isInterrupted()) {
+            try {
+                // 闂撮殧
+                Thread.sleep(200);
+                // 绯荤粺杩愯鐘舵�佸垽鏂�
+                if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
+                    continue;
+                }
+                // 绯荤粺婕旂ず妯″紡杩愯鐘舵�佸垽鏂�
+                if (!SystemProperties.WCS_RUNNING_STATUS_DEMO.get()) {
+                    continue;
+                }
+                // 绯荤粺婕旂ず妯″紡杩愯鐘舵�佸垽鏂�
+                if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE != 2) {
+                    continue;
+                }
+                // 鍏ュ簱  ===>> 鎵ц瀵瑰伐浣滄。鐨勫畬鎴愭搷浣�
+                mainService.locMastTaskDemo();
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -133,24 +164,42 @@
                 Thread.sleep(1000);
                 // 绯荤粺婕旂ず妯″紡杩愯鐘舵�佸彉鍖�
                 if (SystemProperties.WCS_RUNNING_STATUS_DEMO.get()) {
-                    if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 2){
-
-                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 3){
-
-                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 0){
-
-                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 1){
-
+                    if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 2) {
+                        int signHpMk = mainService.crnStnDEMOStop2();
+                        if (signHpMk != 2) {
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 3;
+                        }
+                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 3) {
+                        boolean signHpMk = mainService.crnStnDEMOStop3();
+                        int signHpMk2 = mainService.crnStnDEMOStop2();
+                        if (signHpMk && signHpMk2==0) {
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO.set(false);
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 0;
+                        } else if (!signHpMk && signHpMk2==2) {
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 2;
+                        }
                     }
                 } else {
-                    if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 0){
+                    if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 1) {
+                        int signHpMk = mainService.crnStnDEMOOpen1();
+                        if (signHpMk == 2) {
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO.set(true);
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 2;
+                        } else if (signHpMk == 1) {
+//                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 1;
 
-                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 1){
-
-                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 2){
-
-                    } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 3){
-
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO.set(true);
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 2;
+                        } else {
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 0;
+                        }
+                    } else {
+                        boolean signHpMk = mainService.crnStnDEMOOpen0();
+                        if (signHpMk) {
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 1;
+                        } else {
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 0;
+                        }
                     }
                 }
                 // 鍏朵粬  ===>> LED鏄剧ず鍣ㄦ樉绀烘椂闂�
@@ -161,11 +210,12 @@
     }
 
     @PreDestroy
-    public void shutDown(){
+    public void shutDown() {
         if (thread != null) thread.interrupt();
         if (thread2 != null) thread2.interrupt();
         if (thread3 != null) thread3.interrupt();
         if (thread4 != null) thread4.interrupt();
+        if (thread5 != null) thread5.interrupt();
     }
 
 }

--
Gitblit v1.9.1