瀏覽代碼

修改部分代码

liyang 7 月之前
父節點
當前提交
3d16a842f6

+ 1 - 1
Models/SimulationCommon/EditorConfig.cs

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

+ 19 - 19
SimulationServer/Entity/LandSJRescueMission.cs

@@ -18,7 +18,7 @@ public class LandSJRescueMission : Entity
     // <sheet,<指标名,值列表>>
     public Dictionary<string, Dictionary<string, List<string>>> totalReport = new();
 
-    public Dictionary<string, Dictionary<string, List<string>>> aircraftSJDatas = new();
+    public Dictionary<string, Dictionary<string, List<string>>> aircraftLandSJDatas = new();
 
     public bool IsOver = false;
 
@@ -55,13 +55,13 @@ public class LandSJRescueMission : Entity
         {
             SaveSJ();
             //SaveTotalMH();
-            SaveAircraftSJDatas();
+            SaveAircraftLandSJDatas();
         }
 
         if (currentExecuteCount == ExecutionContext)
         {
             SaveSJ();
-            SaveAircraftSJDatas();
+            SaveAircraftLandSJDatas();
             //SaveTotalMH();
             ReportSJ();
             //this.StartAsyncMH();
@@ -79,29 +79,29 @@ public class LandSJRescueMission : Entity
         // Task.Delay(TimeSpan.FromSeconds(readyTime)).ContinueWith(t => this.StartAsyncXH());
     }
 
-    public void SaveAircraftSJDatas()
+    public void SaveAircraftLandSJDatas()
     {
         foreach (AircraftLandSJ aircraftEntity in aircrafts)
         {
             string key = aircraftEntity.AircraftId;
-            if (!aircraftSJDatas.ContainsKey(key))
+            if (!aircraftLandSJDatas.ContainsKey(key))
             {
-                aircraftSJDatas[key] = new Dictionary<string, List<string>>();
+                aircraftLandSJDatas[key] = new Dictionary<string, List<string>>();
             }
-            if (!aircraftSJDatas[key].ContainsKey("识别成功率"))
-                aircraftSJDatas[key]["识别成功率"] = new List<string>();
+            if (!aircraftLandSJDatas[key].ContainsKey("识别成功率"))
+                aircraftLandSJDatas[key]["识别成功率"] = new List<string>();
             //aircraftSJDatas[key]["识别成功率"].Add(aircraftEntity.isseePerson ? "1" : "0");
-            if (!aircraftSJDatas[key].ContainsKey("任务准备时间"))
-                aircraftSJDatas[key]["任务准备时间"] = new List<string>();
-            aircraftSJDatas[key]["任务准备时间"].Add(aircraftEntity.TaskReadyTime.ToString());
-            if (!aircraftSJDatas[key].ContainsKey("平均搜索时间"))
-                aircraftSJDatas[key]["平均搜索时间"] = new List<string>();
-            aircraftSJDatas[key]["平均搜索时间"].Add(aircraftEntity.SearchTime.ToString());
-            if (!aircraftSJDatas[key].ContainsKey("总飞行时间"))
-                aircraftSJDatas[key]["总飞行时间"] = new List<string>();
-            aircraftSJDatas[key]["总飞行时间"].Add(aircraftEntity.TotalTime.ToString());
-            if (!aircraftSJDatas[key].ContainsKey("人员存活率"))
-                aircraftSJDatas[key]["人员存活率"] = new List<string>();
+            if (!aircraftLandSJDatas[key].ContainsKey("任务准备时间"))
+                aircraftLandSJDatas[key]["任务准备时间"] = new List<string>();
+            aircraftLandSJDatas[key]["任务准备时间"].Add(aircraftEntity.TaskReadyTime.ToString());
+            if (!aircraftLandSJDatas[key].ContainsKey("平均搜索时间"))
+                aircraftLandSJDatas[key]["平均搜索时间"] = new List<string>();
+            aircraftLandSJDatas[key]["平均搜索时间"].Add(aircraftEntity.SearchTime.ToString());
+            if (!aircraftLandSJDatas[key].ContainsKey("总飞行时间"))
+                aircraftLandSJDatas[key]["总飞行时间"] = new List<string>();
+            aircraftLandSJDatas[key]["总飞行时间"].Add(aircraftEntity.TotalTime.ToString());
+            if (!aircraftLandSJDatas[key].ContainsKey("人员存活率"))
+                aircraftLandSJDatas[key]["人员存活率"] = new List<string>();
             //aircraftSJDatas[key]["人员存活率"].Add(aircraftEntity.Success ? "1" : "0");
         }
     }

+ 2 - 2
SimulationServer/EventHandler/CreateTaskEventHandler.cs

@@ -257,7 +257,7 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSJTask>
         taskSys.LandSJRescueMissions.Add(mission);
         mission.MissionId = $"陆上搜索救援任务 {config.LandSJTask.missionInformation.MissionName}";
         mission.ExecutionContext = config.EditorConfig.runCounts;
-        mission.AddComponent<SJTotalTaskPerformanceComponent>(); // Land
+        //mission.AddComponent<SJTotalTaskPerformanceComponent>();
         for (int i = 0; i < config.LandSJTask.missionInformation.AircraftInfos.Length; i++)
         {
             //飞机参数
@@ -276,7 +276,7 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSJTask>
             mission.aircrafts.Add(aircraft);
             aircraft.taskContent = config.LandSJTask;
             aircraft.AircraftId = config.LandSJTask.missionInformation.AircraftId[i];
-            aircraft.AddComponent<SJStaticCapacityComponent>();
+            aircraft.AddComponent<SJStaticCapacityComponent>(); // 陆上搜救是否需要新建SJStaticCapacityComponent?
             Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
         }