瀏覽代碼

修改配置文件格式及对应代码

liyang 7 月之前
父節點
當前提交
bb4e5dcc28

+ 5 - 4
SimulationServer/Entity/AircraftLandSJ.cs

@@ -21,6 +21,7 @@ public class AircraftLandSJ : AircraftEntity
     public bool isseePerson = false;
 
     public MissionEndPoint MissionEndPoint;
+    public SearchMissionMode SearchMissionMode;
 
     public override void Reset()
     {
@@ -34,8 +35,8 @@ public class AircraftLandSJ : AircraftEntity
     {
         Velocitys = new double[5] { 220, 220, 60, 110, 0 }; // 速度
 
-        List<double[]> route = ContourSearch.ContourSearch1(taskContent.SearchMode.Poly, taskContent.SearchMode.interval,
-            taskContent.SearchMode.MinLength, taskContent.SearchMode.TrueH, taskContent.SearchMode.JG, ContourSearch.DemHelper());
+        List<double[]> route = ContourSearch.ContourSearch1(SearchMissionMode.Poly, SearchMissionMode.interval,
+            SearchMissionMode.MinLength, SearchMissionMode.TrueH, SearchMissionMode.JG, ContourSearch.DemHelper());
 
 
         // route 转成 List<AirRoute>
@@ -91,8 +92,8 @@ public class AircraftLandSJ : AircraftEntity
                 if (distance < 20)
                 {
                     //TODO 和学生对接确认, 发现概率算法
-                    probability = helper.getProbability(aricraftPoint, targetPoint, currentLocation.CurrentCourse,
-                        windSpeed, waveHigh, "落水人员", "海上"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
+                    //probability = helper.getProbability(aricraftPoint, targetPoint, currentLocation.CurrentCourse,
+                    //    windSpeed, waveHigh, "落水人员", "海上"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
                 }
 
 

+ 2 - 1
SimulationServer/Entity/AircraftSHJ.cs

@@ -7,6 +7,7 @@ namespace SimulationServer;
 public class AircraftSHJ : AircraftEntity
 {
     public SHJTask content;
+    public SHJParameter SHJParameter;
     public override void End()
     {
         TotalFuelConsumption = TurningPoints[0].RemainingFuel - TurningPoints[^1].RemainingFuel;
@@ -15,7 +16,7 @@ public class AircraftSHJ : AircraftEntity
     public override void Start()
     {
         FXJHGenerate.FromStartToMission(FlightPlanEditor,ref TurningPoints);//生成从起点到任务段起点的航路点
-        double resulttime = Cable_slippage.get_result_time_rope(content.H,content.person_number,content.windspeed,content.vis,content.descendspeed).time;//索滑降模型输出的索滑降时间
+        double resulttime = Cable_slippage.get_result_time_rope(SHJParameter.H, SHJParameter.person_number, SHJParameter.windspeed, SHJParameter.vis, SHJParameter.descendspeed).time;//索滑降模型输出的索滑降时间
         FXJHGenerate.SuoHuaJiang(resulttime, FlightPlanEditor,ref TurningPoints);
         FXJHGenerate.FromMissionToEnd(FlightPlanEditor, FXJHGenerate.SuoHuaJiangMissionEndPoint(FlightPlanEditor),ref TurningPoints);
         FXJHGenerate.FXJHTPDiedai(FlightPlanEditor,ref TurningPoints, Velocitys, FuelConsumptions);

+ 11 - 9
SimulationServer/Entity/AircraftSJ.cs

@@ -25,6 +25,8 @@ public class AircraftSJ : AircraftEntity
     public SeaSouJiuTask taskContent;
     public bool Success = true; //本目标搜救是否成功
     public GetNCData getNCData;
+
+    public SearchMissionMode SearchMode;
     public override void Reset()
     {
         base.Reset();
@@ -76,12 +78,12 @@ public class AircraftSJ : AircraftEntity
             FlightPlanEditor.originbase.BaseLongitude);
         List<Point> waypoints = new List<Point>();
         //*******
-        if (taskContent.SearchMode.SearchMode == "平行线搜索")
+        if (SearchMode.SearchMode == "平行线搜索")
         {
-            waypoints = ParallellineSearch.parallellineSearch(basePoint, points, taskContent.SearchMode.SearchWidth);
+            waypoints = ParallellineSearch.parallellineSearch(basePoint, points, SearchMode.SearchWidth);
         }
 
-        if (taskContent.SearchMode.SearchMode == "扇形搜索")
+        if (SearchMode.SearchMode == "扇形搜索")
         {
             // 求 points 的中心点
             var startPoint1 = new Point
@@ -100,10 +102,10 @@ public class AircraftSJ : AircraftEntity
                 lat = startPoint1.lat / 2 + startPoint2.lat / 2,
                 lon = startPoint1.lon / 2 + startPoint2.lon / 2
             };
-            waypoints = SectorSearch.sectorSearch(centerPoint, 30, taskContent.SearchMode.SearchWidth);
+            waypoints = SectorSearch.sectorSearch(centerPoint, 30, SearchMode.SearchWidth);
         }
 
-        if (taskContent.SearchMode.SearchMode == "扩展矩形搜索")
+        if (SearchMode.SearchMode == "扩展矩形搜索")
         {
             // 求 points 的中心点
             var startPoint1 = new Point
@@ -133,7 +135,7 @@ public class AircraftSJ : AircraftEntity
             var temp1 = new Point(centerPoint.lat + max / 2, centerPoint.lon + max / 2);
             var temp2 = new Point(centerPoint.lat - max / 2, centerPoint.lon + max / 2);
             var temp3 = new Point(centerPoint.lat - max / 2, centerPoint.lon - max / 2);
-            waypoints = TZFX.GenerateWaypoints(temp0, temp1, temp2, temp3, max, taskContent.SearchMode.SearchWidth);
+            waypoints = TZFX.GenerateWaypoints(temp0, temp1, temp2, temp3, max, SearchMode.SearchWidth);
         }
         // List<Point> 转成 List<AirRoute>
         List<AirRoute> airRoutes = new List<AirRoute>();
@@ -202,13 +204,13 @@ public class AircraftSJ : AircraftEntity
                         windSpeed, waveHigh, "落水人员", "海上"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
                 }
 
-                //finalProbability *= (1 - probability);
+                finalProbability *= (1 - probability);
 
                 Console.WriteLine(
                     $"海上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到落水人员:{isseePerson}");
 
                 double randomValue = random.NextDouble(); // 生成随机数比较概率
-                if (randomValue < (probability))
+                if (randomValue < (1 - finalProbability))
                 {
                     isseePerson = true;
                     this.isseePerson = true;
@@ -227,7 +229,7 @@ public class AircraftSJ : AircraftEntity
             Console.WriteLine(
                 $"海上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到落水人员:{isseePerson},人员是否幸存:{Success}");
 
-            //finalProbability = 1 - finalProbability;
+            finalProbability = 1 - finalProbability;
 
             if (fireIndex != -1)
             {

+ 6 - 4
SimulationServer/Entity/AircraftZC.cs

@@ -13,11 +13,13 @@ public class AircraftZC : AircraftEntity
     public double[] Velocitys = new double[5]{220,220,220,110,0}; // 速度
     public double[] FuelConsumptions = new double[5]{2800,2800,2800,1000,132}; // 燃油消耗
     public double time;
-    
+
+    public ZCMethod ZCMethod;
+
     public override void Start()
     {
         FXJHGenerate.FromStartToMission(FlightPlanEditor,ref TurningPoints);//生成从起点到任务段起点的航路点
-        SC01 = GeDianShengCheng.scanroute(content.poly,content.ScanRange,content.hSC,content.isRealHeight,content.isSurround,content.SurroundNum,GeDianShengCheng.DemHelper());//侦查模型输出的航路点位置
+        SC01 = GeDianShengCheng.scanroute(ZCMethod.Poly, ZCMethod.ScanRange, ZCMethod.hSC, ZCMethod.isRealHeight, ZCMethod.isSurround, ZCMethod.SurroundNum,GeDianShengCheng.DemHelper());//侦查模型输出的航路点位置
         FXJHGenerate.ZhenCha(SC01, FlightPlanEditor,ref TurningPoints);
         FXJHGenerate.FromMissionToEnd(FlightPlanEditor, FXJHGenerate.ZhenChaMissionEndPoint(SC01),ref TurningPoints);
         FXJHGenerate.FXJHTPDiedai(FlightPlanEditor,ref TurningPoints, Velocitys, FuelConsumptions);
@@ -40,8 +42,8 @@ public class AircraftZCAwakeSystem : AwakeSystem<AircraftZC,FlightPlanEditor,ZCT
         self.content = zcTask;
         self.FlightPlanEditor = flightPlanEditor;
         self.missionId = zcTask.missionInformation.MissionName;
-        self.AircraftId = zcTask.missionInformation.aircraftInfos[index].AircraftId;
-        self.Name = zcTask.missionInformation.aircraftInfos[index].AircraftType;
+        self.AircraftId = zcTask.aircraftInfos[index].AircraftId;
+        self.Name = zcTask.aircraftInfos[index].AircraftType;
         self.TaskReadyTime = zcTask.missionInformation.TakeoffPreparationTime;
     }
 }

+ 66 - 31
SimulationServer/EventHandler/CreateTaskEventHandler.cs

@@ -37,12 +37,12 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
         foreach (MHTask mhTask in config.MHTaskConfig.mHTask)
         {
             Log.Info($"创建灭火任务 : {mhTask.missionInformation.MissionName}");
-            if (mhTask.missionInformation.aircraftInfos == null) continue;
-            for (int i = 0; i < mhTask.missionInformation.aircraftInfos.Length; i++)
+            if (mhTask.aircraftInfos == null) continue;
+            for (int i = 0; i < mhTask.aircraftInfos.Length; i++)
             {
                 //飞机参数
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                    a => a.AircraftID == mhTask.missionInformation.aircraftInfos[i].AircraftType);
+                    a => a.AircraftID == mhTask.aircraftInfos[i].AircraftType);
                 //基地
                 var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 
@@ -51,8 +51,8 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
 
                 AircraftMH aircraft = ComponentFactory.Create<AircraftMH, FlightPlanEditor>(flightPlanEditor);
 
-                aircraft.Name = mhTask.missionInformation.aircraftInfos[i].AircraftType;
-                aircraft.AircraftId = mhTask.missionInformation.aircraftInfos[i].AircraftId;
+                aircraft.Name = mhTask.aircraftInfos[i].AircraftType;
+                aircraft.AircraftId = mhTask.aircraftInfos[i].AircraftId;
 
                 aircraft.fireGround = fireGround;
                 aircraft.mhRescueMission = mission;
@@ -71,12 +71,12 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
         foreach (DMMHTask dmmhTask in config.MHTaskConfig.dMMHTask)
         {
             Log.Info($"创建地面灭火任务 : {dmmhTask.missionInformation.MissionName}");
-            if (dmmhTask.missionInformation.aircraftInfos == null) continue;
-            for (int i = 0; i < dmmhTask.missionInformation.aircraftInfos.Length; i++)
+            if (dmmhTask.aircraftInfos == null) continue;
+            for (int i = 0; i < dmmhTask.aircraftInfos.Length; i++)
             {
                 //飞机参数
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                    a => a.AircraftID == dmmhTask.missionInformation.aircraftInfos[i].AircraftType);
+                    a => a.AircraftID == dmmhTask.aircraftInfos[i].AircraftType);
                 //基地
                 var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 
@@ -85,7 +85,7 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
 
                 AircraftMHWithPersion aircraftWithPerson = ComponentFactory.Create<AircraftMHWithPersion, FlightPlanEditor>(flightPlanEditor);
                 mission.End += aircraftWithPerson.End;
-                aircraftWithPerson.Name = dmmhTask.missionInformation.aircraftInfos[i].AircraftType;
+                aircraftWithPerson.Name = dmmhTask.aircraftInfos[i].AircraftType;
                 aircraftWithPerson.fireGround = fireGround;
                 aircraftWithPerson.mhRescueMission = mission;
                 aircraftWithPerson.GroundPersonnel = (int)dmmhTask.GroundPersonnel;
@@ -93,7 +93,7 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
                 aircraftWithPerson.NextMissionId = dmmhTask.NextTaskId;
                 aircraftWithPerson.TaskName = dmmhTask.missionInformation.MissionName;
                 aircraftWithPerson.TaskReadyTime = dmmhTask.missionInformation.TakeoffPreparationTime;
-                aircraftWithPerson.AircraftId = dmmhTask.missionInformation.aircraftInfos[i].AircraftId;
+                aircraftWithPerson.AircraftId = dmmhTask.aircraftInfos[i].AircraftId;
 
                 mission.aircrafts.Add(aircraftWithPerson);
                 Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
@@ -103,22 +103,38 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
         foreach (SHJTask shjTask in config.MHTaskConfig.sHJTask)
         {
             Log.Info($"创建索滑降任务 : {shjTask.missionInformation.MissionName}");
-            if (shjTask.missionInformation.aircraftInfos == null) continue;
-            for (int i = 0; i < shjTask.missionInformation.aircraftInfos.Length; i++)
+            if (shjTask.aircraftInfos == null) continue;
+            for (int i = 0; i < shjTask.aircraftInfos.Length; i++)
             {
                 //飞机参数
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                    a => a.AircraftID == shjTask.missionInformation.aircraftInfos[i].AircraftType);
+                    a => a.AircraftID == shjTask.aircraftInfos[i].AircraftType);
                 //基地
                 var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 
+                MissionPoint missionPoint = null;
+                foreach (var item in shjTask.SHJParameters)
+                {
+                    if (aircraftParameter.Id == item.AircraftId)
+                        missionPoint = item.MissionPoints[0];
+                }
                 //创建飞行计划编辑器
-                var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, shjTask.MissionPoints[0], new[] { point });
+                var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, missionPoint, new[] { point });
 
                 AircraftSHJ aircraftSHJ = ComponentFactory.Create<AircraftSHJ, FlightPlanEditor, SHJTask>(flightPlanEditor, shjTask);
                 mission.End += aircraftSHJ.End;
-                aircraftSHJ.AircraftId = shjTask.missionInformation.aircraftInfos[i].AircraftId;
+                aircraftSHJ.AircraftId = shjTask.aircraftInfos[i].AircraftId;
                 aircraftSHJ.TaskReadyTime = shjTask.missionInformation.TakeoffPreparationTime;
+                foreach (var item in config.MHTaskConfig.sHJTask)
+                {
+                    foreach (var item1 in item.SHJParameters)
+                    {
+                        if (aircraftSHJ.AircraftId == item1.AircraftId)
+                        {
+                            aircraftSHJ.SHJParameter = item1;
+                        }
+                    }
+                }
                 mission.aircrafts.Add(aircraftSHJ);
                 Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
             }
@@ -139,11 +155,11 @@ public class CreateZCTaskEventHandler : AEvent<CreateZCTask>
 
         FirePoint point = config.EditorConfig.firePoints.Find(f => f.FirePointId == config.ZCTask.FirePointId);
 
-        for (int i = 0; i < config.ZCTask.missionInformation.aircraftInfos.Length; i++)
+        for (int i = 0; i < config.ZCTask.aircraftInfos.Length; i++)
         {
             //飞机参数
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                a => a.AircraftID == config.ZCTask.missionInformation.aircraftInfos[i].AircraftType);
+                a => a.AircraftID == config.ZCTask.aircraftInfos[i].AircraftType);
             //基地
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 
@@ -157,6 +173,14 @@ public class CreateZCTaskEventHandler : AEvent<CreateZCTask>
             aircraft.AddComponent<TaskPerformanceComponent>();
             aircraft.AddComponent<EconomicalComponent>();
             aircraft.TaskReadyTime = config.ZCTask.missionInformation.TakeoffPreparationTime;
+            aircraft.AircraftId = config.ZCTask.aircraftInfos[i].AircraftId;
+            foreach (var item in config.ZCTask.ZCMethods)
+            {
+                if(aircraft.AircraftId == item.AircraftId)
+                {
+                    aircraft.ZCMethod = item;
+                }
+            }
             Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
             mission.AircraftZCs.Add(aircraft);
         }
