Browse Source

根据配置文件修改对应脚本

liyang 7 months ago
parent
commit
0c71767121

+ 2 - 2
Models/SimulationCommon/EditorConfig.cs

@@ -5,8 +5,8 @@ public class Base
 {
 {
     [JsonProperty("基地名称")]
     [JsonProperty("基地名称")]
     public string BaseName;
     public string BaseName;
-    [JsonProperty("数据库读取")]
-    public string isReadDB;
+    [JsonProperty("位置信息")]
+    public string BasePositionInfo;
     [JsonProperty("基地编号")]
     [JsonProperty("基地编号")]
     public int BaseId;
     public int BaseId;
     [JsonProperty("基地经度")]
     [JsonProperty("基地经度")]

+ 36 - 47
Models/SimulationCommon/TaskConfig.cs

@@ -12,19 +12,40 @@ public class MissionInformation
     public string MissionMainType;
     public string MissionMainType;
     [JsonProperty("任务类型")]
     [JsonProperty("任务类型")]
     public string MissionType;
     public string MissionType;
+    [JsonProperty("任务触发器")]
+    public string MissionTrigger;
+    [JsonProperty("开始日期")]
+    public string StartDate;
     [JsonProperty("开始时间")]
     [JsonProperty("开始时间")]
     public string StartTime;
     public string StartTime;
+    [JsonProperty("结束日期")]
+    public string EndDate;
     [JsonProperty("结束时间")]
     [JsonProperty("结束时间")]
     public string EndTime;
     public string EndTime;
     [JsonProperty("起飞准备时间")]
     [JsonProperty("起飞准备时间")]
     public double TakeoffPreparationTime;
     public double TakeoffPreparationTime;
+    [JsonProperty("停止搜索时间")]
+    public double EndSearchTime;
+    [JsonProperty("任务结束条件")]
+    public string TaskEndConditions;
+    [JsonProperty("应用航空器")]
+    public AircraftInfos[] aircraftInfos;
+}
+public class AircraftInfos
+{
     [JsonProperty("应用机型")]
     [JsonProperty("应用机型")]
-    public string[] AircraftInfos;
+    public string AircraftType;
     [JsonProperty("应用飞机编号")]
     [JsonProperty("应用飞机编号")]
-    public string[] AircraftId;
+    public string AircraftId;
+    [JsonProperty("加油基地")]
+    public string RefuelingBase;
+    [JsonProperty("加油基地编号")]
+    public string RefuelingBaseId;
+    [JsonProperty("任务结束返回点")]
+    public string TaskEndReturnPoint;
 }
 }
 
 
