Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/services/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions src/views/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading