#[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.