Skip to main content

Module extensions

Module extensions 

Source
Expand description

What a .ork design holds that hpr’s design does not model, kept whole for an export to put back: the x-openrocket extension.

What is kept. Four kinds of thing, each with the path it was found at:

  • Parts hpr does not read: every child of a <subcomponents> that the walk left out: a pod set or a parallel stage (Loft lesson L66: Loft dropped them), a part hpr cannot give a shape, or a tag it has never seen. A design with any is reduced: its rocket is not the whole of what the file describes (super::Design::is_reduced).

  • Sections of the document hpr does not read: every child of <openrocket> besides <rocket> and <simulations> (such as <photostudio> or <docprefs>), and every child of a stored <simulation> besides its name, simulator, calculator, conditions and flight data (such as a simulation <extension>).

  • Tags no reader asks for in an element hpr does read (the rocket, a stage, a part, a stored simulation, and any tag inside those a reader did ask for), such as a part’s <appearance>.

  • Attributes no reader asks for on an element hpr does read, such as a material’s group.

The readers record every tag and attribute they ask for while super::design reads, so one is kept when nothing asked for it. One a reader asked for and then dropped or simplified (a rail button’s screw height, a drag override, a ring’s count above one, a word with no reading) is kept too, since the design does not hold what it says: an export writes it back in place of what the design would, and reading that export warns of it again.

What is not. The text of a second copy of a tag a reader takes once by name; its attributes and unread children are kept. Everything is still in the document itself, which super::OrkFile keeps whole (ADR-051); super::export writes a design back out from the design and these.

The path. openrocket/rocket/stage[0]/bodytube[1]/podset[0] counts each part’s step among all its parent’s <subcomponents> children, the way a warning’s path does, since the order of parts is where they stack. A section’s step, and a tag’s, marked @ at any depth, counts only among the parent’s child elements of its own name: openrocket/rocket/stage[0]/nosecone[0]/ @appearance[0] is the nose cone’s first <appearance>, wherever it stood among the other tags. OpenRocket does not read meaning into the order of tags, and counting this way lets an export put each one back without knowing that order (ADR-109). A tag that belongs to one configuration, by its configid attribute, names it in its step and counts only among the tags of its name for that configuration: …/parachute[0]/@deploymentconfiguration(b)[0] is the parachute’s <deploymentconfiguration> for configuration b, wherever the file put it among the other configurations’, since an export writes them in the design’s order of configurations. A configid that is empty or holds a /, (, ), [ or ] is not named, and its tag counts among the others of its name that name none. An attribute keeps the path of the element it was on. element_at follows a path back.

Structs§

Extensions
The extensions a .ork design carries, by namespace.
Kept
An element kept whole, and where it was.
KeptAttribute
An attribute kept, and the element it was on.
OpenRocketExtension
The x-openrocket extension: the parts and sections of a .ork that hpr does not read, each kept whole where it was.

Functions§

element_at
The element of document at at, a path as Kept::at writes it, or None when the path does not lead to an element of the name it gives.