|
@@ -1,32 +1,64 @@
|
|
|
using KYFramework;
|
|
|
using Model;
|
|
|
using MongoDB.Bson;
|
|
|
+using SimulationCommon;
|
|
|
|
|
|
namespace SimulationServer;
|
|
|
|
|
|
public class AircraftDY : AircraftEntity
|
|
|
{
|
|
|
- public SHJTask content;
|
|
|
public TaskParameter SHJParameter;
|
|
|
+ public KZDYTask taskContent;
|
|
|
+ public MissionEndPoint MissionEndPoint;
|
|
|
+ public bool IsOver;
|
|
|
+ public bool Success;
|
|
|
+ public TaskParameter taskParameter;
|
|
|
public override void End()
|
|
|
{
|
|
|
TotalFuelConsumption = TurningPoints[0].RemainingFuel - TurningPoints[^1].RemainingFuel;
|
|
|
}
|
|
|
|
|
|
+ public override void Reset()
|
|
|
+ {
|
|
|
+ base.Reset();
|
|
|
+ IsOver = false;
|
|
|
+ Success = false;
|
|
|
+ TotalTime = 0;
|
|
|
+ }
|
|
|
+
|
|
|
public override void Start()
|
|
|
{
|
|
|
+ int hour = Convert.ToInt32(taskContent.missionInformation.StartTime.Split("时")[0]);
|
|
|
+ Console.WriteLine("hour:" + hour);
|
|
|
+ double windSpeed = Convert.ToDouble(TargetQiXiangInfoSave("风速", hour));
|
|
|
+ Console.WriteLine("windSpeed:" + windSpeed);
|
|
|
+ double vis = Convert.ToDouble(TargetQiXiangInfoSave("能见度", hour));
|
|
|
+ Console.WriteLine("vis:" + vis);
|
|
|
+
|
|
|
+ // 任务参数任务点?
|
|
|
+ FlightPlanEditor.missionpoint.MissionPointLatitude = taskParameter.MissionPoints_KZDY[0].MissionPointLatitude;
|
|
|
+ FlightPlanEditor.missionpoint.MissionPointLongitude = taskParameter.MissionPoints_KZDY[0].MissionPointLongitude;
|
|
|
+ FlightPlanEditor.missionpoint.MissionPointHeight = taskParameter.MissionPoints_KZDY[0].MissionPointHeight;
|
|
|
+ Console.WriteLine("Latitude:" + FlightPlanEditor.missionpoint.MissionPointLatitude + "_" + "Longitude:" + FlightPlanEditor.missionpoint.MissionPointLongitude + "_" + "Height:" + FlightPlanEditor.missionpoint.MissionPointHeight);
|
|
|
+
|
|
|
// 飞到目标点时间与人员存活时间做对比 有一个人活着,整个任务成功
|
|
|
+ //double survivalTime = SurvivalTimeModel.SurvivalTime(getNCData.tempreadNC, latitude, longitude, time, text_ReadNC.times, text_ReadNC.latitudes, text_ReadNC.longitudes, Days, Hour); //幸存时间
|
|
|
+
|
|
|
FXJHGenerate.FromStartToMission(FlightPlanEditor, ref TurningPoints);//生成从起点到任务段起点的航路点
|
|
|
// 吊运上升速度 吊运下降速度 Task文件读取 // Editor里读天气根据时间
|
|
|
- double resulttime = get_result_time_rope(SHJParameter.H, SHJParameter.person_number, SHJParameter.windspeed, SHJParameter.vis, 0.75, 1.38).time;//索滑降模型输出的索滑降时间
|
|
|
- FXJHGenerate.SuoHuaJiang(resulttime, FlightPlanEditor, ref TurningPoints);
|
|
|
- FXJHGenerate.FromMissionToEnd(FlightPlanEditor, FXJHGenerate.SuoHuaJiangMissionEndPoint(FlightPlanEditor), ref TurningPoints);
|
|
|
+ double resulttime = get_result_time_rope(taskParameter.Height, taskParameter.liftPersonnel, windSpeed, vis, taskParameter.liftUpSpeed, taskParameter.liftDownSpeed).time;//索滑降模型输出的索滑降时间
|
|
|
+ FXJHGenerate.SuoHuaJiang(resulttime, FlightPlanEditor, ref TurningPoints); // 索滑降通用?
|
|
|
+
|
|
|
+ FXJHGenerate.FromMissionToEnd(FlightPlanEditor, FXJHGenerate.SuoHuaJiangMissionEndPoint(FlightPlanEditor), ref TurningPoints); // // 索滑降通用?
|
|
|
FXJHGenerate.FXJHTPDiedai(FlightPlanEditor, ref TurningPoints, Velocitys, FuelConsumptions);
|
|
|
|
|
|
for (int i = 0; i < TurningPoints.Count; i++) // 总飞行时间
|
|
|
{
|
|
|
TotalTime += TurningPoints[i].SegmentFlightTime; // 总时间 //仿真轮次1 数值1
|
|
|
+ Console.WriteLine("TotalTime:" + TotalTime);
|
|
|
}
|
|
|
+ IsOver = true;
|
|
|
+ End();
|
|
|
}
|
|
|
|
|
|
// --接口
|
|
@@ -69,6 +101,63 @@ public class AircraftDY : AircraftEntity
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ public string TargetQiXiangInfoSave(string s, int hour)
|
|
|
+ {
|
|
|
+ string result = hour.ToString() + "-" + s;
|
|
|
+ switch (s)
|
|
|
+ {
|
|
|
+ case "温度":
|
|
|
+ if (hour >= 0 && hour < 8)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Temperature_00_08.ToString();
|
|
|
+ else if (hour >= 8 && hour < 19)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Temperature_08_19.ToString();
|
|
|
+ else if (hour >= 19 && hour <= 24)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Temperature_19_24.ToString();
|
|
|
+ break;
|
|
|
+ case "湿度":
|
|
|
+ if (hour >= 0 && hour < 8)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Humidity_00_08.ToString();
|
|
|
+ else if (hour >= 8 && hour < 19)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Humidity_08_19.ToString();
|
|
|
+ else if (hour >= 19 && hour <= 24)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Humidity_19_24.ToString();
|
|
|
+ break;
|
|
|
+ case "能见度":
|
|
|
+ if (hour >= 0 && hour < 8)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Visibility_00_08.ToString();
|
|
|
+ else if (hour >= 8 && hour < 19)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Visibility_08_19.ToString();
|
|
|
+ else if (hour >= 19 && hour <= 24)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Visibility_19_24.ToString();
|
|
|
+ break;
|
|
|
+ case "风速":
|
|
|
+ if (hour >= 0 && hour < 8)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.WindSpeed_00_08.ToString();
|
|
|
+ else if (hour >= 8 && hour < 19)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.WindSpeed_08_19.ToString();
|
|
|
+ else if (hour >= 19 && hour <= 24)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.WindSpeed_19_24.ToString();
|
|
|
+ break;
|
|
|
+ case "风向":
|
|
|
+ if (hour >= 0 && hour < 8)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.WindDirection_00_08.ToString();
|
|
|
+ else if (hour >= 8 && hour < 19)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.WindDirection_08_19.ToString();
|
|
|
+ else if (hour >= 19 && hour <= 24)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.WindDirection_19_24.ToString();
|
|
|
+ break;
|
|
|
+ case "天气":
|
|
|
+ if (hour >= 0 && hour < 8)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Weather_00_08;
|
|
|
+ else if (hour >= 8 && hour < 19)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Weather_08_19;
|
|
|
+ else if (hour >= 19 && hour <= 24)
|
|
|
+ result = FlightPlanEditor.targetpoint[0].TargetQiXiangInfo.Weather_19_24;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public class handling_result
|
|
@@ -78,11 +167,10 @@ public class handling_result
|
|
|
}
|
|
|
|
|
|
[ObjectSystem]
|
|
|
-public class AircraftDYAwakeSystem : AwakeSystem<AircraftDY, FlightPlanEditor, SHJTask>
|
|
|
+public class AircraftDYAwakeSystem : AwakeSystem<AircraftDY, FlightPlanEditor>
|
|
|
{
|
|
|
- public override void Awake(AircraftDY self, FlightPlanEditor flightPlanEditor, SHJTask shjTask)
|
|
|
+ public override void Awake(AircraftDY self, FlightPlanEditor flightPlanEditor)
|
|
|
{
|
|
|
- self.content = shjTask;
|
|
|
self.FlightPlanEditor = flightPlanEditor;
|
|
|
self.Awake();
|
|
|
}
|