| | |
| | | package com.zy.core; |
| | | |
| | | import com.zy.asrs.service.impl.MainServiceImpl; |
| | | import com.zy.core.properties.SystemProperties; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PreDestroy; |
| | |
| | | @Component |
| | | public class MainProcess { |
| | | |
| | | @Autowired |
| | | private MainServiceImpl mainService; |
| | | // 所属线程 |
| | | private Thread thread; |
| | | // 频率 |
| | | private int i = 0; |
| | | |
| | | /** |
| | | * =====>> 开始工作 |
| | |
| | | thread = new Thread(() -> { |
| | | while (!Thread.currentThread().isInterrupted()) { |
| | | try { |
| | | |
| | | // 间隔 |
| | | Thread.sleep(300); |
| | | |
| | | // 系统运行状态判断 |
| | | if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | if (!SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | continue; |
| | | } |
| | | |
| | | //初始化实时地图 |
| | | mainService.initRealtimeBasMap(); |
| | | |
| | | //出库任务预调度提升机 |
| | | mainService.outTaskPreviewDispatchForkLift(); |
| | | |
| | | // 入库 ===>> 四向穿梭车入库作业下发 |
| | | mainService.shuttleInExecute(); |
| | | // 出库 ===>> 四向穿梭车出库作业下发 |
| | | mainService.shuttleOutExecute(); |
| | | //四向穿梭车任务完成 |
| | | mainService.shuttleFinished(); |
| | | //执行移库任务 |
| | | mainService.shuttleLocMoveExecute(); |
| | | //货叉提升机任务 |
| | | mainService.forkLiftIoExecute(); |
| | | //货叉提升机任务完成 |
| | | mainService.forkLiftFinished(); |
| | | //执行小车移动任务 |
| | | mainService.shuttleMoveExecute(); |
| | | // 异常信息记录 |
| | | mainService.recErr(); |
| | | // 穿梭车 ===>> 小车电量检测充电 |
| | | mainService.loopShuttleCharge(); |
| | | mainService.executeShuttleCharge(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //自动切换出入库模式 |
| | | mainService.autoSwitchForkLiftIOMode(); |
| | | |
| | | // 间隔 |
| | | Thread.sleep(1500); |
| | | log.info("WCS 工作中 ....................."); |
| | | Thread.sleep(200); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |