Sven Czarnian преди 2 години
родител
ревизия
6426aa2bd4
променени са 1 файла, в които са добавени 14 реда и са изтрити 1 реда
  1. 14 1
      aman/app.py

+ 14 - 1
aman/app.py

@@ -128,13 +128,26 @@ def configuration(icao):
     for runway in runways:
         availableRunways.append(runway.Name);
 
+    # get all IAFs of the airport
+    iafs = []
+    for runway in airport.Configuration.GngData.ArrivalRoutes:
+        for route in airport.Configuration.GngData.ArrivalRoutes[runway]:
+            found = False
+            for iaf in iafs:
+                if iaf['name'] == route.Iaf.Name:
+                    found = True
+                    break
+            if False == found:
+                iafs.append({ 'name' : route.Iaf.Name, 'lat' : route.Iaf.Coordinate[0], 'lon' : route.Iaf.Coordinate[1] })
+
     dictionary = {
         'airport' : airport.Icao,
         'useShallShouldMay' : config.UseShallShouldMay,
         'availableRunways' : availableRunways,
         'activeRunways' : config.ActiveArrivalRunways,
         'dependentRunways' : dependencies,
-        'iafColorization' : airport.Configuration.IafColorization
+        'iafColorization' : airport.Configuration.IafColorization,
+        'iafs' : iafs
     }
     data = json.dumps(dictionary, ensure_ascii=True, cls=RunwaySequencingEncoder)
     return Response(data, status=200, mimetype='application/json')