redefine the constructor to be more flexible with constraints, etc.

This commit is contained in:
Sven Czarnian
2021-10-13 16:16:03 +02:00
parent 014379740b
commit 909cfc9e27
3 changed files with 44 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ class Inbound:
# find the nearest runway for an initial guess
distance = 100000.0
currentPosition = Waypoint('', self.Report.position.latitude, self.Report.position.longitude)
currentPosition = Waypoint(latitude = self.Report.position.latitude, longitude = self.Report.position.longitude)
for runway in sequencingConfig.ActiveArrivalRunways:
candidateDistance = runway.Runway.Start.haversine(currentPosition)
if distance > candidateDistance:
@@ -70,7 +70,7 @@ class Inbound:
# calculate descend profile
flightTimeSeconds = 0
currentHeading = Waypoint('', self.Report.position.latitude, self.Report.position.longitude).bearing(self.PlannedStar.Route[0])
currentHeading = Waypoint(latitude = self.Report.position.latitude, longitude = self.Report.position.longitude).bearing(self.PlannedStar.Route[0])
distanceToWaypoint = self.Report.distanceToIAF
nextWaypointIndex = 0
currentPosition = [ self.Report.dynamics.altitude, self.Report.dynamics.groundSpeed ]