#[non_exhaustive]pub enum Trigger {
Apogee,
Altitude {
height_above_ground_m: f64,
},
Time {
time_s: f64,
},
MotorDelay {
motor: usize,
},
Burnout {
motor: usize,
delay_s: f64,
},
}Expand description
When a device’s charge fires.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Apogee
At apogee.
Altitude
The first time from apogee that the center of mass is at or below this height above the launch site, m: an altimeter’s main setting. A rocket whose apogee is already below it fires at apogee.
Time
At a time after launch, s. Charges are checked in free flight and during the descent, so a time that passes on the pad or the rail fires at rail exit.
MotorDelay
A motor’s ejection delay after that motor’s burnout. The motor is its index in
hpr_design::Assembly::motors, and it must have a hpr_motor::Delay::Seconds delay.
As Self::Time, a delay that expires before the rail exit fires there. A motor that
never lights never fires it, so on a cluster with a motor out
(hpr_design::MountedMotor::failed_tubes) name a tube that lights.
Burnout
A delay after a motor’s burnout, whatever its ejection delay: a stage separation timed
from the booster’s burnout. The motor is its index in hpr_design::Assembly::motors.
As Self::MotorDelay, it fires no earlier than the rail exit, and never if the motor
never lights.
Implementations§
Source§impl Trigger
impl Trigger
Sourcepub fn known_time_s(self, assembly: &Assembly) -> Result<Option<f64>, SimError>
pub fn known_time_s(self, assembly: &Assembly) -> Result<Option<f64>, SimError>
When it fires on a flight of assembly, if that is known before the flight: a
Self::Time, or a delay after the burnout of a motor assembly lights at a known time
(one lit by a separation has none yet). None for Self::Apogee and
Self::Altitude, which the flight watches for. A time that passes on the pad or the
rail fires at the rail exit in flight, which this does not know.
§Errors
SimError::Domain as the flight refuses the trigger: a time before launch, a motor that
isn’t there, a Self::MotorDelay on a motor with no ejection delay in seconds, or a
delay that is negative or not finite.
Trait Implementations§
impl Copy for Trigger
Source§impl<'de> Deserialize<'de> for Trigger
impl<'de> Deserialize<'de> for Trigger
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Trigger, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Trigger, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Trigger
impl Serialize for Trigger
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Trigger
Auto Trait Implementations§
impl Freeze for Trigger
impl RefUnwindSafe for Trigger
impl Send for Trigger
impl Sync for Trigger
impl Unpin for Trigger
impl UnsafeUnpin for Trigger
impl UnwindSafe for Trigger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more