Browse Source

完成海上搜救任务集成

zansimple 8 months ago
parent
commit
12c21aa490

+ 2 - 2
Models/SimulationCommon/EquationHelper.cs

@@ -73,8 +73,8 @@ namespace MuShiApp
                 
                 System.Random ran = new System.Random();
                 double x = getx(aircraftPoint, targetPoint, course);
-                
-                double V = getVisibility(getCityName(targetPoint.x, targetPoint.y), DateTime.Now.ToString("yyyy-MM-dd HH"));
+
+                double V =  15;//getVisibility(getCityName(targetPoint.x, targetPoint.y), DateTime.Now.ToString("yyyy-MM-dd HH"));
                 
                 
                 if (V < 6)

+ 42 - 36
Models/SimulationCommon/SectorSearch.cs

@@ -24,67 +24,73 @@ public class SectorSearch
     }
 
     // 根据角度和距离移动点
-    private static LocationW MovePointByVectorAndAngle(double angle, double distance, LocationW startPoint, double[] vector)
+    private static Point MovePointByVectorAndAngle(double angle, double distance, Point startPoint, double[] vector)
     {
-        double vectorAngle = CalculateVectorAngle(vector) + angle;
-        return new LocationW
-        {
-            Lon = startPoint.Lon + distance * Math.Cos(vectorAngle),
-            Lat = startPoint.Lat + distance * Math.Sin(vectorAngle)
-        };
+        ///定义并输出新坐标点
+        Point finalPoint = new Point();
+        //计算已知向量与x轴正方向的夹角
+        double vectorAngle = CalculateVectorAngle(vector);
+        //计算目标点向量与x轴正方向的夹角
+        vectorAngle += angle;
+        //计算目标点向量夹角的正弦、余弦值
+        double vectorAngleSin = Math.Sin(vectorAngle);
+        double vectorAngleCos = Math.Cos(vectorAngle);
+        //ArrayList<Double> XY = new ArrayList<Double>();
+        finalPoint.lon = startPoint.lon + distance * vectorAngleCos;
+        finalPoint.lat = startPoint.lat + distance * vectorAngleSin;
+        return finalPoint;
     }
 
     // 主逻辑
-    public static List<Point> PerformSearch( double sweepWidth)
+    public static List<Point> sectorSearch(Point basePoint, double searchAngle, double sweepWidth)
     {
-        var boundaryPoints = new List<LocationW>();
-        var outputWaypoints = new List<Point>();
-
-        var basePoint = new LocationW();
-        var baseDir = new double[] { 0, 1 };
-        double searchAngle = 30;
-        // Console.WriteLine("输入搜索角度:");
-        // double searchAngle = double.Parse(Console.ReadLine());
-        //
-        // Console.WriteLine("输入扫描宽度:");
-        // double sweepWidth = double.Parse(Console.ReadLine());
+        List<Point> boundaryPoints = new List<Point>();
+        List<Point> outputWaypoints = new List<Point>();
 
-        double rs = sweepWidth / Math.Sin(searchAngle / 2);
+        double Angle = searchAngle * Math.PI / 180;
+        double[] baseDir = { 0, 1 };
 
         int numPoints = (int)(360 / searchAngle);
         boundaryPoints.Add(basePoint);
-
+        
+        double rs = sweepWidth / Math.Sin(searchAngle / 2);
+        
         for (int i = 0; i < numPoints; i++)
         {
-            var midpoint = MovePointByVectorAndAngle(i * searchAngle, rs, basePoint, baseDir);
+            Point midpoint = MovePointByVectorAndAngle(-i * Angle, rs, basePoint, baseDir);
             boundaryPoints.Add(midpoint);
-            midpoint.Lat = basePoint.Lat;
-            midpoint.Lon = basePoint.Lon;
+            midpoint.lat = basePoint.lat;
+            midpoint.lon = basePoint.lon;
         }
-
-        var num = new int[(int)(3 * (180 / searchAngle) + 1)];
+            
+        int[] num = new int[(int)(3 * (180 / searchAngle) + 1)];
         num[0] = 0;
         for (int i = 1, n = 1, m = 1; n < 3 * (180 / searchAngle); i += 2)
         {
+
             m = i;
-            num[n++] = m;
+            num[n] = m; n++;
             m = i + 1;
-            num[n++] = m;
+            num[n] = m; n++;
             m = 0;
-            num[n++] = m;
+            num[n] = m; n++;
             m = (int)(i + 1 + 180 / searchAngle);
-            num[n++] = m;
+            num[n] = m; n++;
             m = (int)(i + 180 / searchAngle);
-            num[n++] = m;
+            num[n] = m; n++;
             m = 0;
-            num[n++] = m;
+            num[n] = m; n++;
+            
         }
-
-        foreach (var index in num)
+        for (int i = 0; i < num.Length; i++)
         {
-            outputWaypoints.Add(new Point() { lat = boundaryPoints[index].Lat, lon = boundaryPoints[index].Lon });
+            Point p = new Point();
+            p.lat = boundaryPoints[num[i]].lat;
+            p.lon = boundaryPoints[num[i]].lon;
+            outputWaypoints.Add(p);
         }
-
+            
         return outputWaypoints;
+
     }
 }

