| | |
| | | stationRerouteProcessor.checkStationRunBlock(basDevp, stationId); |
| | | } |
| | | |
| | | // 检测单个站点任务停留超时后的恢复处理 |
| | | public void checkStationIdleRecover(BasDevp basDevp, Integer stationId) { |
| | | stationRerouteProcessor.checkStationIdleRecover(basDevp, stationId); |
| | | } |
| | | |
| | | //获取输送线任务数量 |
| | | public int getCurrentStationTaskCount() { |
| | | return stationDispatchLoadSupport.countCurrentStationTask(); |
| | |
| | | // 检测单个站点的出库排序 |
| | | public void checkStationOutOrder(BasDevp basDevp, StationObjModel stationObjModel) { |
| | | stationRerouteProcessor.checkStationOutOrder(basDevp, stationObjModel); |
| | | } |
| | | |
| | | // 监控单个绕圈站点 |
| | | public void watchCircleStation(BasDevp basDevp, Integer stationId) { |
| | | stationRerouteProcessor.watchCircleStation(basDevp, stationId); |
| | | } |
| | | |
| | | public void submitStationInTasks(long minIntervalMs) { |
| | |
| | | } |
| | | } |
| | | |
| | | public void submitWatchCircleStationTasks(long minIntervalMs) { |
| | | submitWatchCircleStationTasks(MainProcessLane.STATION_WATCH_CIRCLE, minIntervalMs); |
| | | } |
| | | |
| | | public void submitWatchCircleStationTasks(MainProcessLane lane, long minIntervalMs) { |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | | continue; |
| | | } |
| | | for (StationProtocol stationProtocol : stationThread.getStatus()) { |
| | | Integer stationId = stationProtocol == null ? null : stationProtocol.getStationId(); |
| | | if (stationId == null) { |
| | | continue; |
| | | } |
| | | if (!stationProtocol.isAutoing() |
| | | || !stationProtocol.isLoading() |
| | | || stationProtocol.getTaskNo() <= 0 |
| | | || !stationOutboundDecisionSupport.isWatchingCircleArrival(stationProtocol.getTaskNo(), stationProtocol.getStationId())) { |
| | | continue; |
| | | } |
| | | |
| | | mainProcessTaskSubmitter.submitKeyedSerialTask( |
| | | lane, |
| | | stationId, |
| | | "watchCircleStation", |
| | | minIntervalMs, |
| | | () -> watchCircleStation(basDevp, stationId) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void submitCheckStationRunBlockTasks(long minIntervalMs) { |
| | | submitCheckStationRunBlockTasks(MainProcessLane.STATION_RUN_BLOCK, minIntervalMs); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public void submitCheckStationIdleRecoverTasks(long minIntervalMs) { |
| | | submitCheckStationIdleRecoverTasks(MainProcessLane.STATION_IDLE_RECOVER, minIntervalMs); |
| | | } |
| | | |
| | | public void submitCheckStationIdleRecoverTasks(MainProcessLane lane, long minIntervalMs) { |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | | continue; |
| | | } |
| | | for (StationProtocol stationProtocol : stationThread.getStatus()) { |
| | | Integer stationId = stationProtocol == null ? null : stationProtocol.getStationId(); |
| | | if (stationId == null) { |
| | | continue; |
| | | } |
| | | if (!isIdleRecoverCandidateStation(basDevp, stationId)) { |
| | | continue; |
| | | } |
| | | if (!stationProtocol.isAutoing() |
| | | || !stationProtocol.isLoading() |
| | | || stationProtocol.getTaskNo() <= 0 |
| | | || stationProtocol.isRunBlock()) { |
| | | continue; |
| | | } |
| | | mainProcessTaskSubmitter.submitKeyedSerialTask( |
| | | lane, |
| | | stationId, |
| | | "checkStationIdleRecover", |
| | | minIntervalMs, |
| | | () -> checkStationIdleRecover(basDevp, stationId) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | RerouteCommandPlan buildRerouteCommandPlan(RerouteContext context, |
| | | RerouteDecision decision) { |
| | | return stationRerouteProcessor.buildRerouteCommandPlan(context, decision); |
| | |
| | | Integer stationId, |
| | | List<Integer> runBlockReassignLocStationList) { |
| | | return stationRerouteProcessor.shouldUseRunBlockDirectReassign(wrkMast, stationId, runBlockReassignLocStationList); |
| | | } |
| | | |
| | | public boolean isIdleRecoverCandidateStation(BasDevp basDevp, Integer stationId) { |
| | | if (basDevp == null || stationId == null) { |
| | | return false; |
| | | } |
| | | return !containsStation(basDevp.getBarcodeStationList$(), stationId) |
| | | && !containsStation(basDevp.getInStationList$(), stationId) |
| | | && !containsStation(basDevp.getOutStationList$(), stationId); |
| | | } |
| | | |
| | | private boolean containsStation(List<StationObjModel> stationList, Integer stationId) { |
| | | if (stationList == null || stationList.isEmpty() || stationId == null) { |
| | | return false; |
| | | } |
| | | for (StationObjModel stationObjModel : stationList) { |
| | | if (stationObjModel != null && Objects.equals(stationObjModel.getStationId(), stationId)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private boolean shouldSkipIdleRecoverForRecentDispatch(Integer taskNo, Integer stationId) { |
| | | return stationRerouteProcessor.shouldSkipIdleRecoverForRecentDispatch(taskNo, stationId); |
| | | } |
| | | |
| | | public void attemptClearTaskPath(StationThread stationThread, Integer taskNo) { |