fix two found crashes

This commit is contained in:
Sven Czarnian
2021-10-14 14:35:27 +02:00
parent a7541925c7
commit 43589eaa35
2 changed files with 1 additions and 2 deletions

View File

@@ -31,7 +31,6 @@ class RecedingHorizonControl:
plannedInbound = self.Windows[index].inbound(inbound.Report.aircraft.callsign) plannedInbound = self.Windows[index].inbound(inbound.Report.aircraft.callsign)
plannedInbound.CurrentPosition = inbound.CurrentPosition plannedInbound.CurrentPosition = inbound.CurrentPosition
plannedInbound.MaximumTimeToGain = inbound.MaximumTimeToGain
plannedInbound.ArrivalCandidates = inbound.ArrivalCandidates plannedInbound.ArrivalCandidates = inbound.ArrivalCandidates
# check if we need to update the inbound # check if we need to update the inbound

View File

@@ -178,6 +178,6 @@ class Inbound:
if nextWaypointIndex < len(star.Route): if nextWaypointIndex < len(star.Route):
distanceToWaypoint = star.Route[lastWaypointIndex].haversine(star.Route[nextWaypointIndex]) * 0.539957 distanceToWaypoint = star.Route[lastWaypointIndex].haversine(star.Route[nextWaypointIndex]) * 0.539957
currentHeading = star.Route[lastWaypointIndex].bearing(star.Route[nextWaypointIndex]) currentHeading = star.Route[lastWaypointIndex].bearing(star.Route[nextWaypointIndex])
currentPosition[1] = min(weather.calculateGS(newAltitude, currentIAS, currentHeading), currentPosition[1]) currentPosition[1] = min(weather.calculateGS(currentPosition[0], currentIAS, currentHeading), currentPosition[1])
return timedelta(seconds = flightTimeSeconds), timedelta(seconds = flightTimeUntilIafSeconds), trackmiles return timedelta(seconds = flightTimeSeconds), timedelta(seconds = flightTimeUntilIafSeconds), trackmiles