+ 3 - 3
Models/SimulationCommon/TZFX.cs

@@ -26,7 +26,7 @@ public class TZFX
         double vectorAngleCos = Math.Cos(vectorAngle);
 
         finalPoint.lon = startPoint.lon + distance * vectorAngleCos;
-        finalPoint.lon = startPoint.lat + distance * vectorAngleSin;
+        finalPoint.lat = startPoint.lat + distance * vectorAngleSin;
         return finalPoint;
     }
 
@@ -41,9 +41,9 @@ public class TZFX
         outputWaypoints.Add(CP);
 
         double forwardDistance = 0;
-        Point midWaypoint = new Point { lat = CP.lat, lon = CP.lat };
+        Point midWaypoint = new Point { lat = CP.lat, lon = CP.lon };
 
-        for (int i = 1; forwardDistance <= a; i++)
+        for (int i = 1; forwardDistance < a/2; i++)
         {
             Point MovePoint1 = MovePointByVandA(0, i * sweepWidth, midWaypoint, leftdir);
             outputWaypoints.Add(MovePoint1);

+ 1 - 7
Models/SimulationCommon/temp_readNC.cs

@@ -7,7 +7,7 @@ using SimulationCommon;
 
 public class GetNCData
 {
-    public tempNCread tempreadNC;
+    public tempNCread tempreadNC = new tempNCread();
     //longitudeArray:经度一维数组;
     //latitudeArray:纬度一维数组;
     //tempArray:海面温度_24(时间)*7(纬度)*10(经度);
@@ -85,12 +85,6 @@ public class GetNCData
                 tempreadNC.latitudeArray = latitudeArray;
                 tempreadNC.longitudeArray = longitudeArray;
                 tempreadNC.tempArray = tempArray;
-
-                // Example: Print the first value of the array
-                Console.WriteLine("a value of tempArray: " + tempArray[15][3][2]);
-                Console.WriteLine("a value of longitudeArray: " + longitudeArray[0]);
-                Console.WriteLine("a value of latitudeArray: " + latitudeArray[0]);
-                //Console.WriteLine("a value of timeArray: " + timeArray[0]);
             }
         }
 

+ 21 - 21
SimulationServer/Component/SJStaticCapacityComponent.cs

