|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| class | Drawing |
| class | DrawingStore |
Functions | |
| Path | feedtwin_root () |
| Path | shipped_drawings_dir () |
| Path | feedtwin_library_dir () |
| Path | sample_dir () |
| Path | machines_dir () |
| Optional[float] | _fallback_psi (str kind, str name) |
| List[str] | source_problems () |
| Optional[Path] | cea_table_path (Any config) |
| str | sha256 (bytes data) |
| str | drawing_id (bytes data) |
| bytes | normalise (Mapping[str, Any] payload) |
| Dict[str, Any] | summarize (Mapping[str, Any] payload, str name="") |
| str | display_name (str name) |
| str | origin_words (str source) |
| Optional[bytes] | _read (Path path) |
Variables | |
| _ENGINE_ROOT = Path(__file__).resolve().parents[2] | |
| _STAR_ROOT = _ENGINE_ROOT.parent | |
| dict | _STEM_WORDS = {"copv": "COPV", "gn2": "GN2", "he": "helium", "n2": "N2", "ln2": "LN2", "lox": "LOX", "le4": "LE4"} |
| dict | _GAS_WORDS = {"GN2", "helium", "N2", "LN2"} |
| dict | _SHIPPED_CACHE = {} |
Where Layer X's drawings, state machines and combustion tables come from. A drawing is the hardware record (ADR-0002): topology, line geometry, tank and bottle volumes, the regulator. Layer X never edits one. It reads drawings from these places and treats them identically once read, because what identifies a drawing is its **bytes**: * the feed-twin set shipped in ``feed-twin/backend/diagrams`` (the stand and the two COPV-study drawings), listed as benchmarks; * the feed twin's own library, and the sample set it bundles in ``feed-twin/backend/sample`` (the team's current stand, which is *featured*: a browser with no drawing of its own opens on it); * drawings uploaded to Layer X, kept per user; * pid-designer documents, pulled by the router (it owns the HTTP) and stored here like an upload, with where they came from recorded. Every record carries the sha256 of its bytes. A run quotes it, so "which drawing was this" is answerable without trusting a name.
|
protected |
The feed twin's own default for a parameter a drawing leaves out, as a difference in psi.
Definition at line 62 of file sources.py.
Referenced by summarize().
|
protected |
Definition at line 281 of file sources.py.
Referenced by engine.layerx.sources.DrawingStore._feedtwin_library(), engine.layerx.sources.DrawingStore._own_one(), engine.layerx.sources.DrawingStore._sample(), and engine.layerx.sources.DrawingStore._shipped().
| Optional[Path] engine.layerx.sources.cea_table_path | ( | Any | config | ) |
The engine's own CEA cache, resolved the way EngineDesign's CEACache resolves it.
Definition at line 89 of file sources.py.
| str engine.layerx.sources.display_name | ( | str | name | ) |
A drawing's name as a person reads it. A file stem (``copv_study_he``, what a shipped drawing is named by) comes back in words (``COPV study, helium``); any other name, which a person chose, comes back as it is.
Definition at line 214 of file sources.py.
| str engine.layerx.sources.drawing_id | ( | bytes | data | ) |
Short content address. Sixteen hex characters: a collision needs ~2^32 drawings.
Definition at line 112 of file sources.py.
References sha256().
Referenced by engine.layerx.sources.DrawingStore._feedtwin_library(), engine.layerx.sources.DrawingStore._own_one(), engine.layerx.sources.DrawingStore._sample(), engine.layerx.sources.DrawingStore._shipped(), and engine.layerx.sources.DrawingStore.add().
| Path engine.layerx.sources.feedtwin_library_dir | ( | ) |
The feed twin's own library: every drawing its cockpit can open (the shipped ones and what it pulled from pid-designer), as ``manifest.json`` plus ``blobs/``.
Definition at line 45 of file sources.py.
References feedtwin_root().
Referenced by engine.layerx.sources.DrawingStore._feedtwin_library(), and source_problems().
| Path engine.layerx.sources.feedtwin_root | ( | ) |
The feed-twin app checkout, whose shipped drawings and DAQ tables Layer X reads.
Definition at line 36 of file sources.py.
Referenced by feedtwin_library_dir(), machines_dir(), sample_dir(), and shipped_drawings_dir().
| Path engine.layerx.sources.machines_dir | ( | ) |
The DAQ's state-machine tables, as feed-twin ships them (see NEEDS-REPAIR.md there).
Definition at line 57 of file sources.py.
References feedtwin_root().
Referenced by source_problems().
| bytes engine.layerx.sources.normalise | ( | Mapping[str, Any] | payload | ) |
A pid-designer document reduced to what feed-twin reads, as stable bytes.
Definition at line 117 of file sources.py.
Referenced by engine.layerx.sources.DrawingStore.add().
| str engine.layerx.sources.origin_words | ( | str | source | ) |
Where a drawing came from, in words, for the menu's second line (the raw ``source`` stays in the run record).
Definition at line 228 of file sources.py.
| Path engine.layerx.sources.sample_dir | ( | ) |
The sample set feed-twin bundles (the team's current stand drawing and engine): the drawing in it is the featured one, the stand a fresh browser opens on.
Definition at line 51 of file sources.py.
References feedtwin_root().
Referenced by engine.layerx.sources.DrawingStore._sample(), and source_problems().
| str engine.layerx.sources.sha256 | ( | bytes | data | ) |
Definition at line 108 of file sources.py.
Referenced by engine.layerx.sources.DrawingStore._feedtwin_library(), engine.layerx.sources.DrawingStore._own_one(), engine.layerx.sources.DrawingStore._sample(), engine.layerx.sources.DrawingStore._shipped(), engine.layerx.sources.DrawingStore.add(), and drawing_id().
| Path engine.layerx.sources.shipped_drawings_dir | ( | ) |
Definition at line 41 of file sources.py.
References feedtwin_root().
Referenced by engine.layerx.sources.DrawingStore._shipped(), and source_problems().
| List[str] engine.layerx.sources.source_problems | ( | ) |
Each place Layer X reads drawings from that is not there, in words, for the server log and ``GET /api/layerx/status``. A missing one lists nothing and says nothing: the deployed image resolved the twin's library and sample set to ``/feed-twin/backend/...`` (no checkout beside it), so production Layer X never saw what the cockpit holds, nor the featured stand.
Definition at line 74 of file sources.py.
References feedtwin_library_dir(), machines_dir(), sample_dir(), and shipped_drawings_dir().
| Dict[str, Any] engine.layerx.sources.summarize | ( | Mapping[str, Any] | payload, |
| str | name = "" ) |
What a person choosing a drawing needs to see, without building a network. Read through feedtwin's own reader so a drawing it cannot read says so here, not halfway into a run.
Definition at line 125 of file sources.py.
References _fallback_psi().
Referenced by engine.layerx.sources.DrawingStore._feedtwin_library(), engine.layerx.sources.DrawingStore._sample(), and engine.layerx.sources.DrawingStore.add().
|
protected |
Definition at line 32 of file sources.py.
|
protected |
Definition at line 211 of file sources.py.
|
protected |
Definition at line 289 of file sources.py.
|
protected |
Definition at line 33 of file sources.py.
|
protected |
Definition at line 210 of file sources.py.