Skip to main content

Module eng

Module eng 

Source
Expand description

RASP .eng motor files: reading and writing, built from the public spec (docs/format/eng.md).

A file holds one or more entries. Each entry is optional ; comments, a seven-field header (name, diameter in mm, length in mm, delays, propellant mass in kg, total mass in kg, manufacturer) and time thrust points, and entries are separated by comment lines.

The file model keeps the file’s units (mm and kg) and its points exactly as listed, with no implicit origin, so a read-write-read cycle reproduces every value bit for bit (EngEntry::thrust_curve adds the origin). The reader is lenient and reports what it accepted as ParseWarnings; the writer refuses anything the reader would read differently.

Structs§

EngEntry
One motor in a .eng file.
EngFile
A parsed .eng file.

Functions§

parse
Reads a .eng file.
write
Writes a .eng file: a first 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); then each entry’s comments, header and points, then a ; separator; and the trailing comments last. A comment carried over that names an earlier program the same way, as a file hpr wrote before holds, is left out, so converting a file again writes one such line, not two. The reader doesn’t keep that line (parse).