@@ -6,41 +6,41 @@ namespace SimulationServer;
 public class SJStaticCapacity
 {
     // 初次出动准备时间
-    public string 初次出动准备时间;
+    public string 初次出动准备时间 = String.Empty;
     //再次补给时间
-    public string 再次补给时间;
+    public string 再次补给时间 = String.Empty;
     //舱内载荷
-    public string 舱内载荷;
+    public string 舱内载荷 = String.Empty;
     //机舱容量
-    public string 机舱容量;
+    public string 机舱容量 = String.Empty;
     //最大平飞速度
-    public string 最大平飞速度;
+    public string 最大平飞速度 = String.Empty;
     //巡航速度
-    public string 巡航速度;
+    public string 巡航速度 = String.Empty;
     //搜救速度
-    public string 搜救速度;
+    public string 搜救速度 = 60.ToString();
     //单人救助时间
-    public string 单人救助时间;
+    public string 单人救助时间 = String.Empty;
     //抗风等级
-    public string 抗风等级;
+    public string 抗风等级 = String.Empty;
     //抗浪等级
-    public string 抗浪等级;
+    public string 抗浪等级 = String.Empty;
     //起降距离
-    public string 起降距离;
+    public string 起降距离 = String.Empty;
     //夜间作业能力
-    public string 夜间作业能力;
+    public string 夜间作业能力 = String.Empty;
     //仪表飞行能力
-    public string 仪表飞行能力;
+    public string 仪表飞行能力 = String.Empty;
     //可靠性
-    public string 可靠性;
+    public string 可靠性 = String.Empty;
     //航程
-    public string 航程;
+    public string 航程 = String.Empty;
     //悬停相对耗油率
-    public string 悬停相对耗油率;
+    public string 悬停相对耗油率 = String.Empty;
     //最大悬停时间
-    public string 搜救相对耗油率;
+    public string 搜救相对耗油率 = String.Empty;
     //最大飞行时间
-    public string 有效探测距离;
+    public string 有效探测距离 = String.Empty;
 }
 public class SJStaticCapacityComponent : Component
 {
@@ -80,9 +80,9 @@ public class SJStaticCapacityComponent : Component
             { "再次补给时间/s", SJStaticCapacity.再次补给时间.ToString() },
             { "舱内载荷/kg", SJStaticCapacity.舱内载荷.ToString() },
             { "机舱容量/kg", SJStaticCapacity.机舱容量.ToString() },
-            { "最大平飞速度/m/s", SJStaticCapacity.最大平飞速度.ToString() },
-            { "巡航速度/m/s", SJStaticCapacity.巡航速度.ToString() },
-            { "搜救速度/m/s", SJStaticCapacity.搜救速度.ToString() },
+            { "最大平飞速度/km/h", SJStaticCapacity.最大平飞速度.ToString() },
+            { "巡航速度/km/h", SJStaticCapacity.巡航速度.ToString() },
+            { "搜救速度/km/h", SJStaticCapacity.搜救速度.ToString() },
             { "单人救助时间/s", SJStaticCapacity.单人救助时间.ToString() },
             { "抗风等级", SJStaticCapacity.抗风等级.ToString() },
             { "抗浪等级", SJStaticCapacity.抗浪等级.ToString() },

+ 28 - 25
SimulationServer/Component/SJTotalTaskPerformanceComponent.cs

@@ -4,14 +4,15 @@ namespace SimulationServer;
 
 public class SJTotalTaskPerformance
 {
-    public string 识别成功率;
     public string 任务准备时间;
-    public string 平均搜索时间;
-    public string 平均救助时间;
-    public string 总飞行时间;
-    public string 海情覆盖率;
     public string 任务成功率;
-    public string 人员存活率;
+    
+    // public string 识别成功率;
+    // public string 平均搜索时间;
+    // public string 平均救助时间;
+    // public string 总飞行时间;
+    // public string 海情覆盖率;
+    // public string 人员存活率;
 }
 
 public class SJTotalTaskPerformanceComponent : Component
@@ -23,27 +24,29 @@ public class SJTotalTaskPerformanceComponent : Component
         var mission = GetParent<SeaSJRescueMission>();
 
         float 识别成功率 = mission.aircrafts.FindAll(a => a.Success).Count / mission.aircrafts.Count;
-        SJTotalTaskPerformance.识别成功率 = 识别成功率 * 100 + "%";
+        //SJTotalTaskPerformance.识别成功率 = 识别成功率 * 100 + "%";
 
         double 任务准备时间 = 0;
-        double 平均搜索时间 = 0;
-        double 总飞行时间 = 0;
-        double 人员存活率 = 0;
+        // double 平均搜索时间 = 0;
+        // double 总飞行时间 = 0;
+        // double 人员存活率 = 0;
+        int 任务成功次数 = 0;
         foreach (var aircraft in mission.aircrafts)
         {
             任务准备时间 += aircraft.TaskReadyTime;
-            平均搜索时间 += aircraft.SearchTime;
-            总飞行时间 += aircraft.TotalTime;
-            人员存活率 += aircraft.Success ? 1 : 0;
+            // 平均搜索时间 += aircraft.SearchTime;
+            // 总飞行时间 += aircraft.TotalTime;
+            // 人员存活率 += aircraft.Success ? 1 : 0;
+            任务成功次数 += aircraft.Success ? 1 : 0;
         }
 
         SJTotalTaskPerformance.任务准备时间 = 任务准备时间.ToString();
-        SJTotalTaskPerformance.平均搜索时间 = (平均搜索时间 / mission.aircrafts.Count).ToString();
-        SJTotalTaskPerformance.平均救助时间 = 5.ToString();
-        SJTotalTaskPerformance.总飞行时间 = 总飞行时间.ToString();
-        SJTotalTaskPerformance.海情覆盖率 = "60%".ToString();
-        SJTotalTaskPerformance.任务成功率 = (人员存活率 / mission.aircrafts.Count).ToString();
-        SJTotalTaskPerformance.人员存活率 = (人员存活率 / mission.aircrafts.Count).ToString();
+        // SJTotalTaskPerformance.平均搜索时间 = (平均搜索时间 / mission.aircrafts.Count).ToString();
+        // SJTotalTaskPerformance.平均救助时间 = 5.ToString();
+        // SJTotalTaskPerformance.总飞行时间 = 总飞行时间.ToString();
+        // SJTotalTaskPerformance.海情覆盖率 = "60%".ToString();
+        SJTotalTaskPerformance.任务成功率 = (任务成功次数 / mission.aircrafts.Count).ToString();
+        //SJTotalTaskPerformance.人员存活率 = (人员存活率 / mission.aircrafts.Count).ToString();
     }
 
     public Dictionary<string, Dictionary<string, string>> GetReport()