-public class MissionPoint 
+public class MissionPoint
 {
 {
     [JsonProperty("任务点经度")]
     [JsonProperty("任务点经度")]
     public double MissionPointLongitude;
     public double MissionPointLongitude;
@@ -121,12 +142,12 @@ public class XHTask
 
 
 public class MHTask
 public class MHTask
 {
 {
-   [JsonProperty("任务信息")]
-   public MissionInformation missionInformation;
-   [JsonProperty("取水点")]
-   public MissionPoint[] MissionPoints;
-   [JsonProperty("下一个任务ID")]
-   public string NextTaskId;
+    [JsonProperty("任务信息")]
+    public MissionInformation missionInformation;
+    [JsonProperty("取水点")]
+    public MissionPoint[] MissionPoints;
+    [JsonProperty("下一个任务ID")]
+    public string NextTaskId;
 }
 }
 
 
 public class SeaSouJiuTask
 public class SeaSouJiuTask
@@ -135,43 +156,11 @@ public class SeaSouJiuTask
     public MissionInformation missionInformation;
     public MissionInformation missionInformation;
     [JsonProperty("目标点ID")]
     [JsonProperty("目标点ID")]
     public int TargetPointId;
     public int TargetPointId;
-    //搜索任务载荷
     [JsonProperty("搜索任务载荷")]
     [JsonProperty("搜索任务载荷")]
-    public string SearchPayload;
-    
-    //搜索方式
+    public SearchMissionPayload missionSearchPayload;
     [JsonProperty("搜索方式")]
     [JsonProperty("搜索方式")]
-    public string SearchMode;
-    //搜索扫视宽度
-    [JsonProperty("搜索扫视宽度")]
-    public double SearchWidth;
-    
-    //探测波长(m)
-    [JsonProperty("探测波长(m)")]
-    public double DetectionWavelength;
-    //最小可检测信号(dBm)
-    [JsonProperty("最小可检测信号(dBm)")]
-    public double MinDetectionSignal;
-    //雷达发射机发射信号功率(dBm)
-    [JsonProperty("雷达发射机发射信号功率(dBm)")]
-    public double RadarTransmitterPower;
-    //发射天线增益(dB)
-    [JsonProperty("发射天线增益(dB)")]
-    public double TransmitAntennaGain;
-    //接受天线增益(dB)
-    [JsonProperty("接受天线增益(dB)")]
-    public double ReceiveAntennaGain;
-    //光电转塔水平范围
-    [JsonProperty("光电转塔水平范围")]
-    public double OpticalTowerHorizontalRange;
-    //红外探测器视场角
-    [JsonProperty("红外探测器视场角")]
-    public double InfraredDetectorFieldAngle;
-    //飞行高度
-    [JsonProperty("飞行高度")]
-    public double FlightHeight;
-    
-    [JsonProperty("下一个任务ID")]
+    public SearchMissionMode SearchMode;
+   [JsonProperty("下一个任务ID")]
     public string NextTaskId;
     public string NextTaskId;
 }
 }
 
 
@@ -213,7 +202,7 @@ public class SearchMissionMode //搜索方式
     [JsonProperty("搜索扫视宽度")]
     [JsonProperty("搜索扫视宽度")]
     public double SearchWidth;
     public double SearchWidth;
     [JsonProperty("多边形边界")]
     [JsonProperty("多边形边界")]
-    public List<List<float>> ContourHeightInterval;
+    public List<double[]> poly;
     [JsonProperty("等高线高度间隔")]
     [JsonProperty("等高线高度间隔")]
     public double PolygonalBoundary;
     public double PolygonalBoundary;
     [JsonProperty("最小等高线节点数")]
     [JsonProperty("最小等高线节点数")]
@@ -289,9 +278,9 @@ public class MHTaskConfig
 public class TaskConfig
 public class TaskConfig
 {
 {
     [JsonProperty("灭火任务")]
     [JsonProperty("灭火任务")]
-    public List<MHTaskConfig>mHTaskConfigs = new List<MHTaskConfig>();
+    public List<MHTaskConfig> mHTaskConfigs = new List<MHTaskConfig>();
     [JsonProperty("火场侦查任务")]
     [JsonProperty("火场侦查任务")]
-    public List<ZCTask>zCTask= new List<ZCTask>();
+    public List<ZCTask> zCTask = new List<ZCTask>();
     [JsonProperty("防火巡护任务")]
     [JsonProperty("防火巡护任务")]
     public List<XHTask> xHTask = new List<XHTask>();
     public List<XHTask> xHTask = new List<XHTask>();
     [JsonProperty("海上搜救任务")]
     [JsonProperty("海上搜救任务")]

+ 6 - 6
SimulationServer/Entity/AircraftSJ.cs

@@ -76,12 +76,12 @@ public class AircraftSJ : AircraftEntity
             FlightPlanEditor.originbase.BaseLongitude);
             FlightPlanEditor.originbase.BaseLongitude);
         List<Point> waypoints = new List<Point>();
         List<Point> waypoints = new List<Point>();
         //*******
         //*******
-        if (taskContent.SearchMode == "平行线搜索")
+        if (taskContent.SearchMode.SearchMode == "平行线搜索")
         {
         {
-            waypoints = ParallellineSearch.parallellineSearch(basePoint, points, taskContent.SearchWidth);
+            waypoints = ParallellineSearch.parallellineSearch(basePoint, points, taskContent.SearchMode.SearchWidth);
         }
         }
 
 
