From 1983df9f47c76e3c047f386e82e89c5537f345ac Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期三, 05 十一月 2025 12:57:32 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/core/MainProcess.java |   59 ++++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index ec52590..fd7e5fd 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -29,7 +29,7 @@
     /**
      * =====>>  寮�濮嬪伐浣�
      */
-    public void start(){
+    public void start() {
         thread = new Thread(this::crnAndDevRun);
         thread.start();
 
@@ -73,6 +73,7 @@
             }
         }
     }
+
     private void crnAndDevOtherRun() {
         while (!Thread.currentThread().isInterrupted()) {
             try {
@@ -116,10 +117,11 @@
                     continue;
                 }
                 // 鍑哄簱  ===>>  鍫嗗灈鏈哄嚭搴撶珯鍒板嚭搴撶珯
-                mainService.crnStnToOutStn();
+                mainService.crnStnToOutStnDemo();
                 // 鍏ュ嚭搴�  ===>>  鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
-                mainService.crnIoExecute();
-                // 鍏朵粬  ===>> LED鏄剧ず鍣ㄦ樉绀烘椂闂�
+                mainService.crnIoExecuteDemo();
+                // 鍏ュ簱  ===>> 鎵ц瀵瑰伐浣滄。鐨勫畬鎴愭搷浣�
+                mainService.storeFinishedDemo();
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -133,24 +135,39 @@
                 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){
-
-                    } 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){
-
+                    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 {
+                            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,7 +178,7 @@
     }
 
     @PreDestroy
-    public void shutDown(){
+    public void shutDown() {
         if (thread != null) thread.interrupt();
         if (thread2 != null) thread2.interrupt();
         if (thread3 != null) thread3.interrupt();

--
Gitblit v1.9.1