浏览代码

add the last waypoint to the constraints

Sven Czarnian 3 年之前
父节点
当前提交
d388fb5591
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      aman/config/Airport.py

+ 9 - 0
aman/config/Airport.py

@@ -162,6 +162,15 @@ class Airport:
 
                         index += 1
 
+                    # check if we have to add the last waypoint
+                    if 0 != len(waypoints) and waypointName != waypoints[-1].Name:
+                        waypoints.append(Waypoint(name = waypointName, base = isBaseTurn, final = isFinalTurn))
+                        if -1 != constraints[0]:
+                            waypoints[-1].Altitude = constraints[0]
+                        if -1 != constraints[1]:
+                            waypoints[-1].Speed = constraints[1]
+
+                    # register the arrival route
                     self.ArrivalRouteConstraints[star] = waypoints
 
     def __init__(self, filepath : str, icao : str):