| | |
| | | package com.zy.asrs.wcs.core.kernel.command; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by vincent on 2023/10/23 |
| | |
| | | // 如果已经在当前条码则过滤 |
| | | if (String.valueOf(shuttleProtocol.getCurrentCode()).equals(locService.getOne(new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getLocNo, motion.getTarget()) |
| | | .eq(Loc::getHostId, motion.getHostId())).getCode())) { |
| | | .eq(Loc::getHostId, motion.getHostId())).getCode())) { |
| | | return true; |
| | | } |
| | | shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.NORMAL.id, assignCommand, shuttleThread); |
| | |
| | | //充电任务 |
| | | if (Objects.requireNonNull(MotionCtgType.get(motion.getMotionCtgEl())).equals(MotionCtgType.SHUTTLE_CHARGE_ON)) { |
| | | // 复位穿梭车 |
| | | shuttleProtocol.setTaskNo(0); |
| | | shuttleProtocol.setSyncTaskNo(0); |
| | | shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE); |
| | | shuttleProtocol.setPakMk(true); |
| | | return true; |
| | | } |
| | | |
| | | // if (!shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.WAITING) |
| | | // && !shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.CHARGING_WAITING) |
| | | // ) { |
| | | // return false; |
| | | // } |
| | | if (!shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.WAITING) |
| | | && !shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.CHARGING_WAITING) |
| | | ) { |
| | | return false; |
| | | } |
| | | |
| | | //判断设备是否空闲 |
| | | if (!shuttleThread.isIdle()) { |
| | |
| | | } |
| | | |
| | | // 复位穿梭车 |
| | | shuttleProtocol.setTaskNo(0); |
| | | shuttleProtocol.setSyncTaskNo(0); |
| | | shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE); |
| | | shuttleProtocol.setPakMk(true); |
| | | |
| | |
| | | News.error("{} dash {} can't find navigate path!", startLocNo, endLocNo); |
| | | return null; |
| | | } |
| | | List<NavigateNode> allNode = new ArrayList<>(nodeList); |
| | | |
| | | List<NavigateNode> allNode = new ArrayList<>(); |
| | | for (NavigateNode node : nodeList) { |
| | | allNode.add(node.clone()); |
| | | } |
| | | |
| | | List<ShuttleCommand> commands = new ArrayList<>(); |
| | | //获取分段路径 |