123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- using KYFramework;
- using MathNet.Numerics.Distributions;
- using Model;
- using MongoDB.Bson;
- using SimulationCommon;
- using SimulationServer.Utils;
- namespace SimulationServer;
- public class AircraftYLWPYS : AircraftEntity
- {
- public YLWPYSTask taskContent;
- public MissionEndPoint MissionEndPoint;
- public bool IsOver;
- public bool Success;
- public TaskParameter taskParameter;
- public Dictionary<string, string> reportInfo = new Dictionary<string, string>();
- public List<string> load = new List<string>();
- public string device;
- public string medicine;
- public override void End()
- {
- TotalFuelConsumption = TurningPoints[0].RemainingFuel - TurningPoints[^1].RemainingFuel;
- }
- public override void Reset()
- {
- base.Reset();
- IsOver = false;
- Success = false;
- TotalTime = 0;
- reportInfo = new Dictionary<string, string>();
- device = string.Empty;
- medicine = string.Empty;
- }
- public override void Start()
- {
- FlightPlanEditor.missionpoint.MissionPointLatitude = FlightPlanEditor.medicalSuppliesInfo[0].TargetPointLatitude;
- FlightPlanEditor.missionpoint.MissionPointLongitude = FlightPlanEditor.medicalSuppliesInfo[0].TargetPointLongitude;
- FlightPlanEditor.missionpoint.MissionPointHeight = FlightPlanEditor.medicalSuppliesInfo[0].TargetPointHeight;
- //Console.WriteLine("Latitude:" + FlightPlanEditor.missionpoint.MissionPointLatitude + "_" + "Longitude:" + FlightPlanEditor.missionpoint.MissionPointLongitude + "_" + "Height:" + FlightPlanEditor.missionpoint.MissionPointHeight);
- FXJHGenerate.FromStartToMission(FlightPlanEditor, ref TurningPoints);//生成从起点到任务段起点的航路点
- FXJHGenerate.JIJIU(5 * 60, FlightPlanEditor, ref TurningPoints);
- MissionEndPoint hospitalPoint = new MissionEndPoint()
- {
- MissionEndPointLongitude = FlightPlanEditor.missionpoint.MissionPointLongitude,
- MissionEndPointLatitude = FlightPlanEditor.missionpoint.MissionPointLatitude,
- MissionEndPointHeight = FlightPlanEditor.missionpoint.MissionPointHeight
- };
- FXJHGenerate.FromMissionToEnd(FlightPlanEditor, hospitalPoint, 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);
- reportInfo.Add("准备时间", TaskReadyTime.ToString());
- double reachTime = 0;
- for (int i = 0; i < 2; i++)
- {
- reachTime += TurningPoints[i].SegmentFlightTime;
- }
- reportInfo.Add("到达时间", reachTime.ToString());
- reportInfo.Add("任务周期时间", TotalTime.ToString());
- reportInfo.Add("执行任务飞机型号", Name);
- reportInfo.Add("执行任务飞机数量", "1");
- reportInfo.Add("单机操作员人数", taskParameter.operatorPersonnel.ToString());
- reportInfo.Add("单机地面保障人数", taskParameter.groundSupportPersonnel.ToString());
- reportInfo.Add("单机总任务时长", TotalTime.ToString());
- reportInfo.Add("单机总油耗", FXJHGenerate.CalculateTotalFuelConsumption(FlightPlanEditor, TurningPoints).ToString());
- double zhc = 0;
- for (int i = 0; i < TurningPoints.Count - 1; i++)
- {
- zhc += Utils.Util.GetDistance(TurningPoints[i].TurningPointLongitude,
- TurningPoints[i + 1].TurningPointLongitude, TurningPoints[i].TurningPointLatitude, TurningPoints[i + 1].TurningPointLatitude);
- }
- reportInfo.Add("单机导航使用情况", zhc.ToString());
- for (int i = 0; i < load.Count; i++)
- {
- if (load[i].Split(":")[0].Contains("装备"))
- {
- device += load[i].Split(":")[1];
- if (i != load.Count - 1)
- {
- device += "\r\n";
- }
- }
- else if (load[i].Split(":")[0].Contains("药品"))
- {
- medicine += load[i].Split(":")[1] + "\r\n";
- if (i != load.Count - 1)
- {
- medicine += "\r\n";
- }
- }
- }
- if (device != null)
- reportInfo.Add("医疗任务设备", device);
- else
- reportInfo.Add("医疗任务设备", "");
- if (medicine != null)
- reportInfo.Add("医疗药品", medicine);
- else
- reportInfo.Add("医疗药品", "");
- IsOver = true;
- End();
- }
- public string TargetQiXiangInfoSave(string s, int hour)
- {
- string result = hour.ToString() + "-" + s;
- for (int i = 0; i < FlightPlanEditor.medicalTargetPoint[0].TargetQiXiangInfos.Length; i++)
- {
- }
- switch (s)
- {
- case "温度":
- break;
- case "湿度":
- break;
- case "能见度":
- break;
- case "风速":
- break;
- case "风向":
- break;
- case "天气":
- break;
- }
- return result;
- }
- }
- [ObjectSystem]
- public class AircraftYLWPYSAwakeSystem : AwakeSystem<AircraftYLWPYS, FlightPlanEditor>
- {
- public override void Awake(AircraftYLWPYS self, FlightPlanEditor flightPlanEditor)
- {
- self.FlightPlanEditor = flightPlanEditor;
- self.Awake();
- }
- }
|