fix issues with the fixed inbounds

This commit is contained in:
Sven Czarnian
2021-12-22 13:27:58 +01:00
parent 1b53084e8c
commit 4f69df6cc7

View File

@@ -136,27 +136,24 @@ class RecedingHorizonControl:
continue continue
node = Node(inbound, None, None, None, None) node = Node(inbound, None, None, None, None)
node.EstimatedTouchdownTime = inbound.PlannedArrivalTime
node.EstimatedIafAltitude = inbound.PlannedArrivalRoute[0].Altitude
node.EstimatedIafTime = inbound.PlannedArrivalRoute[0].PTA
if inbound.PlannedRunway.Name in runwayInbounds: if inbound.PlannedRunway.Name in runwayInbounds:
if None == runwayInbounds[inbound.PlannedRunway.Name] or runwayInbounds[inbound.PlannedRunway.Name].EstimatedTouchdownTime < node.EstimatedTouchdownTime: if None == runwayInbounds[inbound.PlannedRunway.Name] or runwayInbounds[inbound.PlannedRunway.Name].EstimatedTouchdownTime < node.EstimatedTouchdownTime:
runwayInbounds[inbound.PlannedRunway.Name] = node runwayInbounds[inbound.PlannedRunway.Name] = node
if inbound.PlannedArrivalRoute[0].Name in iafInbounds: if inbound.PlannedArrivalRoute[0].Waypoint.Name in iafInbounds:
delta = 100000.0 delta = 100000.0
targetLevel = None targetLevel = None
for level in iafInbounds[inbound.PlannedArrivalRoute[0].Name]: for level in iafInbounds[inbound.PlannedArrivalRoute[0].Waypoint.Name]:
difference = abs(level - inbound.PlannedArrivalRoute[0].Altitude) difference = abs(level - inbound.PlannedArrivalRoute[0].Altitude)
if difference < delta: if difference < delta:
delta = difference delta = difference
targetLevel = level targetLevel = level
if None == iafInbounds[inbound.PlannedArrivalRoute[0].Name][targetLevel]: if None == iafInbounds[inbound.PlannedArrivalRoute[0].Waypoint.Name][targetLevel]:
iafInbounds[inbound.PlannedArrivalRoute[0].Name][targetLevel] = Node iafInbounds[inbound.PlannedArrivalRoute[0].Waypoint.Name][targetLevel] = node
elif iafInbounds[inbound.PlannedArrivalRoute[0].Name][targetLevel].EstimatedIafTime < node.EstimatedIafTime: elif iafInbounds[inbound.PlannedArrivalRoute[0].Waypoint.Name][targetLevel].EstimatedIafTime < node.EstimatedIafTime:
iafInbounds[inbound.PlannedArrivalRoute[0].Name][targetLevel] = Node iafInbounds[inbound.PlannedArrivalRoute[0].Waypoint.Name][targetLevel] = node
return runwayInbounds, iafInbounds return runwayInbounds, iafInbounds