@@ -182,11 +206,11 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
         FirePoint point = config.EditorConfig.firePoints.Find(f => f.FirePointId == config.XHTask.FirePointId);
 
         mission.FireGround = ComponentFactory.Create<FireGround, FirePoint>(point);
-        for (int i = 0; i < config.XHTask.missionInformation.aircraftInfos.Length; i++)
+        for (int i = 0; i < config.XHTask.aircraftInfos.Length; i++)
         {
             //飞机参数
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                a => a.AircraftID == config.XHTask.missionInformation.aircraftInfos[i].AircraftType);
+                a => a.AircraftID == config.XHTask.aircraftInfos[i].AircraftType);
             //基地
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 
@@ -216,13 +240,13 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
             var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, airRoutes, config.XHTask.MissionPoints[0], new[] { point });
 
             AircraftXH aircraft = ComponentFactory.Create<AircraftXH, FlightPlanEditor, string, string>(flightPlanEditor,
-                config.XHTask.missionInformation.aircraftInfos[i].AircraftType, config.XHTask.missionInformation.aircraftInfos[i].AircraftId);
+                config.XHTask.aircraftInfos[i].AircraftType, config.XHTask.aircraftInfos[i].AircraftId);
 
             aircraft.TaskReadyTime = config.XHTask.missionInformation.TakeoffPreparationTime;
 
 
 
