#[non_exhaustive]pub struct Design {
pub rocket: Rocket,
pub motors: Motors,
pub recovery: Recovery,
pub simulations: Vec<StoredSimulation>,
pub extensions: Extensions,
}Expand description
A .ork design read whole: its rocket, carrying every motor configuration hpr can fly as
written, and everything the file says about its motors.
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.rocket: RocketThe rocket, as rocket reads it, with Rocket::configurations holding the
configurations in Design::motors that were not left out, each motor lit as the file
says. A configuration whose MotorConfiguration::staging is set must be flown with that
separation (hpr::ork::separation): without it the stack carries its booster to the ground
with the sustainer lit on it.
motors: MotorsEvery motor configuration in the file, flown or not.
recovery: RecoveryWhen each parachute and streamer opens and each stage separates.
simulations: Vec<StoredSimulation>The simulations OpenRocket last ran on the design, with their conditions and results.
extensions: ExtensionsWhat the file holds that hpr does not model, kept whole for an export to put back.
Implementations§
Source§impl Design
impl Design
Sourcepub fn new(
rocket: Rocket,
motors: Motors,
recovery: Recovery,
simulations: Vec<StoredSimulation>,
extensions: Extensions,
) -> Self
pub fn new( rocket: Rocket, motors: Motors, recovery: Recovery, simulations: Vec<StoredSimulation>, extensions: Extensions, ) -> Self
A design from its parts, as the hpr design format holds them (hpr_format::DesignFile).
Sourcepub fn is_reduced(&self) -> bool
pub fn is_reduced(&self) -> bool
Whether the rocket is reduced: the file describes parts of it (a pod, a parallel stage, a
part hpr cannot shape) that are kept in Design::extensions rather than read into it.
The flag is on the Design, not on Design::rocket: check it before using the rocket on
its own. A part read as something simpler, such as a cluster of tubes read as one, does not
make a design reduced; its warning keeps every configuration of it from flying
(ADR-055, the rule for which configurations fly).
Sourcepub fn reference_exclusion(
&self,
simulation: &StoredSimulation,
) -> Option<StoredReferenceExclusion>
pub fn reference_exclusion( &self, simulation: &StoredSimulation, ) -> Option<StoredReferenceExclusion>
Returns why simulation cannot be used as a reference for this design.
This combines the stored-result screen with hpr’s design-reproduction screen. Use
StoredSimulation::reference_exclusion and Self::reproduction_exclusion separately
when those two questions need to be reported independently.
Sourcepub fn reproduction_exclusion(
&self,
simulation: &StoredSimulation,
) -> Option<StoredReferenceExclusion>
pub fn reproduction_exclusion( &self, simulation: &StoredSimulation, ) -> Option<StoredReferenceExclusion>
Returns why hpr cannot reproduce the design named by a stored launch configuration.
This is deliberately separate from StoredSimulation::reference_exclusion: a complete
OpenRocket result can be a useful stored reference even when hpr does not yet have its
motor curve or full airframe model. A caller that needs a result hpr can fly should apply
both classifiers.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Design
impl<'de> Deserialize<'de> for Design
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 JsonSchema for Design
impl JsonSchema for Design
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more