From ea12b685190254228d88a0de261b1e399fcbf15b Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期四, 25 十二月 2025 15:11:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/shzhjxydwcs_cs20251105' into shzhjxydwcs_cs20251105
---
src/main/java/com/zy/core/MainProcess.java | 106 ++++++++++++++++++++++++++++++++++++----------------
1 files changed, 73 insertions(+), 33 deletions(-)
diff --git a/src/main/java/com/zy/core/MainProcess.java b/src/main/java/com/zy/core/MainProcess.java
index aa10235..5251183 100644
--- a/src/main/java/com/zy/core/MainProcess.java
+++ b/src/main/java/com/zy/core/MainProcess.java
@@ -23,31 +23,35 @@
// 鎵�灞炵嚎绋�
private Thread thread;
private Thread thread2;
- private Thread thread3;
- private Thread thread4;
+// 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();
- thread3 = new Thread(this::demoRun);
- thread3.start();
-
- thread4 = new Thread(this::demoOpenRun);
- thread4.start();
+// thread5 = new Thread(this::demoRun5);
+// thread5.start();
+//
+// thread3 = new Thread(this::demoRun);
+// thread3.start();
+//
+// thread4 = new Thread(this::demoOpenRun);
+// thread4.start();
}
private void crnAndDevRun() {
while (!Thread.currentThread().isInterrupted()) {
try {
// 闂撮殧
- Thread.sleep(1000);
+ Thread.sleep(500);
// 绯荤粺杩愯鐘舵�佸垽鏂�
if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
continue;
@@ -73,11 +77,12 @@
}
}
}
+
private void crnAndDevOtherRun() {
while (!Thread.currentThread().isInterrupted()) {
try {
// 闂撮殧
- Thread.sleep(400);
+ Thread.sleep(210);
// 绯荤粺杩愯鐘舵�佸垽鏂�
if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
continue;
@@ -106,7 +111,7 @@
while (!Thread.currentThread().isInterrupted()) {
try {
// 闂撮殧
- Thread.sleep(1000);
+ Thread.sleep(210);
// 绯荤粺杩愯鐘舵�佸垽鏂�
if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
continue;
@@ -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(100);
+ // 绯荤粺杩愯鐘舵�佸垽鏂�
+ 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();
}
@@ -130,38 +161,46 @@
while (!Thread.currentThread().isInterrupted()) {
try {
// 闂撮殧
- Thread.sleep(1000);
+ Thread.sleep(50);
// 绯荤粺婕旂ず妯″紡杩愯鐘舵�佸彉鍖�
if (SystemProperties.WCS_RUNNING_STATUS_DEMO.get()) {
- if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 2){
- boolean signHpMk = mainService.crnStnDEMOStop2();
- if (signHpMk){
+ if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 2) {
+ int signHpMk = mainService.crnStnDEMOStop2();
+ if (signHpMk == 0) {
SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 3;
}
- } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 3){
+ } else if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 3) {
boolean signHpMk = mainService.crnStnDEMOStop3();
- if (signHpMk){
+ 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 != 0) {
+ SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 2;
}
}
} else {
- if (SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE == 1){
- boolean signHpMk = mainService.crnStnDEMOOpen1();
- if (signHpMk){
+ 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;
+
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;
- }
- }
+ boolean signHpMk = mainService.crnStnDEMOOpen0();
+ if (signHpMk) {
+ SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 1;
+ } else {
+ SystemProperties.WCS_RUNNING_STATUS_DEMO_VALUE = 0;
+ }
+ }
}
// 鍏朵粬 ===>> LED鏄剧ず鍣ㄦ樉绀烘椂闂�
} catch (Exception e) {
@@ -171,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 (thread3 != null) thread3.interrupt();
+// if (thread4 != null) thread4.interrupt();
+// if (thread5 != null) thread5.interrupt();
}
}
--
Gitblit v1.9.1