-        if (taskContent.SearchMode == "扇形搜索")
+        if (taskContent.SearchMode.SearchMode == "扇形搜索")
         {
         {
             // 求 points 的中心点
             // 求 points 的中心点
             var startPoint1 = new Point
             var startPoint1 = new Point
@@ -100,10 +100,10 @@ public class AircraftSJ : AircraftEntity
                 lat = startPoint1.lat / 2 + startPoint2.lat / 2,
                 lat = startPoint1.lat / 2 + startPoint2.lat / 2,
                 lon = startPoint1.lon / 2 + startPoint2.lon / 2
                 lon = startPoint1.lon / 2 + startPoint2.lon / 2
             };
             };
-            waypoints = SectorSearch.sectorSearch(centerPoint, 30, taskContent.SearchWidth);
+            waypoints = SectorSearch.sectorSearch(centerPoint, 30, taskContent.SearchMode.SearchWidth);
         }
         }
 
 
-        if (taskContent.SearchMode == "扩展矩形搜索")
+        if (taskContent.SearchMode.SearchMode == "扩展矩形搜索")
         {
         {
             // 求 points 的中心点
             // 求 points 的中心点
             var startPoint1 = new Point
             var startPoint1 = new Point
@@ -133,7 +133,7 @@ public class AircraftSJ : AircraftEntity
             var temp1 = 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 temp2 = new Point(centerPoint.lat - max / 2, centerPoint.lon + max / 2);
             var temp3 = 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);
+            waypoints = TZFX.GenerateWaypoints(temp0, temp1, temp2, temp3, max, taskContent.SearchMode.SearchWidth);
         }
         }
         // List<Point> 转成 List<AirRoute>
         // List<Point> 转成 List<AirRoute>
         List<AirRoute> airRoutes = new List<AirRoute>();
         List<AirRoute> airRoutes = new List<AirRoute>();

+ 2 - 2
SimulationServer/Entity/AircraftZC.cs

@@ -40,8 +40,8 @@ public class AircraftZCAwakeSystem : AwakeSystem<AircraftZC,FlightPlanEditor,ZCT
         self.content = zcTask;
         self.content = zcTask;
         self.FlightPlanEditor = flightPlanEditor;
         self.FlightPlanEditor = flightPlanEditor;
         self.missionId = zcTask.missionInformation.MissionName;
         self.missionId = zcTask.missionInformation.MissionName;
-        self.AircraftId = zcTask.missionInformation.AircraftId[index];
-        self.Name = zcTask.missionInformation.AircraftInfos[index];
+        self.AircraftId = zcTask.missionInformation.aircraftInfos[index].AircraftId;
+        self.Name = zcTask.missionInformation.aircraftInfos[index].AircraftType;
         self.TaskReadyTime = zcTask.missionInformation.TakeoffPreparationTime;
         self.TaskReadyTime = zcTask.missionInformation.TakeoffPreparationTime;
     }
     }
 }
 }

+ 28 - 28
SimulationServer/EventHandler/CreateTaskEventHandler.cs

