zy-acs-flow/src/map/constants.js
@@ -1,5 +1,5 @@ export const ANIMATE_DURING_TIME = 800; export const ANIMATE_DURING_TIME = 1000; export const MAP_DEFAULT_ROTATION = 270; zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MapDataWsScheduler.java
@@ -33,7 +33,7 @@ @Component public class MapDataWsScheduler { public static final int WEBSOCKET_BROADCAST_INTERVAL = 800; public static final int WEBSOCKET_BROADCAST_INTERVAL = 1000; private ExecutorService singleThreadExecutor; zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MapService.java
@@ -307,26 +307,20 @@ existNodes.add(nextNode); String nextNodeCodeData = codeMatrix[x][y]; if (nextNodeCodeData.equals(CodeNodeType.NONE.val)) { List<Double> o1Cda = MapDataUtils.parseCdaNode(cdaMatrix[originNode.getX()][originNode.getY()]); List<Double> o2Cda = MapDataUtils.parseCdaNode(cdaMatrix[x][y]); if (Math.pow(o1Cda.get(0) - o2Cda.get(0), 2) + Math.pow(o1Cda.get(1) - o2Cda.get(1), 2) <= Math.pow(radiusLen, 2)) { nextNode.setCodeData(codeMatrix[x][y]); if (!nextNode.getCodeData().equals(CodeNodeType.NONE.val)) { includeList.add(nextNode); } this.spreadWaveNode(originNode, nextNode, codeMatrix, cdaMatrix, radiusLen, includeList, existNodes); } else { List<Double> o1Cda = MapDataUtils.parseCdaNode(cdaMatrix[originNode.getX()][originNode.getY()]); List<Double> o2Cda = MapDataUtils.parseCdaNode(cdaMatrix[nextNode.getX()][nextNode.getY()]); // if (Math.pow(o1.getX() - o2.getX(), 2) + Math.pow(o1.getY() - o2.getY(), 2) <= Math.pow(radiusLen, 2)) { if (Math.pow(o1Cda.get(0) - o2Cda.get(0), 2) + Math.pow(o1Cda.get(1) - o2Cda.get(1), 2) <= Math.pow(radiusLen, 2)) { nextNode.setCodeData(nextNodeCodeData); includeList.add(nextNode); this.spreadWaveNode(originNode, nextNode, codeMatrix, cdaMatrix, radiusLen, includeList, existNodes); } } } // v2 BFS ------------------------------------------------------------------------------ zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/astart/MapDataDispatcher.java
@@ -3,6 +3,7 @@ import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zy.acs.common.constant.RedisConstant; import com.zy.acs.common.utils.GsonUtils; import com.zy.acs.common.utils.RedisSupport; import com.zy.acs.framework.common.Cools; import com.zy.acs.framework.exception.CoolException; @@ -28,6 +29,9 @@ public static final Integer MAP_DEFAULT_LEV = 1; private final RedisSupport redis = RedisSupport.defaultRedisSupport; List<Double> xIdxList; List<Double> yIdxList; private String[][] codeMatrix; @@ -236,13 +240,20 @@ log.info("There is initializing Cda Matrix......"); lev = Optional.ofNullable(lev).orElse(MAP_DEFAULT_LEV); if (Cools.isEmpty(xIdxList, yIdxList)) { this.initCodeMatrix(lev); } String[][] codeMatrix = getCodeMatrix(lev); String[][] cdaMatrix = new String[codeMatrix.length][codeMatrix[0].length]; for (int i = 0; i < codeMatrix.length; i++) { for (int j = 0; j < codeMatrix[i].length; j++) { if (CodeNodeType.NONE.val.equals(codeMatrix[i][j])) { cdaMatrix[i][j] = CdaNodeType.DISABLE.val; List<Double> cdaArr = new ArrayList<>(); cdaArr.add(xIdxList.get(j)); cdaArr.add(yIdxList.get(i)); cdaMatrix[i][j] = JSON.toJSONString(cdaArr); } else { Code currCode = codeService.selectByData(codeMatrix[i][j]); if (null != currCode) { @@ -385,13 +396,9 @@ .orderByAsc(Code::getY) .orderByAsc(Code::getX) ); // int xCount = codeService.selectDistinctCountFromX(); // int yCount = codeService.selectDistinctCountFromY(); // // [][] 第一个是排的数量 第二个是列的数量 // String[][] codeMatrix = new String[yCount][xCount]; List<Double> xIdxList = new ArrayList<>(); List<Double> yIdxList = new ArrayList<>(); xIdxList = new ArrayList<>(); yIdxList = new ArrayList<>(); for (Code code : codeList) { Double x = code.getX(); Double y = code.getY(); @@ -409,24 +416,9 @@ // [][] 第一个是排的数量 第二个是列的数量 String[][] codeMatrix = new String[yIdxList.size()][xIdxList.size()]; int idxX = -1; int idxY = -1; double lastX = -1; double lastY = -1; for (Code code : codeList) { Double x = code.getX(); Double y = code.getY(); // if (y != lastY) { // idxY ++; // idxX = 0; // lastY = y; // lastX = x; // } // if (x != lastX) { // idxX++; // lastX = x; // } // codeMatrix[idxY][idxX] = code.getData(); codeMatrix[yIdxList.indexOf(y)][xIdxList.indexOf(x)] = code.getData(); }