AircraftEntity.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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] { 200, 200, 200, 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("20");
  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. FlightPlanEditor.aircraftparameter.MaxFuelCapacity = 8000;
  43. }
  44. public virtual void Reset()
  45. {
  46. T = 0;
  47. EffMisTime = 0;
  48. FirstTime = 0;
  49. TotalFuelConsumption = 0;
  50. TaskResponseTime = 0;
  51. TurningPoints = new List<TurningPoint>();
  52. }
  53. public virtual void Start()
  54. {
  55. }
  56. public virtual void Update(double time)
  57. {
  58. }
  59. public virtual void End()
  60. {
  61. }
  62. }