12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using KYFramework;
- using Model;
- using MongoDB.Bson;
- using QuYuSaoMiao;
- namespace SimulationServer;
- public class AircraftZC : AircraftEntity
- {
- public string missionId;
- public List<double[]> SC01;
- public ZCTask content;
- public double[] Velocitys = new double[5]{220,220,220,110,0}; // 速度
- public double[] FuelConsumptions = new double[5]{2800,2800,2800,1000,132}; // 燃油消耗
- public double time;
- public ZCMethod ZCMethod;
- public override void Start()
- {
- FXJHGenerate.FromStartToMission(FlightPlanEditor,ref TurningPoints);//生成从起点到任务段起点的航路点
- SC01 = GeDianShengCheng.scanroute(ZCMethod.Poly, ZCMethod.ScanRange, ZCMethod.hSC, ZCMethod.isRealHeight, ZCMethod.isSurround, ZCMethod.SurroundNum,GeDianShengCheng.DemHelper());//侦查模型输出的航路点位置
- FXJHGenerate.ZhenCha(SC01, FlightPlanEditor,ref TurningPoints);
- FXJHGenerate.FromMissionToEnd(FlightPlanEditor, FXJHGenerate.ZhenChaMissionEndPoint(SC01),ref TurningPoints);
- FXJHGenerate.FXJHTPDiedai(FlightPlanEditor,ref TurningPoints, Velocitys, FuelConsumptions);
-
- TotalFuelConsumption = TurningPoints[0].RemainingFuel - TurningPoints[^1].RemainingFuel;
- for (int i = 0; i < SC01.Count + 3; i++)
- {
- time += TurningPoints[i].SegmentFlightTime;
- }
- Log.Info($"{missionId} 任务结束!总飞行时间:{time} 总油耗:{TotalFuelConsumption}");
- }
- }
- [ObjectSystem]
- public class AircraftZCAwakeSystem : AwakeSystem<AircraftZC,FlightPlanEditor,ZCTask,int>
- {
- public override void Awake(AircraftZC self,FlightPlanEditor flightPlanEditor,ZCTask zcTask,int index)
- {
- self.content = zcTask;
- self.FlightPlanEditor = flightPlanEditor;
- self.missionId = zcTask.missionInformation.MissionName;
- self.AircraftId = zcTask.aircraftInfos[index].AircraftId;
- self.Name = zcTask.aircraftInfos[index].AircraftType;
- self.TaskReadyTime = zcTask.missionInformation.TakeoffPreparationTime;
- }
- }
|