Explorar o código

修改配置文件及陆上搜寻飞机脚本

liyang hai 7 meses
pai
achega
0f2a89eab8

+ 44 - 1
SimulationServer/Entity/AircraftLandSJ.cs

@@ -39,7 +39,50 @@ public class AircraftLandSJ : AircraftEntity
     {
         Velocitys = new double[5] { 220, 220, 60, 110, 0 }; // 速度
 
-        List<double[]> route = ContourSearch.ContourSearch1(SearchMissionMode.Poly, SearchMissionMode.interval,SearchMissionMode.MinLength, SearchMissionMode.TrueH, SearchMissionMode.JG, ContourSearch.DemHelper());
+
+        List<double[]> route = new List<double[]>();
+
+        if (SearchMissionMode.SearchMode == "扇形搜索")
+        {
+            List<double[]> trajectory = new List<double[]>();
+            foreach (var item in SearchMissionMode.Poly)
+            {
+                trajectory.Add(new double[]
+                {
+                    item[1],item[0]
+                }) ;
+            }
+
+            var points = SeaSJ.getminEnclosingRect(trajectory);
+            var startPoint1 = new Point
+            {
+                lat = points[0][0] / 2 + points[1][0] / 2,
+                lon = points[0][1] / 2 + points[1][1] / 2
+            };
+            var startPoint2 = new Point
+            {
+                lat = points[2][0] / 2 + points[3][0] / 2,
+                lon = points[2][1] / 2 + points[3][1] / 2
+            };
+
+            var centerPoint = new Point
+            {
+                lat = startPoint1.lat / 2 + startPoint2.lat / 2,
+                lon = startPoint1.lon / 2 + startPoint2.lon / 2
+            };
+            List<Point> temp = SectorSearch.sectorSearch(centerPoint, 30, SearchMissionMode.SearchWidth);
+            foreach (Point point in temp)
+            {
+                route.Add(new double[]
+                {
+                    point.lat, point.lon,
+                });
+            }
+        }
+        else if (SearchMissionMode.SearchMode == "等高线搜索")
+        {
+            route = ContourSearch.ContourSearch1(SearchMissionMode.Poly, SearchMissionMode.interval, SearchMissionMode.MinLength, SearchMissionMode.TrueH, SearchMissionMode.JG, ContourSearch.DemHelper());
+        }
 
         // route 转成 List<AirRoute>
         List<AirRoute> airRoutes = new List<AirRoute>();

+ 11 - 11
SimulationServer/EventHandler/ServerStartEventHandler.cs

@@ -97,17 +97,17 @@ public class ServerStartEventHandler : AEvent<ServerStart>
         }
         //Console.WriteLine("taskConfig.seaSouJiuTasks.Count:" + taskConfig.seaSouJiuTasks.Count);
         //创建搜救
-        foreach (var seaSJTask in taskConfig.seaSouJiuTasks)
-        {
-            //Console.WriteLine("seaSJTask.missionInformation.MissionName:" + seaSJTask.missionInformation.MissionName);
-            //Console.WriteLine("TargetPointId:" + seaSJTask.TargetPointId);
-            //Console.WriteLine("SearchPayload:" + seaSJTask.SearchPayload);
-            //Console.WriteLine("SearchMode:" + seaSJTask.SearchMode);
-            //Console.WriteLine("RadarTransmitterPower:" + seaSJTask.RadarTransmitterPower);
-            //Console.WriteLine("仿真次数:" + editorConfig.runCounts);
-            Game.EventSystem.Publish(new CreateSeaSJTask
-            { EditorConfig = editorConfig, SeaSJTask = seaSJTask });
-        }
+        //foreach (var seaSJTask in taskConfig.seaSouJiuTasks)
+        //{
+        //    //Console.WriteLine("seaSJTask.missionInformation.MissionName:" + seaSJTask.missionInformation.MissionName);
+        //    //Console.WriteLine("TargetPointId:" + seaSJTask.TargetPointId);
+        //    //Console.WriteLine("SearchPayload:" + seaSJTask.SearchPayload);
+        //    //Console.WriteLine("SearchMode:" + seaSJTask.SearchMode);
+        //    //Console.WriteLine("RadarTransmitterPower:" + seaSJTask.RadarTransmitterPower);
+        //    //Console.WriteLine("仿真次数:" + editorConfig.runCounts);
+        //    Game.EventSystem.Publish(new CreateSeaSJTask
+        //    { EditorConfig = editorConfig, SeaSJTask = seaSJTask });
+        //}
 
         foreach (var landSXTask in taskConfig.LandSouXunTasks)
         {

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

@@ -156,8 +156,8 @@
     "搜救目标点初始坐标": [
         {
             "目标点ID": 1,
-            "目标点经度": 118.216667,
-            "目标点纬度": 24.150000,
+            "目标点经度": 101,
+            "目标点纬度": 30.15,
             "目标点海拔": 0.0,
             "目标类型": {
                 "类型": "遇险人员"

BIN=BIN
SimulationServer/bin/Debug/net7.0/SimulationServer.dll


BIN=BIN
SimulationServer/bin/Debug/net7.0/SimulationServer.exe


BIN=BIN
SimulationServer/bin/Debug/net7.0/SimulationServer.pdb