Browse Source

Merge branch 'master' of http://192.168.0.115:3000/bill/traffic-laser

bill 2 years ago
parent
commit
8502724b4c

File diff suppressed because it is too large
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 33 - 29
src/graphic/Controls/MovePoint.js

@@ -202,7 +202,6 @@ export default class MovePoint {
         line = mathUtil.createLine3(lineGeometry, position);
         let join = mathUtil.getIntersectionPoint(line, otherLine);
         mathUtil.clonePoint(otherPoint, join);
-        mathUtil.clonePoint(basePoint, position);
       } else if (
         line.getCategory() == VectorCategory.Line.ExtendedPositionLine
       ) {
@@ -211,45 +210,50 @@ export default class MovePoint {
         let otherLine = mathUtil.createLine3(lineGeometry, otherPoint);
         let join = mathUtil.getJoinLinePoint(position, otherLine);
         mathUtil.clonePoint(otherPoint, join);
-        mathUtil.clonePoint(basePoint, position);
       }
     }
+    mathUtil.clonePoint(basePoint, position);
   }
 
   updateFixPoint(position, fixPointId) {
     let fixPoint = dataService.getPoint(fixPointId);
-    let basePoint = dataService.getPoint(fixPoint.linkedBasePointId);
+
     let baseLine = dataService.getLine(Settings.baseLineId);
-    let startPoint = dataService.getPoint(baseLine.startId);
-    let endPoint = dataService.getPoint(baseLine.endId);
+    if (baseLine) {
+      let startPoint = dataService.getPoint(baseLine.startId);
+      let endPoint = dataService.getPoint(baseLine.endId);
 
-    let baseLineGeometry = mathUtil.createLine1(startPoint, endPoint);
-    let vLine = mathUtil.getVerticalLine(baseLineGeometry, position);
-    let join = mathUtil.getIntersectionPoint(baseLineGeometry, vLine);
+      let baseLineGeometry = mathUtil.createLine1(startPoint, endPoint);
+      let vLine = mathUtil.getVerticalLine(baseLineGeometry, position);
+      let join = mathUtil.getIntersectionPoint(baseLineGeometry, vLine);
 
-    let parent = fixPoint.getParent();
-    for (let key in parent) {
-      let line = dataService.getLine(key);
-      if (line.getCategory() == VectorCategory.Line.LocationLineByFixPoint) {
-        let otherPointId = line.getOtherPointId(fixPointId);
-        let otherPoint = dataService.getPoint(otherPointId);
-        mathUtil.clonePoint(otherPoint, join);
-      } else if (line.getCategory() == VectorCategory.Line.GuideLocationLine) {
-        let otherPointId = line.getOtherPointId(fixPointId);
-        let otherPoint = dataService.getPoint(otherPointId);
-        let line2 = mathUtil.createLine3(baseLineGeometry, otherPoint);
-        join = mathUtil.getIntersectionPoint(line2, vLine);
-        mathUtil.clonePoint(otherPoint, join);
-      } else if (
-        line.getCategory() == VectorCategory.Line.ExtendedPositionLine
-      ) {
-        let otherPointId = line.getOtherPointId(fixPointId);
-        let otherPoint = dataService.getPoint(otherPointId);
-        let line2 = mathUtil.createLine3(baseLineGeometry, fixPoint);
-        join = mathUtil.getJoinLinePoint(otherPoint, line2);
-        mathUtil.clonePoint(otherPoint, join);
+      let parent = fixPoint.getParent();
+      for (let key in parent) {
+        let line = dataService.getLine(key);
+        if (line.getCategory() == VectorCategory.Line.LocationLineByFixPoint) {
+          let otherPointId = line.getOtherPointId(fixPointId);
+          let otherPoint = dataService.getPoint(otherPointId);
+          mathUtil.clonePoint(otherPoint, join);
+        } else if (
+          line.getCategory() == VectorCategory.Line.GuideLocationLine
+        ) {
+          let otherPointId = line.getOtherPointId(fixPointId);
+          let otherPoint = dataService.getPoint(otherPointId);
+          let line2 = mathUtil.createLine3(baseLineGeometry, otherPoint);
+          join = mathUtil.getIntersectionPoint(line2, vLine);
+          mathUtil.clonePoint(otherPoint, join);
+        } else if (
+          line.getCategory() == VectorCategory.Line.ExtendedPositionLine
+        ) {
+          let otherPointId = line.getOtherPointId(fixPointId);
+          let otherPoint = dataService.getPoint(otherPointId);
+          let line2 = mathUtil.createLine3(baseLineGeometry, fixPoint);
+          join = mathUtil.getJoinLinePoint(otherPoint, line2);
+          mathUtil.clonePoint(otherPoint, join);
+        }
       }
     }
+
     mathUtil.clonePoint(fixPoint, position);
     moveText.moveFullText(position, fixPoint.linkedTextId);
   }

+ 0 - 1
src/graphic/Controls/UIControl.js

@@ -367,7 +367,6 @@ export default class UIControl {
         dataService.deleteLine(vectorId);
         if (vectorId == Settings.baseLineId) {
           this.layer.initLocation();
-          Settings.baseLineId = null;
         } else if (
           line.getCategory() == VectorCategory.Line.ExtendedPositionLine ||
           line.getCategory() == VectorCategory.Line.PositionLine ||

+ 11 - 0
src/graphic/History/HistoryUtil.js

@@ -787,12 +787,14 @@ export default class HistoryUtil {
     data.points = JSON.parse(JSON.stringify(curveRoad.points));
     data.curves = JSON.parse(JSON.stringify(curveRoad.curves));
     data.way = curveRoad.way;
+
     if (curveRoad.way == Constant.oneWay) {
       data.singleCurveRoadWidth = curveRoad.singleRoadWidth;
       data.singleCurveRoadDrivewayCount = curveRoad.singleRoadDrivewayCount;
       data.singleLanesCurves = JSON.parse(
         JSON.stringify(curveRoad.singleLanesCurves)
       );
+      data.singleLanes = JSON.parse(JSON.stringify(curveRoad.singleLanes));
     } else if (curveRoad.way == Constant.twoWay) {
       data.leftWidth = curveRoad.leftWidth;
       data.rightWidth = curveRoad.rightWidth;
@@ -805,6 +807,8 @@ export default class HistoryUtil {
       data.rightLanesCurves = JSON.parse(
         JSON.stringify(curveRoad.rightLanesCurves)
       );
+      data.leftLanes = JSON.parse(JSON.stringify(curveRoad.leftLanes));
+      data.rightLanes = JSON.parse(JSON.stringify(curveRoad.rightLanes));
     }
     return data;
   }
@@ -1016,6 +1020,9 @@ export default class HistoryUtil {
       curveRoad.singleLanesCurves = JSON.parse(
         JSON.stringify(curveRoadInfo.singleLanesCurves)
       );
+      curveRoad.singleLanes = JSON.parse(
+        JSON.stringify(curveRoadInfo.singleLanes)
+      );
     } else if (curveRoad.way == Constant.twoWay) {
       curveRoad.leftWidth = curveRoadInfo.leftWidth;
       curveRoad.rightWidth = curveRoadInfo.rightWidth;
@@ -1028,6 +1035,10 @@ export default class HistoryUtil {
       curveRoad.rightLanesCurves = JSON.parse(
         JSON.stringify(curveRoadInfo.rightLanesCurves)
       );
+      curveRoad.leftLanes = JSON.parse(JSON.stringify(curveRoadInfo.leftLanes));
+      curveRoad.rightLanes = JSON.parse(
+        JSON.stringify(curveRoadInfo.rightLanes)
+      );
     }
   }
 

+ 4 - 1
src/graphic/Layer.js

@@ -1138,7 +1138,10 @@ export default class Layer {
         addLine.finish(position);
         this.updateForLocation();
         //绘制的是基准线
-        if (Settings.baseLineId == addLine.newLine.vectorId) {
+        if (
+          addLine.newLine &&
+          Settings.baseLineId == addLine.newLine.vectorId
+        ) {
           stateService.clearEventName();
           this.history.save();
         }

+ 2 - 1
src/graphic/Load.js

@@ -98,7 +98,8 @@ export default class Load {
           point.setDisplay(dataLocal.points[key].display);
           point.setLocationMode(dataLocal.points[key].locationMode);
           point.setLinkedBasePointId(dataLocal.points[key].linkedBasePointId);
-          point.linkedTextId == dataLocal.points[key].linkedTextId;
+          point.setColor(point.getColor());
+          point.linkedTextId = dataLocal.points[key].linkedTextId;
         }
 
         // let points = dataService.vectorData.points;