AircraftPerformance.py 994 B

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 = config[key]['speedabovefl240']
  15. aircraft.rodAboveFL240 = config[key]['rodabovefl240']
  16. aircraft.speedAboveFL100 = config[key]['speedabovefl100']
  17. aircraft.rodAboveFL100 = config[key]['rodabovefl100']
  18. aircraft.speedBelowFL100 = config[key]['speedbelowfl100']
  19. aircraft.rodBelowFL100 = config[key]['rodbelowfl100']
  20. aircraft.speedApproach = config[key]['speedapproach']
  21. self.aircrafts[aircraft.icao] = aircraft