@@ -51,14 +54,14 @@ public class SJTotalTaskPerformanceComponent : Component
         Dictionary<string, Dictionary<string, string>> report = new Dictionary<string, Dictionary<string, string>>();
         report["总任务表现"] = new Dictionary<string, string>
         {
-            { "识别成功率", SJTotalTaskPerformance.识别成功率.ToString() },
+            //{ "识别成功率", SJTotalTaskPerformance.识别成功率.ToString() },
             { "任务准备时间", SJTotalTaskPerformance.任务准备时间.ToString() },
-            { "平均搜索时间", SJTotalTaskPerformance.平均搜索时间.ToString() },
-            { "平均救助时间", SJTotalTaskPerformance.平均救助时间.ToString() },
-            { "总飞行时间", SJTotalTaskPerformance.总飞行时间.ToString() },
-            { "海情覆盖率", SJTotalTaskPerformance.海情覆盖率.ToString() },
+            //{ "平均搜索时间", SJTotalTaskPerformance.平均搜索时间.ToString() },
+            //{ "平均救助时间", SJTotalTaskPerformance.平均救助时间.ToString() },
+            //{ "总飞行时间", SJTotalTaskPerformance.总飞行时间.ToString() },
+            //{ "海情覆盖率", SJTotalTaskPerformance.海情覆盖率.ToString() },
             { "任务成功率", SJTotalTaskPerformance.任务成功率.ToString() },
-            { "人员存活率", SJTotalTaskPerformance.人员存活率.ToString() }
+            //{ "人员存活率", SJTotalTaskPerformance.人员存活率.ToString() }
         };
         return report;
     }

+ 1 - 0
SimulationServer/Component/TaskComponent.cs

@@ -11,6 +11,7 @@ public class TaskComponent : Component
     public List<MHRescueMission> MHRescueMissions;
     public List<XHRescueMission> XHRescueMissions;
     public List<ZCRescueMission> ZCRescueMissions;
+    
     public List<SeaSJRescueMission> SeaSJRescueMissions;
 
     public void Start()

+ 1 - 0
SimulationServer/Entity/AircraftEntity.cs

