Browse Source

parse the performance data information

Sven Czarnian 3 years ago
parent
commit
9c7d8db006
1 changed files with 28 additions and 0 deletions
  1. 28 0
      aman/config/AircraftPerformance.py

+ 28 - 0
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