Add waypoint departure time to the kneeboard.

This commit is contained in:
Dan Albert 2020-10-19 22:44:54 -07:00
parent 4125f6ec06
commit 1c4f255c7f
3 changed files with 7 additions and 4 deletions

View File

@ -1135,8 +1135,9 @@ class HoldPointBuilder(PydcsWaypointBuilder):
altitude=waypoint.alt,
pattern=OrbitAction.OrbitPattern.Circle
))
loiter.stop_after_time(
self.timing.push_time(self.flight, self.waypoint))
push_time = self.timing.push_time(self.flight, self.waypoint)
self.waypoint.departure_time = push_time
loiter.stop_after_time(push_time)
waypoint.add_task(loiter)
return waypoint

View File

@ -91,11 +91,12 @@ class FlightWaypoint:
self.only_for_player = False
self.data = None
# This is set very late by the air conflict generator (part of mission
# These are set very late by the air conflict generator (part of mission
# generation). We do it late so that we don't need to propagate changes
# to waypoint times whenever the player alters the package TOT or the
# flight's offset in the UI.
self.tot: Optional[int] = None
self.departure_time: Optional[int] = None
@classmethod
def from_pydcs(cls, point: MovingPoint,

View File

@ -145,6 +145,7 @@ class FlightPlanBuilder:
waypoint.waypoint.pretty_name,
str(int(units.meters_to_feet(waypoint.waypoint.alt))),
self._format_time(waypoint.waypoint.tot),
self._format_time(waypoint.waypoint.departure_time),
])
def _format_time(self, time: Optional[int]) -> str:
@ -187,7 +188,7 @@ class BriefingPage(KneeboardPage):
for num, waypoint in enumerate(self.flight.waypoints):
flight_plan_builder.add_waypoint(num, waypoint)
writer.table(flight_plan_builder.build(),
headers=["STPT", "Action", "Alt", "TOT"])
headers=["#", "Action", "Alt", "Time", "Departure"])
writer.heading("Comm Ladder")
comms = []