diff --git a/src/services/flight.py b/src/services/flight.py index 489b120..b19873c 100644 --- a/src/services/flight.py +++ b/src/services/flight.py @@ -500,6 +500,15 @@ def get_flight_simulation(self) -> FlightSimulation: ], ) flight_simulation = FlightSimulation(**encoded_attributes) + + # Project the deployment list down to name + time. Encoding the + # Parachute objects wholesale drags each one's noise_signal - thousands + # of samples per chute - into every simulate response, and a client + # plotting deployment markers needs neither. + flight_simulation.parachute_events = [ + {"name": parachute.name, "time": deploy_time} + for deploy_time, parachute in self.flight.parachute_events + ] return flight_simulation def get_flight_kml(self) -> bytes: diff --git a/src/views/flight.py b/src/views/flight.py index cc6f00a..5097c27 100644 --- a/src/views/flight.py +++ b/src/views/flight.py @@ -20,6 +20,13 @@ class FlightSimulation(ApiBaseView): message: str = "Flight successfully simulated" + # [{name, time}] for every chute that opened, projected in the service + # from RocketPy's flight.parachute_events. Without it a client can only + # *derive* trigger times, and only for `trigger='apogee'` - an + # altitude-triggered main has no derivable timestamp and silently goes + # unreported. + parachute_events: Optional[Any] = None + # Core Flight attributes (always present) # Core Flight attributes (always present)