|
@@ -9,6 +9,7 @@ from aman.com import AircraftReport_pb2
|
|
|
from aman.config.AirportSequencing import AirportSequencing
|
|
|
from aman.formats.SctEseFormat import SctEseFormat
|
|
|
from aman.sys.WeatherModel import WeatherModel
|
|
|
+from aman.types.ArrivalWaypoint import ArrivalWaypoint
|
|
|
from aman.types.PerformanceData import PerformanceData
|
|
|
from aman.types.ArrivalRoute import ArrivalRoute
|
|
|
from aman.types.ArrivalData import ArrivalData
|
|
@@ -57,7 +58,7 @@ class Inbound:
|
|
|
star = self.findArrivalRoute(identifier.Runway, navData)
|
|
|
|
|
|
if None != star:
|
|
|
- flightTime, flightTimeUntilIaf, trackmiles = self.arrivalEstimation(identifier.Runway, star, weatherModel)
|
|
|
+ flightTime, flightTimeUntilIaf, trackmiles, arrivalRoute = self.arrivalEstimation(identifier.Runway, star, weatherModel)
|
|
|
|
|
|
avgSpeed = trackmiles / (float(flightTime.seconds) / 3600.0)
|
|
|
ttg = flightTime - timedelta(minutes = (trackmiles / (avgSpeed * 1.1)) * 60)
|
|
@@ -131,6 +132,7 @@ class Inbound:
|
|
|
flightTimeSeconds = 0
|
|
|
nextWaypointIndex = 0
|
|
|
flownDistance = 0.0
|
|
|
+ arrivalRoute = [ ArrivalWaypoint(waypoint = star.Route[0], trackmiles = distanceToWaypoint) ]
|
|
|
|
|
|
while True:
|
|
|
# check if a constraint cleanup is needed and if a speed-update is needed
|
|
@@ -181,6 +183,10 @@ class Inbound:
|
|
|
lastWaypointIndex = nextWaypointIndex
|
|
|
nextWaypointIndex += 1
|
|
|
|
|
|
+ arrivalRoute[-1].FlightTime = timedelta(seconds = flightTimeSeconds)
|
|
|
+ arrivalRoute[-1].ETA = self.ReportTime + arrivalRoute[-1].FlightTime
|
|
|
+ arrivalRoute[-1].PTA = arrivalRoute[-1].ETA
|
|
|
+
|
|
|
# check if a skip from base to final turn waypoints is needed
|
|
|
if -1 != turnIndices[0] and nextWaypointIndex > turnIndices[0] and nextWaypointIndex < turnIndices[1]:
|
|
|
nextWaypointIndex = turnIndices[1]
|
|
@@ -191,4 +197,6 @@ class Inbound:
|
|
|
currentHeading = star.Route[lastWaypointIndex].bearing(star.Route[nextWaypointIndex])
|
|
|
currentPosition[1] = min(weather.calculateGS(currentPosition[0], currentIAS, currentHeading), currentPosition[1])
|
|
|
|
|
|
- return timedelta(seconds = flightTimeSeconds), timedelta(seconds = flightTimeUntilIafSeconds), trackmiles
|
|
|
+ arrivalRoute.append(ArrivalWaypoint(waypoint = star.Route[nextWaypointIndex], trackmiles = arrivalRoute[-1].Trackmiles + distanceToWaypoint))
|
|
|
+
|
|
|
+ return timedelta(seconds = flightTimeSeconds), timedelta(seconds = flightTimeUntilIafSeconds), trackmiles, arrivalRoute
|