@@ -28,6 +28,7 @@ public class AircraftEntity : Entity
     public bool SyncOver { get; set; } // 是否同步完成
     
     public double[] Velocitys = new double[5]{220,220,220,110,0}; // 速度
+    
     public double[] FuelConsumptions = new double[5]{2800,2800,2800,1000,132}; // 燃油消耗
 
     public List<TurningPoint> TurningPoints = new List<TurningPoint>(); // 航路点

+ 84 - 56
SimulationServer/Entity/AircraftSJ.cs

@@ -25,8 +25,18 @@ public class AircraftSJ : AircraftEntity
     public SeaSouJiuTask taskContent;
     public bool Success = true; //本目标搜救是否成功
 
+    public override void Reset()
+    {
+        base.Reset();
+        IsOver = false;
+        isseefire = false;
+        Success = true;        
+    }
+
     public override void Start()
     {
+        Velocitys = new double[5] {220, 220, 60, 110, 0}; // 速度
+        
         //TODO 计算 AirRoute[]
         double[] initialPosition =
         {
@@ -71,19 +81,60 @@ public class AircraftSJ : AircraftEntity
 
         if (taskContent.SearchMode == "扇形搜索")
         {
-            waypoints = SectorSearch.PerformSearch(taskContent.SearchWidth);
+            // 求 points 的中心点
+            var startPoint1 = new Point
+            {
+                lat = points[0].lat/2 + points[1].lat/2,
+                lon = points[0].lon/2 + points[1].lon/2
+            };
+            var startPoint2 = new Point
+            {
+                lat = points[2].lat/2 + points[3].lat/2,
+                lon = points[2].lon/2 + points[3].lon/2
+            };
+            
+            var centerPoint = new Point
+            {
+                lat = startPoint1.lat/2 + startPoint2.lat/2,
+                lon = startPoint1.lon/2 + startPoint2.lon/2
+            };
+            
+            
+            waypoints = SectorSearch.sectorSearch(centerPoint, 30, taskContent.SearchWidth);
         }
 
         if (taskContent.SearchMode == "扩展矩形搜索")
         {
-            waypoints = TZFX.GenerateWaypoints(points[0], points[1], points[2], points[3], 20, taskContent.SearchWidth);
+            // 求 points 的中心点
+            var startPoint1 = new Point
+            {
+                lat = points[0].lat/2 + points[1].lat/2,
+                lon = points[0].lon/2 + points[1].lon/2
+            };
+            var startPoint2 = new Point
+            {
+                lat = points[2].lat/2 + points[3].lat/2,
+                lon = points[2].lon/2 + points[3].lon/2
+            };
+            
+            var centerPoint = new Point
+            {
+                lat = startPoint1.lat/2 + startPoint2.lat/2,
+                lon = startPoint1.lon/2 + startPoint2.lon/2
+            };
+            // 以 centerPoint 为中心,生成正方形区域
+            var lonD = Math.Abs(points[0].lon - points[1].lon);
+            var latD1 = Math.Abs(points[1].lat - points[2].lat);
+            var max = Math.Max(lonD, latD1);
+            
+            // 以 distance 为边长 以 centerPoint 为中心点的正方形
+            // 初始正方形的边长 为 矩形搜索区域短边的 1/5
+            var temp0 = new Point(centerPoint.lat + max/2, centerPoint.lon - max/2);
+            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.SearchWidth);
         }
-        Log.Info("===========================");
-        Log.Info( FlightPlanEditor.targetpoint[0].ToJson());
-        Log.Info("===========================");
-        Log.Info(points.ToJson());
-        Log.Info("===========================");
-        Log.Info(waypoints.ToJson());
         // List<Point> 转成 List<AirRoute>
         List<AirRoute> airRoutes = new List<AirRoute>();
         foreach (var item in waypoints)
@@ -94,11 +145,6 @@ public class AircraftSJ : AircraftEntity
                 AirRouteLongitude = item.lon
             });
         }