-            Log.Info($"Name:{config.XHTask.missionInformation.MissionName} AircraftId:{config.XHTask.missionInformation.aircraftInfos[i].AircraftId}");
+            Log.Info($"Name:{config.XHTask.missionInformation.MissionName} AircraftId:{config.XHTask.aircraftInfos[i].AircraftId}");
 
             mission.AircraftXHs.Add(aircraft);
 
@@ -247,26 +271,31 @@ public class CreateSeaSJEventHandler : AEvent<CreateSeaSJTask>
         mission.MissionId = $"海上搜索救援任务 {config.SeaSJTask.missionInformation.MissionName}";
         mission.ExecutionContext = config.EditorConfig.runCounts;
         mission.AddComponent<SJTotalTaskPerformanceComponent>();
-        for (int i = 0; i < config.SeaSJTask.missionInformation.aircraftInfos.Length; i++)
+        for (int i = 0; i < config.SeaSJTask.aircraftInfos.Length; i++)
         {
             //飞机参数
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                a => a.AircraftID == config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftType);
+                a => a.AircraftID == config.SeaSJTask.aircraftInfos[i].AircraftType);
             //基地
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 
-            TargetPoint targetPoint = config.EditorConfig.targetPoints.Find(t => t.TargetPointId == config.SeaSJTask.TargetPointId);
+            TargetPoint targetPoint = config.EditorConfig.targetPoints.Find(t => t.TargetPointId == config.SeaSJTask.missionInformation.TargetPointId);
             //创建飞行计划编辑器
             var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, new TargetPoint[] { targetPoint });
 
 
 
             AircraftSJ aircraft = ComponentFactory.Create<AircraftSJ, FlightPlanEditor>(flightPlanEditor);
