AircraftEntity.cs 2.9 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 string AircraftType { get; set; } // 飞机类型
  21. //搜索时间
  22. public double SearchTime { get; set; }
  23. public double TotalTime { get; set; }
  24. public double TaskReadyTime { get; set; } // 任务准备时间
  25. public bool SyncOver { get; set; } // 是否同步完成
  26. public double[] Velocitys = new double[5] { 220, 220, 220, 110, 0 }; // 速度
  27. public double[] FuelConsumptions = new double[5] { 200, 200, 200, 1000, 132 }; // 燃油消耗
  28. public List<TurningPoint> TurningPoints = new List<TurningPoint>(); // 航路点
  29. public void Awake()
  30. {
  31. //Console.WriteLine("AircraftType:" + FlightPlanEditor.aircraftparameter.AircraftType);
  32. //Console.WriteLine("AircraftSubType:" + FlightPlanEditor.aircraftparameter.AircraftSubType);
  33. //Console.WriteLine("AircraftID:" + FlightPlanEditor.aircraftparameter.AircraftID);
  34. Db = Util.GetAircraftDefine(FlightPlanEditor.aircraftparameter.AircraftType, FlightPlanEditor.aircraftparameter.AircraftSubType, FlightPlanEditor.aircraftparameter.AircraftID);
  35. if (Db.f_zdqfzl != null)
  36. FlightPlanEditor.aircraftparameter.MaxTakeoffWeight = double.Parse(Db.f_zdqfzl.ToString());
  37. else
  38. FlightPlanEditor.aircraftparameter.MaxTakeoffWeight = 8000;
  39. if (Db.f_zdzkl != null)
  40. FlightPlanEditor.aircraftparameter.MaxPassengerNumber = double.Parse(Db.f_zdzkl.ToString());
  41. else
  42. FlightPlanEditor.aircraftparameter.MaxPassengerNumber = 20;
  43. FlightPlanEditor.aircraftparameter.MaxFuelCapacity = 8000;
  44. }
  45. public virtual void Reset()
  46. {
  47. T = 0;
  48. EffMisTime = 0;
  49. FirstTime = 0;
  50. TotalFuelConsumption = 0;
  51. TaskResponseTime = 0;
  52. TurningPoints = new List<TurningPoint>();
  53. }
  54. public virtual void Start()
  55. {
  56. }
  57. public virtual void Update(double time)
  58. {
  59. }
  60. public virtual void End()
  61. {
  62. }
  63. }