zansimple пре 2 дана
родитељ
комит
8a6dcf6d04

+ 1 - 0
Models/SimulationCommon/Define.cs

@@ -39,4 +39,5 @@ public class CurrentLocation
     public double CurrentFuel;
     public double CurrentCourse;//添加了当前航向
     public int Currentsegnum;//添加了当前航段数
+    public bool EndLocation;
 }

+ 2 - 2
Models/SimulationCommon/FXJHGenenrate.cs

@@ -1092,7 +1092,7 @@ namespace Model
         }
 
 
-        public static CurrentLocation GetCurrentLocationNew(List<TurningPoint> turningPoints,
+        public static  CurrentLocation GetCurrentLocationNew(List<TurningPoint> turningPoints,
             List<List<Point3D>> allPaths, double currentTime)
         {
             double accumulatedTime = 0; // 累积飞行时间
@@ -1168,7 +1168,7 @@ namespace Model
 
             // 设置当前航段数为最后一个TurningPoint的索引
             currentLocation.Currentsegnum = turningPoints.Count - 1;
-
+            currentLocation.EndLocation = true;
             return currentLocation;
         }
 

+ 1 - 2
SimulationServer/Entity/Aircrafts/AircraftXH.cs

@@ -57,8 +57,7 @@ public class AircraftXH : AircraftEntity
         {
             do
             {
-                var location = FXJHGenerate.GetCurrentLocation(TurningPoints, FlightPlanEditor, temptime);
-                currentLocation = location.Item1;
+                currentLocation = FXJHGenerate.GetCurrentLocationNew(TurningPoints, AllPath, temptime);
             
                 double3 aricraftPoint = new double3(currentLocation.CurrentLon,currentLocation.CurrentLat,currentLocation.CurrentHei);
             

+ 13 - 4
SimulationServer/Entity/Missions/XHRescueMission.cs

@@ -1,5 +1,6 @@
 using Cysharp.Threading.Tasks;
 using KYFramework;
+using Model;
 using MongoDB.Bson;
 using SimulationServer.Utils;
 
@@ -8,15 +9,14 @@ namespace SimulationServer;
 public class XHRescueMission : BaseMission
 {
 
-    // 火场点
-    public FireGround FireGround;
-
     public double tn;
     
     public bool IsRunning;
     public Action End;
     public double SimulationTime;
     
+    public XHTask XHTask;
+    
     public int ExcuteCount = 1;
     public int FailureTimes = 0;
    
@@ -32,7 +32,16 @@ public class XHRescueMission : BaseMission
         Log.Info($"{MissionId} 任务开始!");
         Aircrafts.ForEach(a => a.Start());
     }
-    
+
+    public override List<double[]> AddPoints()
+    {
+        List<double[]> points = new List<double[]>();
+
+        points.AddRange(XHTask.paramters[0].Poly);
+        
+        return points;
+    }
+
     public override void EndMission()
     {
         IsRunning = false;

+ 0 - 6
SimulationServer/EventHandler/CreateTaskEventHandler.cs

@@ -1,14 +1,9 @@
 using Cysharp.Threading.Tasks;
 using KYFramework;
 using Model;
-using MongoDB.Bson;
-using SimulationServer.Utils;
-using SimulationSingleServer.Utils;
-using Unity.Mathematics;
 
 namespace SimulationServer;
 
-
 [Event]
 public class CreateZCTaskEventHandler : AEvent<CreateZCTask>
 {
@@ -88,7 +83,6 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
         mission.MissionInformation = config.XHTask.missionInformation;
         FirePoint point = config.EditorConfig.firePoints.Find(f => f.FirePointId == config.XHTask.missionInformation.TargetPointId);
 
-        mission.FireGround = ComponentFactory.Create<FireGround, FirePoint>(point);
         for (int i = 0; i < config.XHTask.aircraftInfos.Length; i++)
         {
             //飞机参数