Browse Source

send the IAFs as well

Sven Czarnian 2 năm trước cách đây
mục cha
commit
6426aa2bd4
1 tập tin đã thay đổi với 14 bổ sung1 xóa
  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')