| New file |
| | |
| | | package com.zy.acs.manager.core.domain; |
| | | |
| | | |
| | | import com.zy.acs.manager.core.domain.type.DirectionType; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2026/1/14 |
| | | */ |
| | | @Data |
| | | public class DirectionDto { |
| | | |
| | | private DirectionType direction; |
| | | |
| | | private Boolean enabled; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.acs.manager.core.domain.type; |
| | | |
| | | public enum DirectionType { |
| | | |
| | | // NORTH, EAST, SOUTH, WEST, |
| | | // ; |
| | | |
| | | NONE, |
| | | TOP, |
| | | LEFT, |
| | | BOTTOM, |
| | | RIGHT, |
| | | ; |
| | | |
| | | } |
| | |
| | | if (!lastCode.getData().equals(code.getData())) { |
| | | |
| | | // 走行路径节点 |
| | | // List<String> pathList = mapService.checkoutPath(agv.getUuid(), lastCode, code); |
| | | List<String> pathListPart = pathList.subList(pathList.indexOf(lastCode.getData()), pathList.indexOf(code.getData()) + 1); |
| | | |
| | | for (int i = 0; i < pathListPart.size(); i++) { |
| | |
| | | return Math.sqrt(deltaX * deltaX + deltaY * deltaY); |
| | | } |
| | | |
| | | public DirectionType calcDirectionType(int[] originIdx, int[] oppositeIdx) { |
| | | if (oppositeIdx[0] < originIdx[0] && oppositeIdx[1] == originIdx[1]) { |
| | | return DirectionType.TOP; |
| | | } |
| | | if (oppositeIdx[0] > originIdx[0] && oppositeIdx[1] == originIdx[1]) { |
| | | return DirectionType.BOTTOM; |
| | | } |
| | | if (oppositeIdx[0] == originIdx[0] && oppositeIdx[1] > originIdx[1]) { |
| | | return DirectionType.RIGHT; |
| | | } |
| | | if (oppositeIdx[0] == originIdx[0] && oppositeIdx[1] < originIdx[1]) { |
| | | return DirectionType.LEFT; |
| | | } |
| | | return DirectionType.NONE; |
| | | } |
| | | |
| | | public void lockPath(Integer lev, List<String> pathList, String agvNo) { |
| | | List<int[]> codeMatrixIdxList = mapDataDispatcher.getCodeMatrixIdxList(lev, pathList); |
| | | mapDataDispatcher.modifyDynamicMatrix(lev, codeMatrixIdxList, agvNo); |