#[non_exhaustive]pub struct Device {
pub name: String,
pub drag: DeviceDrag,
pub trigger: Trigger,
pub lag_s: f64,
pub inflation: Inflation,
pub released_by: Option<usize>,
pub body: usize,
}Expand description
A recovery device: a drag area, when it opens, and how it fills.
Build one with Device::new and the builders: the struct is #[non_exhaustive] so that
streamers (M1.7b) and separation (M1.7c) can add fields without breaking
callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringA name for reports.
drag: DeviceDragWhat gives it its drag area.
trigger: TriggerWhen its charge fires.
lag_s: f64Seconds from the trigger to line stretch, when the canopy starts to fill (RocketPy’s
lag).
inflation: InflationHow its drag area grows from line stretch.
released_by: Option<usize>The device whose opening releases this one, by its index in the flight’s list: a drogue cut away once the main is fully open. A device released before its own charge fires never deploys.
body: usizeWhich body it is attached to, after a separation (Separation) or an ejection
(crate::Ejection): body 0 keeps the nose, body 1 is the separation’s aft stages, and each
ejection’s piece the next number, in the order given, so with no separation the first
ejection makes body 1. Without either there is only body 0.
Implementations§
Source§impl Device
impl Device
Sourcepub fn new(name: impl Into<String>, drag: DeviceDrag, trigger: Trigger) -> Self
pub fn new(name: impl Into<String>, drag: DeviceDrag, trigger: Trigger) -> Self
A device with no lag, opening at once and never released.
Sourcepub fn with_lag_s(self, lag_s: f64) -> Self
pub fn with_lag_s(self, lag_s: f64) -> Self
The same device with lag_s seconds from the trigger to line stretch.
Sourcepub fn with_inflation(self, inflation: Inflation) -> Self
pub fn with_inflation(self, inflation: Inflation) -> Self
The same device with an inflation law.
Sourcepub fn with_release_by(self, index: usize) -> Self
pub fn with_release_by(self, index: usize) -> Self
The same device, released when device index is fully open.
Sourcepub fn on_body(self, index: usize) -> Self
pub fn on_body(self, index: usize) -> Self
The same device, carried by body index after a separation (Separation) or an
ejection (crate::Ejection); Self::body has the numbering. It acts only once that
body flies on its own.