PerformanceData.py 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env python
  2. class PerformanceData:
  3. def __init__(self, icao : str):
  4. self.Icao = icao
  5. self.SpeedAboveFL240 = 0.0
  6. self.SpeedAboveFL100 = 0.0
  7. self.SpeedBelowFL100 = 0.0
  8. self.SpeedApproach = 0.0
  9. self.RodAboveFL240 = 0.0
  10. self.RodAboveFL100 = 0.0
  11. self.RodBelowFL100 = 2000.0
  12. def ias(self, altitude, distance):
  13. if 24000 < altitude:
  14. return self.SpeedAboveFL240
  15. elif 10000 < altitude:
  16. return self.SpeedAboveFL100
  17. elif 10000 >= altitude and 5 < distance:
  18. return self.SpeedBelowFL100
  19. elif 5 >= distance:
  20. return self.SpeedApproach
  21. else:
  22. return self.SpeedBelowFL100
  23. def __str__(self):
  24. return 'ICAO: ' + self.icao + ', FL240: ' + str(self.RodAboveFL240) + '@' + str(self.SpeedAboveFL240) + \
  25. ', +FL100: ' + str(self.RodAboveFL100) + '@' + str(self.SpeedAboveFL100) + \
  26. ', -FL100: ' + str(self.RodBelowFL100) + '@' + str(self.SpeedBelowFL100) + \
  27. ', Vapp: ' + str(self.SpeedApproach)