@@ -37,12 +37,12 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
         foreach (MHTask mhTask in config.MHTaskConfig.mHTask)
         foreach (MHTask mhTask in config.MHTaskConfig.mHTask)
         {
         {
             Log.Info($"创建灭火任务 : {mhTask.missionInformation.MissionName}");
             Log.Info($"创建灭火任务 : {mhTask.missionInformation.MissionName}");
-            if(mhTask.missionInformation.AircraftInfos == null) continue;
-            for (int i = 0; i < mhTask.missionInformation.AircraftInfos.Length; i++)
+            if(mhTask.missionInformation.aircraftInfos == null) continue;
+            for (int i = 0; i < mhTask.missionInformation.aircraftInfos.Length; i++)
             {
             {
                 //飞机参数
                 //飞机参数
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                    a => a.AircraftID == mhTask.missionInformation.AircraftInfos[i]);
+                    a => a.AircraftID == mhTask.missionInformation.aircraftInfos[i].AircraftType);
                 //基地
                 //基地
                 var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
                 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);
                 AircraftMH aircraft = ComponentFactory.Create<AircraftMH, FlightPlanEditor>( flightPlanEditor);
                 
                 
-                aircraft.Name = mhTask.missionInformation.AircraftInfos[i];
-                aircraft.AircraftId = mhTask.missionInformation.AircraftId[i];
+                aircraft.Name = mhTask.missionInformation.aircraftInfos[i].AircraftType;
+                aircraft.AircraftId = mhTask.missionInformation.aircraftInfos[i].AircraftId;
                 
                 
                 aircraft.fireGround = fireGround;
                 aircraft.fireGround = fireGround;
                 aircraft.mhRescueMission = mission;
                 aircraft.mhRescueMission = mission;
@@ -71,12 +71,12 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
         foreach (DMMHTask dmmhTask in config.MHTaskConfig.dMMHTask)
         foreach (DMMHTask dmmhTask in config.MHTaskConfig.dMMHTask)
         {
         {
             Log.Info($"创建地面灭火任务 : {dmmhTask.missionInformation.MissionName}");
             Log.Info($"创建地面灭火任务 : {dmmhTask.missionInformation.MissionName}");
-            if(dmmhTask.missionInformation.AircraftInfos == null) continue;
-            for (int i = 0; i < dmmhTask.missionInformation.AircraftInfos.Length; i++)
+            if(dmmhTask.missionInformation.aircraftInfos == null) continue;
+            for (int i = 0; i < dmmhTask.missionInformation.aircraftInfos.Length; i++)
             {
             {
                 //飞机参数
                 //飞机参数
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                    a => a.AircraftID == dmmhTask.missionInformation.AircraftInfos[i]);
+                    a => a.AircraftID == dmmhTask.missionInformation.aircraftInfos[i].AircraftType);
                 //基地
                 //基地
                 var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
                 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);
                 AircraftMHWithPersion aircraftWithPerson = ComponentFactory.Create<AircraftMHWithPersion, FlightPlanEditor>( flightPlanEditor);
                 mission.End += aircraftWithPerson.End;
                 mission.End += aircraftWithPerson.End;
-                aircraftWithPerson.Name = dmmhTask.missionInformation.AircraftInfos[i];
+                aircraftWithPerson.Name = dmmhTask.missionInformation.aircraftInfos[i].AircraftType;
                 aircraftWithPerson.fireGround = fireGround;
                 aircraftWithPerson.fireGround = fireGround;
                 aircraftWithPerson.mhRescueMission = mission;
                 aircraftWithPerson.mhRescueMission = mission;
                 aircraftWithPerson.GroundPersonnel = (int)dmmhTask.GroundPersonnel;
                 aircraftWithPerson.GroundPersonnel = (int)dmmhTask.GroundPersonnel;
@@ -93,7 +93,7 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
                 aircraftWithPerson.NextMissionId = dmmhTask.NextTaskId;
                 aircraftWithPerson.NextMissionId = dmmhTask.NextTaskId;
                 aircraftWithPerson.TaskName = dmmhTask.missionInformation.MissionName;
                 aircraftWithPerson.TaskName = dmmhTask.missionInformation.MissionName;
                 aircraftWithPerson.TaskReadyTime = dmmhTask.missionInformation.TakeoffPreparationTime;
                 aircraftWithPerson.TaskReadyTime = dmmhTask.missionInformation.TakeoffPreparationTime;
-                aircraftWithPerson.AircraftId = dmmhTask.missionInformation.AircraftId[i];
+                aircraftWithPerson.AircraftId = dmmhTask.missionInformation.aircraftInfos[i].AircraftId;
                 
                 
                 mission.aircrafts.Add(aircraftWithPerson);
                 mission.aircrafts.Add(aircraftWithPerson);
                 Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
                 Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
@@ -103,12 +103,12 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
         foreach (SHJTask shjTask in config.MHTaskConfig.sHJTask)
         foreach (SHJTask shjTask in config.MHTaskConfig.sHJTask)
         {
         {
             Log.Info($"创建索滑降任务 : {shjTask.missionInformation.MissionName}");
             Log.Info($"创建索滑降任务 : {shjTask.missionInformation.MissionName}");
-            if(shjTask.missionInformation.AircraftInfos == null) continue;
-            for (int i = 0; i < shjTask.missionInformation.AircraftInfos.Length; i++)
+            if(shjTask.missionInformation.aircraftInfos == null) continue;
+            for (int i = 0; i < shjTask.missionInformation.aircraftInfos.Length; i++)
             {
             {
                 //飞机参数
                 //飞机参数
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                    a => a.AircraftID == shjTask.missionInformation.AircraftInfos[i]);
+                    a => a.AircraftID == shjTask.missionInformation.aircraftInfos[i].AircraftType);
                 //基地
                 //基地
                 var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
                 var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
             
             
@@ -117,7 +117,7 @@ public class CreateMHTaskEventHandler : AEvent<CreateMHTask>
 
 
                 AircraftSHJ aircraftSHJ = ComponentFactory.Create<AircraftSHJ, FlightPlanEditor,SHJTask>( flightPlanEditor, shjTask);
                 AircraftSHJ aircraftSHJ = ComponentFactory.Create<AircraftSHJ, FlightPlanEditor,SHJTask>( flightPlanEditor, shjTask);
                 mission.End += aircraftSHJ.End;
                 mission.End += aircraftSHJ.End;
-                aircraftSHJ.AircraftId = shjTask.missionInformation.AircraftId[i];
+                aircraftSHJ.AircraftId = shjTask.missionInformation.aircraftInfos[i].AircraftId;
                 aircraftSHJ.TaskReadyTime = shjTask.missionInformation.TakeoffPreparationTime;
                 aircraftSHJ.TaskReadyTime = shjTask.missionInformation.TakeoffPreparationTime;
                 mission.aircrafts.Add(aircraftSHJ);
                 mission.aircrafts.Add(aircraftSHJ);
                 Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
                 Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
@@ -139,11 +139,11 @@ public class CreateZCTaskEventHandler : AEvent<CreateZCTask>
         
         
         FirePoint point = config.EditorConfig.firePoints.Find(f => f.FirePointId == config.ZCTask.FirePointId);
         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.missionInformation.aircraftInfos.Length; i++)
         {
         {
             //飞机参数
             //飞机参数
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                a => a.AircraftID == config.ZCTask.missionInformation.AircraftInfos[i]);
+                a => a.AircraftID == config.ZCTask.missionInformation.aircraftInfos[i].AircraftType);
             //基地
             //基地
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
             
             
@@ -182,11 +182,11 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
         FirePoint point = config.EditorConfig.firePoints.Find(f => f.FirePointId == config.XHTask.FirePointId);
         FirePoint point = config.EditorConfig.firePoints.Find(f => f.FirePointId == config.XHTask.FirePointId);
 
 
         mission.FireGround = ComponentFactory.Create<FireGround, FirePoint>(point);
         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.missionInformation.aircraftInfos.Length; i++)
         {
         {
             //飞机参数
             //飞机参数
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                a => a.AircraftID == config.XHTask.missionInformation.AircraftInfos[i]);
+                a => a.AircraftID == config.XHTask.missionInformation.aircraftInfos[i].AircraftType);
             //基地
             //基地
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
             
             
@@ -216,13 +216,13 @@ public class CreateXHTaskEventHandler : AEvent<CreateXHTask>
             var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather,originBase,airRoutes,config.XHTask.MissionPoints[0], new []{point});
             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,
             AircraftXH aircraft = ComponentFactory.Create<AircraftXH, FlightPlanEditor,string,string>( flightPlanEditor,
-                config.XHTask.missionInformation.AircraftInfos[i],config.XHTask.missionInformation.AircraftId[i]);
+                config.XHTask.missionInformation.aircraftInfos[i].AircraftType,config.XHTask.missionInformation.aircraftInfos[i].AircraftId);
      
      
             aircraft.TaskReadyTime = config.XHTask.missionInformation.TakeoffPreparationTime;
             aircraft.TaskReadyTime = config.XHTask.missionInformation.TakeoffPreparationTime;
        
        
             
             
             
             
-            Log.Info($"Name:{config.XHTask.missionInformation.MissionName} AircraftId:{config.XHTask.missionInformation.AircraftId[i]}");
+            Log.Info($"Name:{config.XHTask.missionInformation.MissionName} AircraftId:{config.XHTask.missionInformation.aircraftInfos[i].AircraftId}");
             
             
             mission.AircraftXHs.Add(aircraft);
             mission.AircraftXHs.Add(aircraft);
             
             
@@ -247,11 +247,11 @@ public class CreateSeaSJEventHandler : AEvent<CreateSeaSJTask>
         mission.MissionId = $"海上搜索救援任务 {config.SeaSJTask.missionInformation.MissionName}";
         mission.MissionId = $"海上搜索救援任务 {config.SeaSJTask.missionInformation.MissionName}";
         mission.ExecutionContext = config.EditorConfig.runCounts;
         mission.ExecutionContext = config.EditorConfig.runCounts;
         mission.AddComponent<SJTotalTaskPerformanceComponent>();
         mission.AddComponent<SJTotalTaskPerformanceComponent>();
-        for (int i = 0; i < config.SeaSJTask.missionInformation.AircraftInfos.Length; i++)
+        for (int i = 0; i < config.SeaSJTask.missionInformation.aircraftInfos.Length; i++)
         {
         {
             //飞机参数
             //飞机参数
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                a => a.AircraftID == config.SeaSJTask.missionInformation.AircraftInfos[i]);
+                a => a.AircraftID == config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftType);
             //基地
             //基地
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
             
             
@@ -262,11 +262,11 @@ public class CreateSeaSJEventHandler : AEvent<CreateSeaSJTask>
        
        
             
             
             AircraftSJ aircraft = ComponentFactory.Create<AircraftSJ, FlightPlanEditor>( flightPlanEditor);
             AircraftSJ aircraft = ComponentFactory.Create<AircraftSJ, FlightPlanEditor>( flightPlanEditor);
