From 013c2ef0869f8599ac71444d256a70271bc5171d Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期四, 06 十一月 2025 18:34:58 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/core/MainProcess.java |   39 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index fd7e5fd..570008e 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -25,6 +25,7 @@
     private Thread thread2;
     private Thread thread3;
     private Thread thread4;
+    private Thread thread5;
 
     /**
      * =====>>  寮�濮嬪伐浣�
@@ -35,6 +36,9 @@
 
         thread2 = new Thread(this::crnAndDevOtherRun);
         thread2.start();
+
+        thread5 = new Thread(this::demoRun5);
+        thread5.start();
 
         thread3 = new Thread(this::demoRun);
         thread3.start();
@@ -128,6 +132,31 @@
         }
     }
 
+    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();
+            }
+        }
+    }
+
     private void demoOpenRun() {
         while (!Thread.currentThread().isInterrupted()) {
             try {
@@ -137,7 +166,7 @@
                 if (SystemProperties.WCS_RUNNING_STATUS_DEMO.get()) {
                     if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 2) {
                         int signHpMk = mainService.crnStnDEMOStop2();
-                        if (signHpMk != 2) {
+                        if (signHpMk == 0) {
                             SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 3;
                         }
                     } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 3) {
@@ -146,7 +175,7 @@
                         if (signHpMk && signHpMk2==0) {
                             SystemProperties.WCS_RUNNING_STATUS_DEMO.set(false);
                             SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 0;
-                        } else if (!signHpMk && signHpMk2==2) {
+                        } else if (!signHpMk && signHpMk2 != 0) {
                             SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 2;
                         }
                     }
@@ -157,7 +186,10 @@
                             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;
+//                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 1;
+
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO.set(true);
+                            SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 2;
                         } else {
                             SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 0;
                         }
@@ -183,6 +215,7 @@
         if (thread2 != null) thread2.interrupt();
         if (thread3 != null) thread3.interrupt();
         if (thread4 != null) thread4.interrupt();
+        if (thread5 != null) thread5.interrupt();
     }
 
 }

--
Gitblit v1.9.1