-            aircraft.Name = config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftType;
+            aircraft.Name = config.SeaSJTask.aircraftInfos[i].AircraftType;
             aircraft.TaskReadyTime = config.SeaSJTask.missionInformation.TakeoffPreparationTime;
             mission.aircrafts.Add(aircraft);
             aircraft.taskContent = config.SeaSJTask;
-            aircraft.AircraftId = config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftId;
+            aircraft.AircraftId = config.SeaSJTask.aircraftInfos[i].AircraftId;
+            foreach (var item in config.SeaSJTask.SearchModes)
+            {
+                if (aircraft.AircraftId == item.AircraftId)
+                    aircraft.SearchMode = item;
+            }
             aircraft.AddComponent<SJStaticCapacityComponent>();
             Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
         }
@@ -286,24 +315,24 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSXTask>
         mission.MissionId = $"陆上搜索救援任务 {config.LandSXTask.missionInformation.MissionName}";
         mission.ExecutionContext = config.EditorConfig.runCounts;
         //mission.AddComponent<SJTotalTaskPerformanceComponent>();
-        for (int i = 0; i < config.LandSXTask.missionInformation.aircraftInfos.Length; i++)
+        for (int i = 0; i < config.LandSXTask.aircraftInfos.Length; i++)
         {
             //飞机参数
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                a => a.AircraftID == config.LandSXTask.missionInformation.aircraftInfos[i].AircraftType);
+                a => a.AircraftID == config.LandSXTask.aircraftInfos[i].AircraftType);
             //基地
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 
-            TargetPoint targetPoint = config.EditorConfig.targetPoints.Find(t => t.TargetPointId == config.LandSXTask.TargetPointId);
+            TargetPoint targetPoint = config.EditorConfig.targetPoints.Find(t => t.TargetPointId == config.LandSXTask.missionInformation.TargetPointId);
             //创建飞行计划编辑器
             var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, new TargetPoint[] { targetPoint });
 
             AircraftLandSJ aircraft = ComponentFactory.Create<AircraftLandSJ, FlightPlanEditor>(flightPlanEditor);
