| | |
| | | mapContainer?.children.forEach(child => { |
| | | if (child.data?.uuid) { |
| | | const { type, uuid, no, ...property } = child.data; |
| | | mapItemList.push({ |
| | | // data |
| | | type: type, |
| | | uuid: uuid, |
| | | no: no, |
| | | property: property, |
| | | if (!( |
| | | type === SENSOR_TYPE.SHUTTLE |
| | | || type === SENSOR_TYPE.AGV |
| | | )) { |
| | | mapItemList.push({ |
| | | // data |
| | | type: type, |
| | | uuid: uuid, |
| | | no: no, |
| | | property: property, |
| | | |
| | | // graph |
| | | positionX: child.position.x, |
| | | positionY: child.position.y, |
| | | scaleX: child.scale.x, |
| | | scaleY: child.scale.y, |
| | | rotation: rotationToNum(child.rotation) |
| | | }) |
| | | // graph |
| | | positionX: child.position.x, |
| | | positionY: child.position.y, |
| | | scaleX: child.scale.x, |
| | | scaleY: child.scale.y, |
| | | rotation: rotationToNum(child.rotation) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | |
| | |
| | | |
| | | |
| | | shuttleVo.setCurLocNo(Utils.getLocNo(row, bay, lev)); |
| | | List<String> preTravelPath = generatePreTravelPath(row, bay, lev, shouldIncreaseBay, 10); |
| | | List<String> preTravelPath = generateFullTravelPath(10, 30, lev); |
| | | shuttleVo.setPreTravelPath(preTravelPath); |
| | | |
| | | |
| | |
| | | MapWebSocket.broadcast(JSON.toJSONString(wsVo)); |
| | | } |
| | | |
| | | private List<String> generateFullTravelPath(int maxRow, int maxBay, int currentLev) { |
| | | List<String> fullPath = new ArrayList<>(); |
| | | boolean increasingBay = true; // 假设从 bay = 1 开始递增 |
| | | |
| | | for (int currentRow = 1; currentRow <= maxRow; currentRow++) { |
| | | if (increasingBay) { |
| | | for (int currentBay = 1; currentBay <= maxBay; currentBay++) { |
| | | fullPath.add(Utils.getLocNo(currentRow, currentBay, currentLev)); |
| | | } |
| | | } else { |
| | | for (int currentBay = maxBay; currentBay >= 1; currentBay--) { |
| | | fullPath.add(Utils.getLocNo(currentRow, currentBay, currentLev)); |
| | | } |
| | | } |
| | | increasingBay = !increasingBay; // 到达每行的末尾时改变bay的递增/递减方向 |
| | | } |
| | | return fullPath; |
| | | } |
| | | |
| | | private List<String> generatePreTravelPath(int currentRow, int currentBay, int currentLev, boolean increasingBay, int pathLength) { |
| | | List<String> path = new ArrayList<>(); |
| | | int tempRow = currentRow; |