-            aircraft.Name = config.SeaSJTask.missionInformation.AircraftInfos[i];
+            aircraft.Name = config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftType;
             aircraft.TaskReadyTime = config.SeaSJTask.missionInformation.TakeoffPreparationTime;
             aircraft.TaskReadyTime = config.SeaSJTask.missionInformation.TakeoffPreparationTime;
             mission.aircrafts.Add(aircraft);
             mission.aircrafts.Add(aircraft);
             aircraft.taskContent = config.SeaSJTask;
             aircraft.taskContent = config.SeaSJTask;
-            aircraft.AircraftId = config.SeaSJTask.missionInformation.AircraftId[i];
+            aircraft.AircraftId = config.SeaSJTask.missionInformation.aircraftInfos[i].AircraftId;
             aircraft.AddComponent<SJStaticCapacityComponent>();
             aircraft.AddComponent<SJStaticCapacityComponent>();
             Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
             Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
         }
         }
@@ -286,11 +286,11 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSJTask>
         mission.MissionId = $"陆上搜索救援任务 {config.LandSJTask.missionInformation.MissionName}";
         mission.MissionId = $"陆上搜索救援任务 {config.LandSJTask.missionInformation.MissionName}";
         mission.ExecutionContext = config.EditorConfig.runCounts;
         mission.ExecutionContext = config.EditorConfig.runCounts;
         //mission.AddComponent<SJTotalTaskPerformanceComponent>();
         //mission.AddComponent<SJTotalTaskPerformanceComponent>();
-        for (int i = 0; i < config.LandSJTask.missionInformation.AircraftInfos.Length; i++)
+        for (int i = 0; i < config.LandSJTask.missionInformation.aircraftInfos.Length; i++)
         {
         {
             //飞机参数
             //飞机参数
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
             var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                a => a.AircraftID == config.LandSJTask.missionInformation.AircraftInfos[i]);
+                a => a.AircraftID == config.LandSJTask.missionInformation.aircraftInfos[i].AircraftType);
             //基地
             //基地
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
             var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 
 