-            aircraft.Name = config.LandSXTask.missionInformation.aircraftInfos[i].AircraftType;
+            aircraft.Name = config.LandSXTask.aircraftInfos[i].AircraftType;
             aircraft.TaskReadyTime = config.LandSXTask.missionInformation.TakeoffPreparationTime;
             mission.aircrafts.Add(aircraft);
             aircraft.taskContent = config.LandSXTask;
-            aircraft.AircraftId = config.LandSXTask.missionInformation.aircraftInfos[i].AircraftId;
+            aircraft.AircraftId = config.LandSXTask.aircraftInfos[i].AircraftId;
             aircraft.MissionEndPoint = new MissionEndPoint
             {
                 MissionEndPointLongitude = targetPoint.TargetPointLongitude,
@@ -311,6 +340,12 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSXTask>
                 MissionEndPointHeight = targetPoint.TargetPointHeight
             };
 
+            foreach (var item in config.LandSXTask.SearchModes)
+            {
+                if (item.AircraftId == aircraft.AircraftId)
+                    aircraft.SearchMissionMode = item;
+            }
+
             aircraft.AddComponent<SJStaticCapacityComponent>(); // 陆上搜救是否需要新建SJStaticCapacityComponent?
             Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
         }

+ 5 - 5
SimulationServer/EventHandler/ServerStartEventHandler.cs

