| | |
| | | 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); |
| | | } |
| | |
| | | //存在任务需要执行 |
| | | 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(); |
| | | } |
| | |
| | | }); |
| | | 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() { |