@@ -299,11 +299,11 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSJTask>
             var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, new TargetPoint[] { targetPoint });
             var flightPlanEditor = FlightPlanEditor.Create(aircraftParameter, config.EditorConfig.cityWeather, originBase, new TargetPoint[] { targetPoint });
 
 
             AircraftLandSJ aircraft = ComponentFactory.Create<AircraftLandSJ, FlightPlanEditor>(flightPlanEditor);
             AircraftLandSJ aircraft = ComponentFactory.Create<AircraftLandSJ, FlightPlanEditor>(flightPlanEditor);
-            aircraft.Name = config.LandSJTask.missionInformation.AircraftInfos[i];
+            aircraft.Name = config.LandSJTask.missionInformation.aircraftInfos[i].AircraftType;
             aircraft.TaskReadyTime = config.LandSJTask.missionInformation.TakeoffPreparationTime;
             aircraft.TaskReadyTime = config.LandSJTask.missionInformation.TakeoffPreparationTime;
             mission.aircrafts.Add(aircraft);
             mission.aircrafts.Add(aircraft);
             aircraft.taskContent = config.LandSJTask;
             aircraft.taskContent = config.LandSJTask;
-            aircraft.AircraftId = config.LandSJTask.missionInformation.AircraftId[i];
+            aircraft.AircraftId = config.LandSJTask.missionInformation.aircraftInfos[i].AircraftId;
             aircraft.AddComponent<SJStaticCapacityComponent>(); // 陆上搜救是否需要新建SJStaticCapacityComponent?
             aircraft.AddComponent<SJStaticCapacityComponent>(); // 陆上搜救是否需要新建SJStaticCapacityComponent?
             Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
             Log.Info($"创建机型 : {flightPlanEditor.aircraftparameter.AircraftID}");
         }
         }

+ 6 - 7
SimulationServer/EventHandler/ServerStartEventHandler.cs

@@ -19,8 +19,8 @@ public class ServerStartEventHandler : AEvent<ServerStart>
         HttpInterface.serverIp = File.ReadAllText("dbIp.txt");
         HttpInterface.serverIp = File.ReadAllText("dbIp.txt");
         SimulationCommon.Util.serverIp = HttpInterface.serverIp;
         SimulationCommon.Util.serverIp = HttpInterface.serverIp;
         // 读取任务配置文件
         // 读取任务配置文件
-        string ec_path = "Missions/editor_config1.json";
-        string tc_path = "Missions/task_config1.json";
+        string ec_path = "Missions/editor_config.json";
+        string tc_path = "Missions/task_config.json";
 
 
         if (!File.Exists(ec_path))
         if (!File.Exists(ec_path))
         {
         {
@@ -34,13 +34,12 @@ public class ServerStartEventHandler : AEvent<ServerStart>
             return UniTask.CompletedTask;
             return UniTask.CompletedTask;
         }
         }
 
 
-        string ec_str = File.ReadAllText("Missions/editor_config1.json");
-        string tc_str = File.ReadAllText("Missions/task_config1.json");
-        //Console.WriteLine(ec_str);
-        //Console.WriteLine(tc_str);
+        string ec_str = File.ReadAllText("Missions/editor_config.json");
+        string tc_str = File.ReadAllText("Missions/task_config.json");
+        Console.WriteLine(ec_str);
+        Console.WriteLine(tc_str);
         EditorConfig? editorConfig = JsonConvert.DeserializeObject<EditorConfig>(ec_str);
         EditorConfig? editorConfig = JsonConvert.DeserializeObject<EditorConfig>(ec_str);
         TaskConfig? taskConfig = JsonConvert.DeserializeObject<TaskConfig>(tc_str);
         TaskConfig? taskConfig = JsonConvert.DeserializeObject<TaskConfig>(tc_str);
-
         if (editorConfig == null || taskConfig == null)
         if (editorConfig == null || taskConfig == null)
         {
         {
             Log.Error("配置文件解析失败!");
             Log.Error("配置文件解析失败!");