| | |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.ShuttleAssignCommand; |
| | | import com.zy.core.model.command.ShuttleCommand; |
| | | import com.zy.core.model.protocol.NyShuttleProtocol; |
| | | import com.zy.core.model.protocol.ShuttleProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.NyShuttleThread; |
| | | import com.zy.core.thread.ShuttleThread; |
| | | |
| | | import java.text.DecimalFormat; |
| | |
| | | } |
| | | |
| | | //获取穿梭车所在节点位置 |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); |
| | | NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); |
| | | if (shuttleThread == null) { |
| | | continue; |
| | | } |
| | | ShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol(); |
| | | NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol(); |
| | | if (shuttleProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | if (shuttleProtocol.getLocNo() == null) { |
| | | if (shuttleProtocol.getCurrentLocNo() == null) { |
| | | continue; |
| | | } |
| | | |
| | | if (lev != Utils.getLev(shuttleProtocol.getLocNo())) { |
| | | if (lev != Utils.getLev(shuttleProtocol.getCurrentLocNo())) { |
| | | continue;//楼层不同 |
| | | } |
| | | |
| | | int[] xyPosition = NavigatePositionConvert.positionToXY(shuttleProtocol.getLocNo());//通过库位号获取xy坐标 |
| | | int[] xyPosition = NavigatePositionConvert.positionToXY(shuttleProtocol.getCurrentLocNo());//通过库位号获取xy坐标 |
| | | list.add(xyPosition); |
| | | } |
| | | return list; |
| | |
| | | |
| | | //检测穿梭车行走路径,是否存在其他小车,如有其他小车则进行调离 |
| | | public static boolean checkShuttlePath(List<NavigateNode> nodes, Integer shuttleId) { |
| | | boolean flag = false; |
| | | boolean flag = false; |
| | | int shuttleX = -1; |
| | | int shuttleY = -1; |
| | | int shuttleZ = -1; |
| | |
| | | if (currentShuttleThread == null) { |
| | | //没找到小车 |
| | | return false; |
| | | } |
| | | |
| | | ShuttleProtocol shuttleProtocol = currentShuttleThread.getShuttleProtocol(); |
| | | if (!shuttleProtocol.isIdle()) { |
| | | return false;//被调度的小车处于工作状态,禁止触发避让任务 |
| | | } |
| | | |
| | | //搜索一条没有小车的空巷道,并调度小车 |
| | |
| | | return null; |
| | | } |
| | | |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | return assignCommand; |
| | | } |
| | | return null; |