12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using KYFramework;
- using Model;
- using MongoDB.Bson;
- using QuYuSaoMiao;
- using SimulationServer.Utils;
- namespace SimulationServer;
- public class AircraftZC : Entity
- {
- public FlightPlanEditor? FlightPlanEditor; // 飞行计划编辑器
- public TurningPoint[] turningPoints = new TurningPoint[200];
- public AircraftDB Db;
- public List<double[]> SC01;
- public ZCTask content;
-
- public double TotalFuelConsumption;
- public void Awake()
- {
- for (int i = 0; i < turningPoints.Length; i++)
- {
- turningPoints[i] = new TurningPoint();
- }
-
- turningPoints = FXJHGenerate.FromStartToMission(FlightPlanEditor,turningPoints);//生成从起点到任务段起点的航路点
-
- SC01 = GeDianShengCheng.scanroute(content.poly,content.ScanRange,content.hSC,content.isRealHeight,content.isSurround,content.SurroundNum,GeDianShengCheng.DemHelper());//侦查模型输出的航路点位置
- turningPoints = FXJHGenerate.ZhenCha(SC01, FlightPlanEditor, turningPoints);
- turningPoints = FXJHGenerate.FromMissionToEnd(FlightPlanEditor, FXJHGenerate.ZhenChaMissionEndPoint(SC01), turningPoints, SC01.Count + 1);
- turningPoints = FXJHGenerate.FXJHTPDiedai(FlightPlanEditor, turningPoints, SC01.Count + 3);
- }
- public void End()
- {
- TotalFuelConsumption = turningPoints[0].RemainingFuel - turningPoints[SC01.Count + 2].RemainingFuel;
- }
- }
- [ObjectSystem]
- public class AircraftZCAwakeSystem : AwakeSystem<AircraftZC,FlightPlanEditor,ZCTask>
- {
- public override void Awake(AircraftZC self,FlightPlanEditor flightPlanEditor,ZCTask zcTask)
- {
- self.content = zcTask;
- self.FlightPlanEditor = flightPlanEditor;
- // 读取数据库
- self.Db = Util.GetAircraftDefine(self.FlightPlanEditor.aircraftparameter.AircraftType,self.FlightPlanEditor.aircraftparameter.AircraftSubType,self.FlightPlanEditor.aircraftparameter.AircraftID);
-
- self.Awake();
- }
- }
|