Rmengdi пре 2 месеци
родитељ
комит
a4b8edeef6
1 измењених фајлова са 11 додато и 3 уклоњено
  1. 11 3
      uavps-web/src/views/uavps/parameter/index.vue

+ 11 - 3
uavps-web/src/views/uavps/parameter/index.vue

@@ -490,6 +490,9 @@ export default {
         x: null,
         y: null,
       },
+      // 多久更新一次轨迹
+      updatePathFlag: 125,
+      cycleCount: 0, // 循环计数
     };
   },
   created() {
@@ -706,6 +709,9 @@ export default {
           dude.y = data.targetAircraft[0].aircrafts[i].coordinateY;
           dude.rotation = Math.atan2(dude.y, dude.x) + Math.PI / 2;
 
+          // const rotation = Math.atan2(eastSpeed, northSpeed);
+          // dude.rotation = (-rotation + 2 * Math.PI) % (2 * Math.PI);
+
           dude.id = data.targetAircraft[0].aircrafts[i].aircraftNumber; // 分配唯一编号
 
           this.targetUavAry.push(dude);
@@ -823,9 +829,11 @@ export default {
           }
         }
       }
-      // 更新路径绘制
-      this.updatePath();
-
+      if (this.cycleCount % this.updatePathFlag == 0) {
+        // 更新路径绘制
+        this.updatePath();
+      }
+      this.cycleCount++;
       // 更新位置
       //this.updatePosition();
     },