parse the performance data information

This commit is contained in:
Sven Czarnian
2021-09-02 09:32:28 +02:00
vanhempi 8cd5aa6baf
commit 9c7d8db006

Näytä tiedosto

@@ -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