AircraftEntity.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using KYFramework;
  2. using Model;
  3. using SimulationServer.Utils;
  4. namespace SimulationServer;
  5. public class AircraftEntity : Entity
  6. {
  7. public string TaskName { get; set; } // 任务名称
  8. public string Name { get; set; } // 飞机名称
  9. public string AircraftId { get; set; } // 飞机编号
  10. public string AircraftIndex { get; set; } // 飞机索引
  11. public string Type { get; set; } // 飞机类型
  12. public AircraftDB Db { get; set; } // 飞机数据库参数
  13. public FlightPlanEditor? FlightPlanEditor { get; set; } // 飞行计划编辑器
  14. public string Airport { get; set; } // 飞机机场
  15. public double T { get; set; } // 飞机飞到火场需要的时间
  16. public double TotalFuelConsumption { get; set; } // 总燃油消耗
  17. public double FirstTime { get; set; } //单机入场时间
  18. public double TaskResponseTime { get; set; } = 600; // 任务响应时间
  19. public double EffMisTime { get; set; } // 单机有效任务时长
  20. public YLDBData ylDb { get; set; } // 医疗数据库参数
  21. public string AircraftType { get; set; } // 飞机类型
  22. //搜索时间
  23. public double SearchTime { get; set; }
  24. public double TotalTime { get; set; }
  25. public double TaskReadyTime { get; set; } // 任务准备时间
  26. public bool SyncOver { get; set; } // 是否同步完成
  27. public double[] Velocitys = new double[5] { 220, 220, 220, 110, 0 }; // 速度
  28. public double[] FuelConsumptions = new double[5] { 2800, 2800, 2800, 1000, 132 }; // 燃油消耗
  29. public List<TurningPoint> TurningPoints = new List<TurningPoint>(); // 航路点
  30. public void Awake()
  31. {
  32. Db = Util.GetAircraftDefine(FlightPlanEditor.aircraftparameter.AircraftType, FlightPlanEditor.aircraftparameter.AircraftSubType, FlightPlanEditor.aircraftparameter.AircraftID);
  33. //ylDb = Util.GetYL(FlightPlanEditor.aircraftparameter.AircraftType, FlightPlanEditor.aircraftparameter.AircraftSubType, FlightPlanEditor.aircraftparameter.AircraftID);
  34. if (Db.f_zdqfzl != null)
  35. FlightPlanEditor.aircraftparameter.MaxTakeoffWeight = double.Parse(Db.f_zdqfzl.ToString());
  36. else
  37. FlightPlanEditor.aircraftparameter.MaxTakeoffWeight = 8000;
  38. if (Db.f_zdzkl != null)
  39. FlightPlanEditor.aircraftparameter.MaxPassengerNumber = double.Parse(Db.f_zdzkl.ToString());
  40. else
  41. FlightPlanEditor.aircraftparameter.MaxPassengerNumber = 20;
  42. }
  43. public virtual void Reset()
  44. {
  45. T = 0;
  46. EffMisTime = 0;
  47. FirstTime = 0;
  48. TotalFuelConsumption = 0;
  49. TaskResponseTime = 0;
  50. TurningPoints = new List<TurningPoint>();
  51. }
  52. public virtual void Start()
  53. {
  54. }
  55. public virtual void Update(double time)
  56. {
  57. }
  58. public virtual void End()
  59. {
  60. }
  61. }