@@ -109,11 +109,11 @@ public class ServerStartEventHandler : AEvent<ServerStart>
             { EditorConfig = editorConfig, SeaSJTask = seaSJTask });
         }
 
-        foreach (var landSXTask in taskConfig.LandSouXunTasks)
-        {
-            Game.EventSystem.Publish(new CreateLandSXTask
-            { EditorConfig = editorConfig, LandSXTask = landSXTask });
-        }
+        //foreach (var landSXTask in taskConfig.LandSouXunTasks)
+        //{
+        //    Game.EventSystem.Publish(new CreateLandSXTask
+        //    { EditorConfig = editorConfig, LandSXTask = landSXTask });
+        //}
 
         taskSys.ExecutionContext = editorConfig.runCounts;
         taskSys.Start();

+ 1 - 1
SimulationServer/bin/Debug/net7.0/Missions/editor_config.json

@@ -1,5 +1,5 @@
 {
-    "仿真次数": 10,
+    "仿真次数": 3,
     "想定信息": {
         "想定日期": "2024年6月4日",
         "想定时间": "00时00分00秒"

+ 34 - 26
SimulationServer/bin/Debug/net7.0/Missions/task_config.json

@@ -378,20 +378,24 @@
             "运行约束": {
                 "搜索飞行速度限制": 150
             },
-            "搜索任务载荷": {
-                "任务载荷": "雷达搜索",
-                "应用飞机编号": "3-2",
-                "探测波长(m)": 0.0001,
-                "最小可检测信号(dBm)": -65,
-                "雷达发射机发射信号功率(dBm)": 48,
-                "发射天线增益(dB)": 34,
-                "接受天线增益(dB)": 34
-            },
-            "搜索方式": {
-                "搜索方式": "扇形搜索",
-                "应用飞机编号": "3-2",
-                "搜索扫视宽度": 0.02
-            }
+            "搜索任务载荷": [
+                {
+                    "任务载荷": "雷达搜索",
+                    "应用飞机编号": "3-2",
+                    "探测波长(m)": 0.0001,
+                    "最小可检测信号(dBm)": -65,
+                    "雷达发射机发射信号功率(dBm)": 48,
+                    "发射天线增益(dB)": 34,
+                    "接受天线增益(dB)": 34
+                }
+            ],
+            "搜索方式": [
+                {
+                    "搜索方式": "扇形搜索",
+                    "应用飞机编号": "3-2",
+                    "搜索扫视宽度": 0.02
+                }
+            ]
         },
         {
             "任务信息": {
@@ -430,18 +434,22 @@
             "运行约束":{
                 "搜索飞行速度限制": 150
             },
-            "搜索任务载荷": {
-                "任务载荷": "光电搜索",
-                "应用飞机编号": "4-1",
-                "光电转塔水平范围": 90,
-                "红外探测器视场角": 60,
-                "飞行高度": 2
-            },
-            "搜索方式": {
-                "搜索方式": "平行线搜索",
-                "应用飞机编号": "4-1",
-                "搜索扫视宽度": 0.02
-            }
+            "搜索任务载荷": [
+                {
+                    "任务载荷": "光电搜索",
+                    "应用飞机编号": "4-1",
+                    "光电转塔水平范围": 90,
+                    "红外探测器视场角": 60,
+                    "飞行高度": 2
+                }
+            ],
+            "搜索方式": [
+                {
+                    "搜索方式": "平行线搜索",
+                    "应用飞机编号": "4-1",
+                    "搜索扫视宽度": 0.02
+                }
+            ]
         }
     ],
     "索滑降救援任务": [