Skip to main content

Module rse

Module rse 

Source
Expand description

RockSim .rse motor files: reading and writing (docs/format/rse.md).

A file is an XML engine database. Each <engine> carries its summary as attributes (diameter and length in mm, masses in grams) and its samples as <eng-data t f m cg/> points, where m is the propellant left in grams and cg the motor’s center of gravity in mm.

The published guide is thin and disagrees with every real file on names, so the reader follows the observed structure and also accepts the guide’s (<point>, type, initMass, propMass). Like crate::eng, the file model keeps the file’s units and points exactly, the reader reports what it accepted as ParseWarnings, and the writer refuses what the reader would read back differently.

Structs§

RseEngine
One engine in a .rse file. Optional attributes the file doesn’t give are None.
RseFile
A parsed .rse file.
RsePoint
One <eng-data> sample.

Constants§

MAX_ELEMENT_DEPTH
The deepest element nesting parse accepts. Real files nest five deep (<engine-database>, <engine-list>, <engine>, <data>, <eng-data>).

Functions§

parse
Reads a .rse file.
write
Writes a .rse file in RockSim’s layout and attribute order, after an XML comment naming the program that wrote it, its version and its designation (<!-- hpr-sim 0.1.0 · FS · SW · TOOL 005 -->, hpr_core::tool::stamp). RockSim’s files start at <engine-database> with no XML declaration, so the comment is the first line. The reader, as any XML reader, skips comments, so the file reads back the same.