瀏覽代碼

修改editor和task文件,增加海上搜救任务总体指标报告显示内容

liyang 7 月之前
父節點
當前提交
9dbadbf4d8

+ 2 - 0
Models/SimulationCommon/EditorConfig.cs

@@ -61,6 +61,8 @@ public class TargetPoint//搜救目标点初始坐标
     public double TargetPointLatitude;
     [JsonProperty("目标点海拔")]
     public double TargetPointHeight;
+    //[JsonProperty("目标类型")]
+    //public double TargetType;
 
 }
 

+ 16 - 6
SimulationServer/Component/SJAllTotalTaskPerformance.cs

@@ -3,55 +3,65 @@
 public class SJAllTotalTaskPerformance
 {
     public string 识别成功率;
+    public string 任务准备时间;
     public string 平均搜索时间;
     public string 平均救助时间;
     public string 总飞行时间;
     public string 海情覆盖率;
+    public string 任务是否成功;
     public string 人员存活率;
 }
 
 public class SJAllTotalTaskPerformanceComponent
 {
     public SJAllTotalTaskPerformance SJAllTotalTaskPerformance = new SJAllTotalTaskPerformance();
-    
+
     public void FillData(List<SeaSJRescueMission> missions)
     {
         double 任务准备时间 = 0;
         double 平均搜索时间 = 0;
         double 总飞行时间 = 0;
         double 人员存活率 = 0;
+        double 任务是否成功 = 0;
         float 识别成功率 = missions.FindAll(a => a.Success).Count / missions.Count;
-        SJAllTotalTaskPerformance.识别成功率 = (识别成功率 * 100 ).ToString() ;
-        
+        SJAllTotalTaskPerformance.识别成功率 = (识别成功率 * 100).ToString();
+
         double aircreftCount = 0;
         foreach (SeaSJRescueMission mhRescueMission in missions)
         {
             foreach (var aircraft in mhRescueMission.aircrafts)
             {
-                任务准备时间 += aircraft.TaskReadyTime;
+                if (任务准备时间 < aircraft.TaskReadyTime)
+                    任务准备时间 = aircraft.TaskReadyTime;
                 平均搜索时间 += aircraft.SearchTime;
                 总飞行时间 += aircraft.TotalTime;
                 人员存活率 += aircraft.Success ? 1 : 0;
                 aircreftCount++;
             }
         }
+        if (人员存活率 != 0)
+            任务是否成功 = 1;
+        SJAllTotalTaskPerformance.任务准备时间 = 任务准备时间.ToString();
         SJAllTotalTaskPerformance.平均搜索时间 = (平均搜索时间 / aircreftCount).ToString();
         SJAllTotalTaskPerformance.平均救助时间 = 5.ToString();
         SJAllTotalTaskPerformance.总飞行时间 = 总飞行时间.ToString();
-        SJAllTotalTaskPerformance.海情覆盖率 = "60%".ToString();
+        SJAllTotalTaskPerformance.海情覆盖率 = "0.6".ToString();//"60%"
+        SJAllTotalTaskPerformance.任务是否成功 = 任务是否成功.ToString();
         SJAllTotalTaskPerformance.人员存活率 = (人员存活率 / aircreftCount).ToString();
     }
-    
+
     public Dictionary<string, Dictionary<string, string>> GetReport()
     {
         Dictionary<string, Dictionary<string, string>> report = new Dictionary<string, Dictionary<string, string>>();
         report["总任务表现"] = new Dictionary<string, string>
         {
             { "识别成功率", SJAllTotalTaskPerformance.识别成功率.ToString() },
+            { "任务准备时间", SJAllTotalTaskPerformance.任务准备时间.ToString() },
             { "平均搜索时间", SJAllTotalTaskPerformance.平均搜索时间.ToString() },
             { "平均救助时间", SJAllTotalTaskPerformance.平均救助时间.ToString() },
             { "总飞行时间", SJAllTotalTaskPerformance.总飞行时间.ToString() },
             { "海情覆盖率", SJAllTotalTaskPerformance.海情覆盖率.ToString() },
+            { "任务是否成功", SJAllTotalTaskPerformance.任务是否成功.ToString() },
             { "人员存活率", SJAllTotalTaskPerformance.人员存活率.ToString() }
         };
         return report;

+ 1 - 1
SimulationServer/Component/TaskComponent.cs

@@ -86,7 +86,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
 {
     public override void Update(TaskComponent self)
     {
-       if(self.SeaSJRescueMissions.Count < 0) return;
+       if(self.SeaSJRescueMissions.Count <= 0) return;
        
        if(self.SeaSJRescueMissions.All(m => m.IsOver))
        {

+ 24 - 18
SimulationServer/EventHandler/ServerStartEventHandler.cs

@@ -4,6 +4,7 @@ using Model;
 using Newtonsoft.Json;
 using SimulationServer.Utils;
 using SimulationSingleServer.Utils;
+using static Org.BouncyCastle.Math.EC.ECCurve;
 using Define = SimulationServer.Utils.Define;
 
 namespace SimulationServer;
@@ -20,32 +21,32 @@ public class ServerStartEventHandler : AEvent<ServerStart>
         // 读取任务配置文件
         string ec_path = "Missions/editor_config.json";
         string tc_path = "Missions/task_config.json";
-        
+
         if (!File.Exists(ec_path))
         {
             Log.Error("editor_config.json文件不存在!");
             return UniTask.CompletedTask;
         }
-        
+
         if (!File.Exists(tc_path))
-        { 
+        {
             Log.Error("task_config.json文件不存在!");
             return UniTask.CompletedTask;
         }
-        
+
         string ec_str = File.ReadAllText("Missions/editor_config.json");
         string tc_str = File.ReadAllText("Missions/task_config.json");
-        
+        Console.WriteLine(tc_str);
         EditorConfig? editorConfig = JsonConvert.DeserializeObject<EditorConfig>(ec_str);
         TaskConfig? taskConfig = JsonConvert.DeserializeObject<TaskConfig>(tc_str);
-        
-        if(editorConfig == null || taskConfig == null)
+
+        if (editorConfig == null || taskConfig == null)
         {
             Log.Error("配置文件解析失败!");
             return UniTask.CompletedTask;
         }
         //Weather weather = Util.GetWeather("内蒙古", "根河", DateTime.Now.ToString("2024-05-10"));
-        TaskComponent.Weather = new Weather(); 
+        TaskComponent.Weather = new Weather();
         var temp = TaskComponent.Weather.day_temp.Replace("°C", "");
         Define.TEMPERATURE = double.Parse(temp);
         var wind_temp = TaskComponent.Weather.day_wind_comp.Replace("级", "").Split('-');
@@ -56,32 +57,37 @@ public class ServerStartEventHandler : AEvent<ServerStart>
         foreach (var mhTask in taskConfig.mHTaskConfigs)
         {
             Game.EventSystem.Publish(new CreateMHTask
-                { EditorConfig = editorConfig, MHTaskConfig = mhTask });
+            { EditorConfig = editorConfig, MHTaskConfig = mhTask });
         }
-        
+
         // 创建侦察
         foreach (var zcTask in taskConfig.zCTask)
         {
             Game.EventSystem.Publish(new CreateZCTask
-                { EditorConfig = editorConfig, ZCTask = zcTask });
+            { EditorConfig = editorConfig, ZCTask = zcTask });
         }
-        
+
         // 创建巡护
         foreach (var xhTask in taskConfig.xHTask)
         {
             Game.EventSystem.Publish(new CreateXHTask
-                { EditorConfig = editorConfig, XHTask = xhTask });
+            { EditorConfig = editorConfig, XHTask = xhTask });
         }
-        
-        // 创建搜救
+        //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);
             Game.EventSystem.Publish(new CreateSeaSJTask
-                { EditorConfig = editorConfig, SeaSJTask = seaSJTask });
+            { EditorConfig = editorConfig, SeaSJTask = seaSJTask });
         }
-       
+
         taskSys.Start();
         return UniTask.CompletedTask;
     }
