*
lsh
2025-11-06 013c2ef0869f8599ac71444d256a70271bc5171d
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 {
@@ -115,10 +120,37 @@
                if (!SystemProperties.WCS_RUNNING_STATUS_DEMO.get()) {
                    continue;
                }
                // 入出库  ===>>  堆垛机入出库作业下发
                mainService.crnIoExecuteDemo();
                // 出库  ===>>  堆垛机出库站到出库站
                mainService.crnStnToOutStnDemo();
                // 入出库  ===>>  堆垛机入出库作业下发
                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();
            }
@@ -132,35 +164,43 @@
                Thread.sleep(1000);
                // 系统演示模式运行状态变化
                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) {
@@ -170,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();
    }
}