1
2025-09-29 4747e5dcb4066161b42a7a54cab542949ad5826c
src/main/java/com/zy/core/MainProcess.java
@@ -24,7 +24,7 @@
    private MainServiceImpl mainService;
    // 所属线程
    private Thread thread;
    private Thread thread2;
    private Thread armThread;
    // 频率
    private int i = 0;
    private int k = 0;
@@ -37,8 +37,8 @@
        thread = new Thread(this::crnAndDevRun);
        thread.start();
        thread2 = new Thread(this::roboticArmDispatch);
//        thread2.start();
        armThread = new Thread(this::roboticArmDispatch);
        armThread.start();
    }
    private void crnAndDevRun() {
        while (!Thread.currentThread().isInterrupted()) {
@@ -92,7 +92,7 @@
                if (i>10){
                    //空托盘自动出库
                    mainService.autoEmptyOut();
//                    mainService.autoEmptyOut();
                    //空托盘自动入库
                    mainService.autoEmptyIn();
                    i=0;
@@ -135,8 +135,11 @@
                }catch (Exception e){
                    log.error("RGV  ===>>  小车任务作业下发异常"+e);
                }
                //完成小车任务
                mainService.rgvCompleteWrkMastSta();
//                //完成小车任务
                mainService.rgvTaskComplete();
                //工位移动
//                mainService.rgvStaMove();
                /////////////////////////////////////RGV调度/////////////////////////////////////
            } catch (Exception e) {
@@ -150,12 +153,19 @@
            try {
                // 间隔
                Thread.sleep(1000);
                Thread.sleep(500);
                // 系统运行状态判断
                if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
                    continue;
                }
                //arm任务完成
                mainService.armMissionAccomplished();
                mainService.armMissionAccomplishedScanToCheckIn();
                //arm任务下发
                mainService.armTaskAssignment();
            } catch (Exception e) {
                e.printStackTrace();
@@ -166,7 +176,7 @@
    @PreDestroy
    public void shutDown(){
        if (thread != null) thread.interrupt();
        if (thread2 != null) thread2.interrupt();
        if (armThread != null) armThread.interrupt();
    }
}