#
luxiaotao1123
3 天以前 80f5003a640db7795d69c5e3a73caa685c289b80
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MapService.java
@@ -427,16 +427,20 @@
    }
    public static void main(String[] args) {
        CodeSpinType codeSpinType = calcSpinDirection(null, 260.0, 10.0);
        List<DirectionDto> directionDtoList = DirectionDto.initCodeDirections();
        System.out.println(JSON.toJSONString(directionDtoList));
        System.out.println(codeSpinType.toString());
    }
    public CodeSpinType calcSpinDirection(Code code, Double currDir, Double nextDir) {
    public static CodeSpinType calcSpinDirection(Code code, Double currDir, Double nextDir) {
        if (Cools.isEmpty(code, currDir, nextDir)) {
            return CodeSpinType.NA;
        }
        List<Double> disableAngleList = new ArrayList<>();
        List<DirectionDto> directionDtoList = DirectionDto.initCodeDirections();
        if (code.getData().contains("57")) {
            directionDtoList = DirectionDto.initCodeDirections0();
        }
        for (DirectionDto dto : directionDtoList) {
            if (null != dto.getEnabled() && !dto.getEnabled()) {
                disableAngleList.add(dto.getAngle());
@@ -455,8 +459,8 @@
            return CodeSpinType.NA;
        }
        double cwDelta = cwDelta(curr, next);     // (0, 360)
        double ccwDelta = 360.0 - cwDelta;  // (0, 360)
        double cwDelta = cwDelta(curr, next);
        double ccwDelta = 360.0 - cwDelta;
        boolean cwBlocked = false;
        boolean ccwBlocked = false;