AircraftPerformance.py 1.0 KB

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python
  2. import configparser
  3. from aman.types.PerformanceData import PerformanceData
  4. class AircraftPerformance:
  5. def __init__(self, filepath : str):
  6. config = configparser.ConfigParser()
  7. config.read(filepath)
  8. self.Aircrafts = { }
  9. # iterate over all entries
  10. for key in config:
  11. if 'DEFAULT' == key:
  12. continue
  13. aircraft = PerformanceData(key)
  14. aircraft.SpeedAboveFL240 = float(config[key]['speedabovefl240'])
  15. aircraft.RodAboveFL240 = float(config[key]['rodabovefl240'])
  16. aircraft.SpeedAboveFL100 = float(config[key]['speedabovefl100'])
  17. aircraft.RodAboveFL100 = float(config[key]['rodabovefl100'])
  18. aircraft.SpeedBelowFL100 = float(config[key]['speedbelowfl100'])
  19. aircraft.RodBelowFL100 = float(config[key]['rodbelowfl100'])
  20. aircraft.SpeedApproach = float(config[key]['speedapproach'])
  21. self.Aircrafts[aircraft.Icao] = aircraft