-    
+
 }

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

@@ -1,79 +1,83 @@
 {
-  "想定信息": {
-    "想定日期": "2024年6月4日",
-    "想定时间": "00时00分00秒"
-  },
-  "基地信息": [
-    {
-      "基地名称": "厦门救助飞行基地",
-      "基地编号": 1,
-      "基地经度": 118.143639,
-      "基地纬度": 24.545038,
-      "基地海拔": 13.0
+    "仿真次数": 100,
+    "想定信息": {
+        "想定日期": "2024年6月4日",
+        "想定时间": "00时00分00秒"
     },
-    {
-      "基地名称": "福州救助飞行基地",
-      "基地编号": 2,
-      "基地经度": 119.67513528,
-      "基地纬度": 25.92801134,
-      "基地海拔": 8.0
-    }
-  ],
-  "飞行器信息": [
-    {
-      "机型": "S-76",
-      "飞机编号": "1-1",
-      "类型": "飞机",
-      "子类型": "直升机",
-      "最大起飞重量": 4761.0,
-      "最大载油量": 750.0,
-      "最大载客数量": 16.0,
-      "所属机场ID": 1
+    "基地信息": [
+        {
+            "基地名称": "厦门救助飞行基地",
+            "基地编号": 1,
+            "基地经度": 118.143639,
+            "基地纬度": 24.545038,
+            "基地海拔": 13.0
+        },
+        {
+            "基地名称": "福州救助飞行基地",
+            "基地编号": 2,
+            "基地经度": 119.67513528,
+            "基地纬度": 25.92801134,
+            "基地海拔": 8.0
+        }
+    ],
+    "飞行器信息": [
+        {
+            "机型": "S-76",
+            "飞机编号": "1-1",
+            "类型": "飞机",
+            "子类型": "直升机",
+            "最大起飞重量": 4761.0,
+            "最大载油量": 750.0,
+            "最大载客数量": 16.0,
+            "所属机场ID": 1
+        },
+        {
+            "机型": "S-76",
+            "飞机编号": "1-2",
+            "类型": "飞机",
+            "子类型": "直升机",
+            "最大起飞重量": 4761.0,
+            "最大载油量": 750.0,
+            "最大载客数量": 16.0,
+            "所属机场ID": 1
+        },
+        {
+            "机型": "AW-189",
+            "飞机编号": "2-1",
+            "类型": "飞机",
+            "子类型": "直升机",
+            "最大起飞重量": 8600.0,
+            "最大载油量": 2000.0,
+            "最大载客数量": 19.0,
+            "所属机场ID": 2
+        }
+    ],
+    "天气信息": {
+        "温度": 18.0,
+        "能见度": 19.0,
+        "水温": 16.0
     },
-    {
-      "机型": "S-76",
-      "飞机编号": "1-2",
-      "类型": "飞机",
-      "子类型": "直升机",
-      "最大起飞重量": 4761.0,
-      "最大载油量": 750.0,
-      "最大载客数量": 16.0,
-      "所属机场ID": 1
-    },
-    {
-      "机型": "AW-189",
-      "飞机编号": "2-1",
-      "类型": "飞机",
-      "子类型": "直升机",
-      "最大起飞重量": 8600.0,
-      "最大载油量": 2000.0,
-      "最大载客数量": 19.0,
-      "所属机场ID": 2
-    }
-  ],
-  "天气信息": {
-    "温度": 18.0,
-    "能见度":19.0,
-    "水温":16.0
-  },
-  "搜救目标点初始坐标": [
-    {
-      "目标点ID": 1,
-      "目标点经度": 118.216667,
-      "目标点纬度": 24.150000,
-      "目标点海拔": 0.0
-    },
-    {
-      "目标点ID": 2,
-      "目标点经度": 118.251389,
-      "目标点纬度": 24.533333,
-      "目标点海拔": 0.0
-    },
-    {
-      "目标点ID": 3,
-      "目标点经度": 119.716667,
-      "目标点纬度": 25.766667,
-      "目标点海拔": 0.0
-    }
-  ]
+    "搜救目标点初始坐标": [
+        {
+            "目标点ID": 1,
+            "目标点经度": 118.216667,
+            "目标点纬度": 24.150000,
+            "目标点海拔": 0.0,
+            "目标类型": "落水人员"
+        },
+        {
+            "目标点ID": 2,
+            "目标点经度": 118.251389,
+            "目标点纬度": 24.533333,
+            "目标点海拔": 0.0,
+            "目标类型": "落水人员"
+        },
+        {
+            "目标点ID": 3,
+            "目标点经度": 119.716667,
+            "目标点纬度": 25.766667,
+            "目标点海拔": 0.0,
+            "目标类型": "落水人员"
+        }
+    ]
 }

+ 82 - 31
SimulationServer/bin/Debug/net7.0/Missions/task_config.json

@@ -1,33 +1,84 @@
 {
-  "海上搜救任务": [
-   
-    
-    {
-      "任务信息": {
-        "任务名称": "海上搜救任务3",
-        "任务ID": "HSSJ3",
-        "任务主要类型": "航空搜救",
-        "任务类型": "海上搜救",
-        "开始日期": "2024年6月4日",
-        "开始时间": "00时00分00秒",
-        "结束日期": "2024年6月4日",
-        "结束时间": "23时00分00秒",
-        "起飞准备时间": 600.0,
-        "应用机型": [
-          "AW-189"
-        ],
-        "应用飞机编号": [
-          "2-1"
-        ]
-      },
-      "目标点ID": 3,
-      "搜索任务载荷": "光电搜索",
-      "光电转塔水平范围": 90,
-      "红外探测器视场角": 60,
-      "飞行高度": 2,
-      "搜索方式": "扩展矩形搜索",
-      "搜索扫视宽度": 0.2,
-      "下一个任务ID": ""
-    }
-  ]
+    "海上搜救任务": [
+        {
+            "任务信息": {
+                "任务名称": "海上搜救任务1",
+                "任务ID": "HSSJ1",
+                "任务主要类型": "航空搜救",
+                "任务类型": "海上搜救",
+                "开始日期": "2024年6月4日",
+                "开始时间": "00时00分00秒",
+                "结束日期": "2024年6月4日",
+                "结束时间": "23时00分00秒",
+                "起飞准备时间": 600.0,
+                "应用机型": [
+                    "S-76"
+                ],
+                "应用飞机编号": [
+                    "1-1"
+                ]
+            },
+            "目标点ID": 1,
+            "搜索任务载荷": "目视搜索",
+            "搜索方式": "平行线搜索",
+            "搜索扫视宽度": 0.02,
+            "下一个任务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.02,
+            "下一个任务ID": ""
+        },
+        {
+            "任务信息": {
+                "任务名称": "海上搜救任务3",
+                "任务ID": "HSSJ3",
+                "任务主要类型": "航空搜救",
+                "任务类型": "海上搜救",
+                "开始日期": "2024年6月4日",
+                "开始时间": "00时00分00秒",
+                "结束日期": "2024年6月4日",
+                "结束时间": "23时00分00秒",
+                "起飞准备时间": 600.0,
+                "应用机型": [
+                    "AW-189"
+                ],
+                "应用飞机编号": [
+                    "2-1"
+                ]
+            },
+            "目标点ID": 3,
+            "搜索任务载荷": "光电搜索",
+            "光电转塔水平范围": 90,
+            "红外探测器视场角": 60,
+            "飞行高度": 2,
+            "搜索方式": "扩展矩形搜索",
+            "搜索扫视宽度": 0.02,
+            "下一个任务ID": ""
+        }
+    ]
 }

二進制
SimulationServer/bin/Debug/net7.0/Reports/SJ/2024-08-12/海上搜救任务总体指标报告.xls


二進制
SimulationServer/bin/Debug/net7.0/Reports/SJ/2024-08-12/海上搜索救援任务 海上搜救任务1/1-1搜救任务单机指标报告.xls


二進制
SimulationServer/bin/Debug/net7.0/Reports/SJ/2024-08-12/海上搜索救援任务 海上搜救任务1/搜救任务总体指标报告.xls


二進制
SimulationServer/bin/Debug/net7.0/Reports/SJ/2024-08-12/海上搜索救援任务 海上搜救任务2/1-2搜救任务单机指标报告.xls


二進制
SimulationServer/bin/Debug/net7.0/Reports/SJ/2024-08-12/海上搜索救援任务 海上搜救任务2/搜救任务总体指标报告.xls


二進制
SimulationServer/bin/Debug/net7.0/Reports/SJ/2024-08-12/海上搜索救援任务 海上搜救任务3/2-1搜救任务单机指标报告.xls


二進制
SimulationServer/bin/Debug/net7.0/Reports/SJ/2024-08-12/海上搜索救援任务 海上搜救任务3/搜救任务总体指标报告.xls