#
Junjie
7 天以前 e6d9118e6c9083ae4c1f1dc18f34b23ed3da2581
src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
@@ -78,6 +78,22 @@
                    listenInit();//监听初始化事件
                    readStatus();
                    Thread.sleep(100);
                    ShuttleAction shuttleAction = null;
                    try {
                        shuttleAction = SpringUtils.getBean(ShuttleAction.class);
                    }catch (Exception e){
                        continue;
                    }
                    if (shuttleAction == null) {
                        continue;
                    }
                    //演示模式
                    shuttleAction.demo(deviceConfig.getDeviceNo());
//                    //小车空闲且有跑库程序
//                    shuttleAction.moveLoc(deviceConfig.getDeviceNo());
                } catch (Exception e) {
                    log.error("ShuttleThread Fail", e);
                }
@@ -110,14 +126,7 @@
                        //存在任务需要执行
                        boolean result = shuttleAction.executeWork(deviceConfig.getDeviceNo(), taskNo);
                    }
//                    //小车空闲且有跑库程序
//                    shuttleAction.moveLoc(deviceConfig.getDeviceNo());
                    //演示模式
                    shuttleAction.demo(deviceConfig.getDeviceNo());
                    Thread.sleep(200);
                    Thread.sleep(100);
                } catch (Exception e) {
                    e.printStackTrace();
                }
@@ -125,17 +134,17 @@
        });
        executeThread.start();
        //其他任务
        Thread otherThread = new Thread(() -> {
            while (true) {
                try {
                    saveLog();//保存数据
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
        otherThread.start();
//        //其他任务
//        Thread otherThread = new Thread(() -> {
//            while (true) {
//                try {
//                    saveLog();//保存数据
//                } catch (Exception e) {
//                    e.printStackTrace();
//                }
//            }
//        });
//        otherThread.start();
    }
    private void saveLog() {