pub struct CatalogMotor {Show 20 fields
pub motor_id: String,
pub manufacturer: String,
pub manufacturer_abbrev: String,
pub designation: String,
pub common_name: String,
pub impulse_class: ImpulseClass,
pub motor_type: MotorType,
pub case_info: Option<String>,
pub prop_info: Option<String>,
pub delays: Option<String>,
pub diameter_mm: f64,
pub length_mm: f64,
pub total_impulse_ns: f64,
pub average_thrust_n: f64,
pub max_thrust_n: Option<f64>,
pub burn_time_s: f64,
pub propellant_mass_g: Option<f64>,
pub total_mass_g: Option<f64>,
pub stated: StatedFigures,
pub curves: Vec<CatalogCurve>,
}Expand description
One motor’s catalog entry, in the units motor files use.
Fields§
§motor_id: StringThrustCurve.org’s id for the motor.
manufacturer: StringManufacturer name.
manufacturer_abbrev: StringManufacturer abbreviation.
designation: StringFull designation, such as 1266J760-19A.
common_name: StringCommon name, such as J760.
impulse_class: ImpulseClassImpulse class letter.
motor_type: MotorTypeSingle-use or reload.
case_info: Option<String>The case a reload fits, such as Pro54-3G.
prop_info: Option<String>The propellant.
delays: Option<String>Available delays as written (6,10,14, 4-6, P; the bundled index copies the curve
file’s header); see CatalogMotor::delays.
diameter_mm: f64Diameter, mm.
length_mm: f64Length, mm.
total_impulse_ns: f64Total impulse, N·s (ThrustCurve::total_impulse_ns in the bundled index).
average_thrust_n: f64Average thrust, N (ThrustCurve::average_thrust_n in the bundled index).
max_thrust_n: Option<f64>Peak thrust, N (ThrustCurve::peak_thrust_n in the bundled index).
burn_time_s: f64Burn time, s (ThrustCurve::burn_time_s, the NFPA 1125 window, in the bundled index).
propellant_mass_g: Option<f64>Propellant mass, g.
total_mass_g: Option<f64>Loaded mass, g.
stated: StatedFiguresThe figures ThrustCurve.org’s record states for the motor, which each curve file is
checked against (CurveCheck).
curves: Vec<CatalogCurve>The motor’s curves.
Implementations§
Source§impl CatalogMotor
impl CatalogMotor
Sourcepub fn delays(&self) -> DelayList
pub fn delays(&self) -> DelayList
The delay settings read from CatalogMotor::delays; empty when none are recorded.
Sourcepub fn thrust_curve(
&self,
curve: &CatalogCurve,
text: &str,
) -> Result<ThrustCurve, MotorError>
pub fn thrust_curve( &self, curve: &CatalogCurve, text: &str, ) -> Result<ThrustCurve, MotorError>
Reads a curve of this motor from its file’s text.
§Errors
MotorError::Inconsistentifcurveis not one of this motor’s curves, or the file doesn’t hold exactly one motor.- The format’s parse error (
eng::parse,rse::parse). ThrustCurve::new’s errors.
Sourcepub fn motor(
&self,
curve: &CatalogCurve,
text: &str,
) -> Result<SolidMotor, MotorError>
pub fn motor( &self, curve: &CatalogCurve, text: &str, ) -> Result<SolidMotor, MotorError>
The motor with the curve read from text, built with SolidMotor::from_envelope from
this entry’s diameter, length and masses. The curve file’s header is used only for a mass
the metadata lacks.
§Errors
As CatalogMotor::thrust_curve and SolidMotor::from_envelope, and
MotorError::Inconsistent for a hybrid (HPR Sim models solids only) or when neither the
metadata nor the file gives the masses. The text is not checked against the curve’s SHA-256:
pass the file the curve names.
Sourcepub fn bundled_motor(&self) -> Result<SolidMotor, MotorError>
pub fn bundled_motor(&self) -> Result<SolidMotor, MotorError>
The motor with its default curve (CatalogMotor::default_curve).
§Errors
MotorError::Inconsistent if the entry has no bundled curve file, and
CatalogMotor::motor’s errors.
Sourcepub fn ranked_curves(&self) -> Vec<&CatalogCurve>
pub fn ranked_curves(&self) -> Vec<&CatalogCurve>
Sourcepub fn default_curve(&self) -> Option<&CatalogCurve>
pub fn default_curve(&self) -> Option<&CatalogCurve>
The curve a flight takes when none is named: the first of
CatalogMotor::ranked_curves whose file is bundled, so a passing file where one is.
Sourcepub fn curve_for_digest(
&self,
digest: Option<&str>,
) -> Option<(&CatalogCurve, &'static str)>
pub fn curve_for_digest( &self, digest: Option<&str>, ) -> Option<(&CatalogCurve, &'static str)>
The curve a design file’s motor flies, with its bundled file’s text: the file OpenRocket’s
curve for digest maps to (crate::openrocket_curves::file_for) where it is one of this
motor’s bundled files (ADR-288 §3), else CatalogMotor::default_curve.
Sourcepub fn default_curve_text(&self) -> Option<(&CatalogCurve, &'static str)>
pub fn default_curve_text(&self) -> Option<(&CatalogCurve, &'static str)>
CatalogMotor::default_curve with its bundled file’s text.
Sourcepub fn failing_figures(&self, curve: &CatalogCurve) -> Vec<FigureGap>
pub fn failing_figures(&self, curve: &CatalogCurve) -> Vec<FigureGap>
The figures of curve’s check outside CHECK_BOUND of this motor’s stated ones, in the
order total impulse, average thrust, burn time; empty when the file passes.
Sourcepub fn propellant_warning(&self, curve: &CatalogCurve) -> Option<String>
pub fn propellant_warning(&self, curve: &CatalogCurve) -> Option<String>
The warning for flying curve when the propellant mass it flies with (the entry’s, else
its header’s; CatalogMotor::motor) is more than PROPELLANT_SHORT_BOUND below the
record’s, naming both masses and the gap; None when
it isn’t (a file exactly at the bound draws none), when the record states no propellant
mass, or when the file isn’t bundled or doesn’t read.
Sourcepub fn mass_warnings(&self, curve: &CatalogCurve) -> Vec<String>
pub fn mass_warnings(&self, curve: &CatalogCurve) -> Vec<String>
The warnings for the masses flying curve takes (CatalogMotor::motor): a loaded mass
more than LOADED_MASS_BOUND from the record’s, either way, naming both masses; else a
burnout mass, loaded less propellant, more than BURNOUT_MASS_BOUND of the record’s
burnout mass from it, either way, naming both; and a
propellant share outside PROPELLANT_SHARE_SPAN, the span the records state. Empty when
neither holds, or when the file isn’t bundled or doesn’t read. Compared as masses, so a
loaded mass exactly at the bound draws none. A NaN flown mass warns. A record loaded mass that
is NaN, infinite or not above zero, or a record propellant mass that is NaN, infinite or
below zero, counts as no record.
Sourcepub fn flight_warnings(&self, curve: &CatalogCurve) -> Vec<String>
pub fn flight_warnings(&self, curve: &CatalogCurve) -> Vec<String>
Every warning flying curve draws: its failing check (CatalogMotor::check_warning),
a light propellant mass (CatalogMotor::propellant_warning) and its masses against the
record (CatalogMotor::mass_warnings), in that order.
Sourcepub fn flight_warning_kinds(&self, curve: &CatalogCurve) -> Vec<MotorWarning>
pub fn flight_warning_kinds(&self, curve: &CatalogCurve) -> Vec<MotorWarning>
CatalogMotor::flight_warnings, each with its kind, so a count by kind doesn’t hang on
the words (issue #1287). The file is read once.
Sourcepub fn check_warning(&self, curve: &CatalogCurve) -> Option<String>
pub fn check_warning(&self, curve: &CatalogCurve) -> Option<String>
The warning for flying curve when its check fails, naming the motor, the file and each
failing figure’s signed gap, file against ThrustCurve.org’s stated figure; None when it
passes.
Trait Implementations§
Source§impl Clone for CatalogMotor
impl Clone for CatalogMotor
Source§fn clone(&self) -> CatalogMotor
fn clone(&self) -> CatalogMotor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CatalogMotor
impl Debug for CatalogMotor
Source§impl<'de> Deserialize<'de> for CatalogMotor
impl<'de> Deserialize<'de> for CatalogMotor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CatalogMotor
impl PartialEq for CatalogMotor
Source§fn eq(&self, other: &CatalogMotor) -> bool
fn eq(&self, other: &CatalogMotor) -> bool
self and other values to be equal, and is used by ==.