Clarify display of start times.

This commit is contained in:
Dan Albert 2021-11-18 23:22:28 -08:00
parent 0c731e4856
commit 1dfc625f79
2 changed files with 22 additions and 2 deletions

View File

@ -21,4 +21,14 @@ class Uninitialized(FlightState):
def description(self) -> str:
estimator = TotEstimator(self.flight.package)
delay = estimator.mission_start_time(self.flight)
return f"Starting in {delay}"
if self.flight.start_type is StartType.COLD:
action = "Starting up"
elif self.flight.start_type is StartType.WARM:
action = "Taxiing"
elif self.flight.start_type is StartType.RUNWAY:
action = "Taking off"
elif self.flight.start_type is StartType.IN_FLIGHT:
action = "In flight"
else:
raise ValueError(f"Unhandled StartType: {self.flight.start_type}")
return f"{action} in {delay}"

View File

@ -57,4 +57,14 @@ class WaitingForStart(FlightState):
@property
def description(self) -> str:
return f"Waiting for startup at {self.start_time:%H:%M:%S}"
if self.start_type is StartType.COLD:
start_type = "startup"
elif self.start_type is StartType.WARM:
start_type = "taxi"
elif self.start_type is StartType.RUNWAY:
start_type = "takeoff"
elif self.start_type is StartType.IN_FLIGHT:
start_type = "air start"
else:
raise ValueError(f"Unhandled StartType: {self.start_type}")
return f"Waiting for {start_type} at {self.start_time:%H:%M:%S}"