111
yy
20 小时以前 e7ba29233031f8f101c73a9c63e4718ba78e3eb4
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -769,9 +769,9 @@
                Task task = taskService.getById(segment.getTaskId());
                TaskPosDto.PosType posType = Objects.requireNonNull(TaskPosDto.queryPosType(segment.getPosType()));
                // 目标是否为站点
                boolean isStation = posType == TaskPosDto.PosType.ORI_STA || posType == TaskPosDto.PosType.DEST_STA;
                boolean isStation = posType == TaskPosDto.PosType.ORI_STA || posType == TaskPosDto.PosType.DEST_STA || posType == TaskPosDto.PosType.MOVE;
                // 目标是否为库位
                boolean isLoc = posType == TaskPosDto.PosType.ORI_LOC || posType == TaskPosDto.PosType.DEST_LOC;
                boolean isLoc = posType == TaskPosDto.PosType.ORI_LOC || posType == TaskPosDto.PosType.DEST_LOC || posType == TaskPosDto.PosType.MOVE ;
                // 站点地码
                List<String> turnCodes = Arrays.asList("00000050", "00000051", "00000052", "00000053", "00000054");
                // 库位地码
@@ -833,7 +833,7 @@
                                                ActionTypeType.TurnCorner.desc,    // 名称
                                                mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D,    // 属性值
                                                lastCode.getData(),    // 地面码
                                                String.valueOf(180),   // 动作参数
                                                String.valueOf(nextDirection),   // 动作参数
                                                ActionTypeType.TurnCorner.val(),    // 动作类型
                                                actionPrepareSts,    // 动作进度
                                                agvId,    // AGV
@@ -889,7 +889,7 @@
                                            ActionTypeType.TurnCorner.desc,    // 名称
                                            mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D,    // 属性值
                                            lastCode.getData(),    // 地面码
                                            String.valueOf(180),   // 动作参数
                                            String.valueOf((nextCode.getData().equals("00000051")||nextCode.getData().equals("00000081") )? 180 : (nextCode.getData().equals("00000025")?270:(nextCode.getData().equals("00000055")?90:0)) ),   // 动作参数
                                            ActionTypeType.TurnCorner.val(),    // 动作类型
                                            actionPrepareSts,    // 动作进度
                                            agvId,    // AGV
@@ -934,6 +934,19 @@
                            lastDirection = nextDirection;
                        }
                        // 如果当前地码和下一个地码都在站点地码集合内,则根据在集合中的顺序决定行进方向和是否倒退
                        if (turnCodes.contains(lastCode.getData()) && turnCodes.contains(nextCode.getData())) {
                            int lastIndex = turnCodes.indexOf(lastCode.getData());
                            int nextIndex = turnCodes.indexOf(nextCode.getData());
                            if (nextIndex > lastIndex) {
                                nextDirection = 180D;
                                reverse = false;
                            } else if (nextIndex < lastIndex) {
                                nextDirection = 0D;
                                reverse = true;
                            }
                        }
                        // run
                        ActionTypeType actionType = ActionTypeType.StraightAheadTurnable;
                        if (reverse) {