-
-        // var distance = Utils.Util.GetDistance(waypoints[0].lon,FlightPlanEditor.targetpoint[0].TargetPointLongitude, waypoints[0].lat,
-        //     FlightPlanEditor.targetpoint[0].TargetPointLatitude);
-        // var distance1 = Utils.Util.GetDistance(waypoints[0].lon,FlightPlanEditor.originbase.BaseLongitude, waypoints[0].lat,
-        //     FlightPlanEditor.originbase.BaseLatitude);
         
         FlightPlanEditor.airroute = airRoutes.ToArray();
 
@@ -127,7 +173,7 @@ public class AircraftSJ : AircraftEntity
             do
             {
                 (currentLocation, _) =
-                    FXJHGenerate.GetCurrentLocation(TurningPoints, FlightPlanEditor, temptime); // 获取飞机当前位置
+                    FXJHGenerate.GetAllCurrentLocation(TurningPoints, temptime); // 获取飞机当前位置
                 double3 aricraftPoint = new double3(currentLocation.CurrentLon, currentLocation.CurrentLat,
                     currentLocation.CurrentHei);
 
@@ -153,24 +199,6 @@ public class AircraftSJ : AircraftEntity
                     probability = helper.getProbability(aricraftPoint, targetPoint, currentLocation.CurrentCourse,
                         windSpeed, waveHigh, "落水人员", "海上"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
                 }
-                
-                
-                // probability = helper.getProbability(aricraftPoint, targetPoint, currentLocation.CurrentCourse,
-                //     windSpeed, waveHigh, "落水人员", "海上"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
-               
-                // if (taskContent.SearchMode == "雷达搜索")
-                // {
-                //     probability = DectionModel.Radar(taskContent.DetectionWavelength, taskContent.MinDetectionSignal, taskContent.RadarTransmitterPower,taskContent.TransmitAntennaGain, taskContent.ReceiveAntennaGain, taskContent.)
-                // }
-                //
-                // if (taskContent.SearchMode == "光电搜索")
-                // {
-                //     //搜寻目标相对搜救力量的侧向距离
-                //     probability = DectionModel.GuangDian(taskContent.OpticalTowerHorizontalRange,
-                //         taskContent.InfraredDetectorFieldAngle, taskContent.FlightHeight,,
-                //         FlightPlanEditor.cityweather.Visibility);
-                // }
-
 
                 finalProbability *= (1 - probability);
 
@@ -189,11 +217,10 @@ public class AircraftSJ : AircraftEntity
                     isseefire = false;
                 }
 
-                // if (temptime >= 7200) IsOver = true;
-
-                temptime += 1;
+                temptime += 10;
             } while (!isseefire && IsOver == false);
-
+            Console.WriteLine(
+                $"海上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到落水人员:{isseefire}");
             finalProbability = 1 - finalProbability;
 
             if (fireIndex != -1)
@@ -241,26 +268,27 @@ public class AircraftSJ : AircraftEntity
 
         TotalFuelConsumption = TurningPoints[0].RemainingFuel -
                                TurningPoints[TurningPoints.Count - 1].RemainingFuel;
-        // GetNCData getNCData = new GetNCData();
-        // getNCData.GetData();
-        //
-        // double time = TotalTime; //time——搜索时间,单位:秒;数据测试用
-        //
-        // double latitude = FlightPlanEditor.targetpoint[0].TargetPointLatitude; //落水人员纬度;数据测试用
-        // double longitude = FlightPlanEditor.targetpoint[0].TargetPointLongitude; //落水人员经度,数据测试用
-        //
-        // double survivalTime = SurvivalTimeModel.SurvivalTime(getNCData.tempreadNC, latitude, longitude, time); //幸存时间
-        //
-        //
-        //
-        // if (survivalTime > time)
-        // {
-        //     Success = true;
-        // }
-        // else
-        // {
-        //     Success = false;
-        // }
+        
+        
+        
+        GetNCData getNCData = new GetNCData();
+        getNCData.GetData();
+        
+        double time = TotalTime; //time——搜索时间,单位:秒;数据测试用
+        
+        double latitude = FlightPlanEditor.targetpoint[0].TargetPointLatitude; //落水人员纬度;数据测试用
+        double longitude = FlightPlanEditor.targetpoint[0].TargetPointLongitude; //落水人员经度,数据测试用
+        
+        double survivalTime = SurvivalTimeModel.SurvivalTime(getNCData.tempreadNC, latitude, longitude, time); //幸存时间
+        
+        if (survivalTime * 3600 > time)
+        {
+            Success = true;
+        }
+        else
+        {
+            Success = false;
+        }
     }
 }
 

