From 9c7d8db006c2b21b29819b4fb99b46bb09b7d284 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Thu, 2 Sep 2021 09:32:28 +0200 Subject: [PATCH] parse the performance data information --- aman/config/AircraftPerformance.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 aman/config/AircraftPerformance.py 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