diff --git a/aman/config/AircraftPerformance.py b/aman/config/AircraftPerformance.py new file mode 100644 index 0000000..6012e68 --- /dev/null +++ b/aman/config/AircraftPerformance.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +import configparser + +from aman.types.PerformanceData import PerformanceData + +class AircraftPerformance: + def __init__(self, filepath : str): + config = configparser.ConfigParser() + config.read(filepath) + self.aircrafts = { } + + # iterate over all entries + for key in config: + if 'DEFAULT' == key: + continue + + aircraft = PerformanceData(key) + + aircraft.speedAboveFL240 = config[key]['speedabovefl240'] + aircraft.rodAboveFL240 = config[key]['rodabovefl240'] + aircraft.speedAboveFL100 = config[key]['speedabovefl100'] + aircraft.rodAboveFL100 = config[key]['rodabovefl100'] + aircraft.speedBelowFL100 = config[key]['speedbelowfl100'] + aircraft.rodBelowFL100 = config[key]['rodbelowfl100'] + aircraft.speedApproach = config[key]['speedapproach'] + + self.aircrafts[aircraft.icao] = aircraft