+ 3 - 7
SimulationServer/Entity/SeaSJRescueMission.cs

@@ -30,6 +30,7 @@ public class SeaSJRescueMission : Entity
         
         SaveSJ();
         SaveTotalMH();
+        ReportSJ();
         Log.Info($"{MissionId} 任务结束!");
 
         // var readyTime = AircraftXHs.First().TaskReadyTime;
@@ -40,7 +41,7 @@ public class SeaSJRescueMission : Entity
     {
         foreach (AircraftSJ aircraftEntity in aircrafts)
         {
-            var staticCapacity = aircraftEntity.GetComponent<StaticCapacityComponent>();
+            var staticCapacity = aircraftEntity.GetComponent<SJStaticCapacityComponent>();
 
             if(staticCapacity == null) continue;
             
@@ -66,7 +67,7 @@ public class SeaSJRescueMission : Entity
         }
     }
     
-     public void SaveTotalMH()
+    public void SaveTotalMH()
     {
         var totalPerformance = GetComponent<SJTotalTaskPerformanceComponent>();
         totalPerformance.FillData();    
@@ -111,13 +112,8 @@ public class SeaSJRescueMission : Entity
                 values.Add(average.ToString("#0.00"));
             }
         }
-        
-        
         string totalPath = $"{path}/{"搜救任务总体指标报告"}.xls";
         DataTableExtensions.SaveToExcel(totalPath, totalReport,true);
-        
-        // string equicPath = $"{path}/{"装备体系评估报告"}.xls";
-        // DataTableExtensions.SaveToExcel(equicPath, equipReport);
     }
 }
 

+ 1 - 0
SimulationServer/Utils/Util.cs

@@ -24,6 +24,7 @@ public class Util
     }
     
     
+    
     /// <summary>
     /// 根据 shape 解析出 经纬度
     /// </summary>

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

@@ -1,58 +1,7 @@
 {
   "海上搜救任务": [
-    {
-      "任务信息": {
-        "任务名称": "海上搜救任务1",
-        "任务ID": "HSSJ1",
-        "任务主要类型": "航空搜救",
-        "任务类型": "海上搜救",
-        "开始日期": "2024年6月4日",
-        "开始时间": "00时00分00秒",
-        "结束日期": "2024年6月4日",
-        "结束时间": "23时00分00秒",
-        "起飞准备时间": 600.0,
-        "应用机型": [
-          "S-76"
-        ],
-        "应用飞机编号": [
-          "1-1"
-        ]
-      },
-      "目标点ID": 1,
-      "搜索任务载荷": "目视搜索",
-      "搜索方式": "平行线搜索",
-      "搜索扫视宽度": 0.2,
-      "下一个任务ID": ""
-    },
-    {
-      "任务信息": {
-        "任务名称": "海上搜救任务2",
-        "任务ID": "HSSJ2",
-        "任务主要类型": "航空搜救",
-        "任务类型": "海上搜救",
-        "开始日期": "2024年6月4日",
-        "开始时间": "00时00分00秒",
-        "结束日期": "2024年6月4日",
-        "结束时间": "23时00分00秒",
-        "起飞准备时间": 600.0,
-        "应用机型": [
-          "S-76"
-        ],
-        "应用飞机编号": [
-          "1-2"
-        ]
-      },
-      "目标点ID": 2,
-      "搜索任务载荷": "雷达搜索",
-      "探测波长(m)": 0.0001,
-      "最小可检测信号(dBm)": -65,
-      "雷达发射机发射信号功率(dBm)": 48,
-      "发射天线增益(dB)": 34,
-      "接受天线增益(dB)": 34,
-      "搜索方式": "扇形搜索",
-      "搜索扫视宽度": 0.2,
-      "下一个任务ID": ""
-    },
+   
+    
     {
       "任务信息": {
         "任务名称": "海上搜救任务3",