STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.session.hookup Namespace Reference

Classes

class  Knob
class  Channel
class  Hookup
class  RegulatorInfo
class  ValveInfo

Functions

None _check_channels (tuple[Channel,...] channels)
list[ValveInfo] valves (Model model)
list[RegulatorInfo] regulators (Model model)
Hookup suggest (Model model, float dome_psig=500.0, float charge_psig=4500.0)
Hookup on_vehicle (Hookup saved, Model model)
dict[str, float] drawn_settings (Model model)
float|None bottle_charge (Model model, str regulator)
dict[str, float] knob_starts (Hookup hookup, Model model)
float _first_drawn (Mapping[str, float] drawn, tuple[str,...] regulators, float default)
list[str] _hand_loaded_regulators (Model model, set[str] taken)
bool _charges_vehicle_bottle (Model model, str regulator)
float _or (float|None value, float default)
str|None _charged_bottle (Model model, str regulator)
Binding binding (Model model, StateMachine machine, Hookup|None hookup)
frozenset[str] _stand_ins (Model model)
list[Channel] lost_connectors (Hookup hookup, Model model)

Variables

int SCHEMA = 2
tuple _READS = (1, 2)
str DOME = "dome"
str CHARGE = "charge"
float UNSET_PSIG = 500.0 - 14.695948775513449

Detailed Description

How a stand's controls reach its drawing: which valve each state-machine
actuator drives, and which knob sets which regulator.

A drawing says what is plumbed; it does not say what the operator's panel
calls it. The DAQ's table commands "LOX Press" and "Fuel Main"; the drawing
has OU_SOL_R and FM-R. The GSE page has a hand-loaded regulator or three; the
drawing has PR symbols on two pages. Matching those up by name works for most
of a drawing (:func:`feedtwin.session.statemachine.bind`) and fails quietly for
the rest -- a main valve nothing commands, a cart regulator nothing turns.

A :class:`Hookup` is that matching written down, per drawing, by whoever knows
the stand. :func:`suggest` fills it the way the twin always matched -- names,
then what each valve is plumbed to do, and the one dome knob -- so an imported
drawing works at once and the person only has to fix what the names got wrong:

* ``channels``: the DAQ box, written down. Each is one connector on one of the
  DAQ's boards, cabled to one symbol, with the name the DAQ gives it -- the
  role name the console shows and, for a solenoid, the state table's row. That
  is the whole of how the real stand is declared (``[actuator_roles]``: name ->
  board and channel; the table opens names), so a hookup that has channels is
  *wired*: a row drives the valve on the channel of that name, and a row with
  no channel drives nothing. Without channels (``None``) the hookup is the old
  kind and the next field decides.
* ``valves``: actuator -> drawing id, only for what a person pinned. An empty
  id means "this actuator has no valve here". Everything not pinned is matched
  automatically, every time, so a drawing that grows a valve picks it up.
  Ignored once the hookup is wired.
* ``machine``: the stand's own state table when somebody edited it (the
  DAQ's State tab, in the twin); ``None`` is the shipped DAQ table.
* ``knobs``: each a dial on the GSE page and the regulators it sets. A knob on
  a dome loader (the hand-loaded control regulator) sets that loader, and the
  dome follows through it as it always did; on a dome-loaded regulator with no
  loader drawn it sets the dome; on a plain regulator it sets the setpoint. A
  regulator on no knob holds what the drawing says. The knob with id
  :data:`DOME` is the session's ``Setup.dome_psi`` -- the cockpit's dome knob
  and Layer X's lockup solve keep driving it.

Gauge pressures throughout, as on the panel.

Function Documentation

◆ _charged_bottle()

str | None feedtwin.session.hookup._charged_bottle ( Model model,
str regulator )
protected
The drawing id of the vehicle pressurant bottle a regulator's outlet
reaches (see :func:`_charges_vehicle_bottle`), or None.

Definition at line 583 of file hookup.py.

Referenced by _charges_vehicle_bottle(), and bottle_charge().

◆ _charges_vehicle_bottle()

bool feedtwin.session.hookup._charges_vehicle_bottle ( Model model,
str regulator )
protected
Whether a regulator's outlet reaches the vehicle's pressurant bottle:
through any valve, across mated disconnects, without passing a vessel.

Definition at line 573 of file hookup.py.

References _charged_bottle().

Referenced by suggest().

◆ _check_channels()

None feedtwin.session.hookup._check_channels ( tuple[Channel, ...] channels)
protected
A box that cannot be: two cables in one connector, one symbol on two
connectors, a connector with no name or two with the same one (the DAQ
resolves rows by name, so one of them would be unreachable).

Definition at line 244 of file hookup.py.

Referenced by feedtwin.session.hookup.Hookup.from_dict().

◆ _first_drawn()

float feedtwin.session.hookup._first_drawn ( Mapping[str, float] drawn,
tuple[str, ...] regulators,
float default )
protected

Definition at line 543 of file hookup.py.

Referenced by knob_starts(), and suggest().

◆ _hand_loaded_regulators()

list[str] feedtwin.session.hookup._hand_loaded_regulators ( Model model,
set[str] taken )
protected
Built regulators a hand sets, not already on a knob: every one on the
ground support (the cart's regulators are turned on the pad, whatever the
sheet says they were set to), and any other the drawing gives no setting.

Definition at line 549 of file hookup.py.

Referenced by suggest().

◆ _or()

float feedtwin.session.hookup._or ( float | None value,
float default )
protected

Definition at line 579 of file hookup.py.

Referenced by suggest().

◆ _stand_ins()

frozenset[str] feedtwin.session.hookup._stand_ins ( Model model)
protected
A rocket-only drawing's valves that are not valves on the whole one: a
disconnect whose mate went with the cart (``meta["capped"]``), read as the
GSE vent it couples (:func:`feedtwin.pid.network._gse_vents`).

Definition at line 693 of file hookup.py.

Referenced by binding().

◆ binding()

Binding feedtwin.session.hookup.binding ( Model model,
StateMachine machine,
Hookup | None hookup )
The machine bound to the drawing's valves: pins first, then names and
roles -- or, on a wired hookup, exactly its connectors. There a row drives
the valve on the connector of its name and nothing else: a row with no
connector, or one whose cable goes to a symbol that is not a valve here,
drives nothing (and says so in ``unmatched``) rather than being matched
behind the person's back. Only the rows in ``auto`` are matched.

Definition at line 619 of file hookup.py.

References _stand_ins().

◆ bottle_charge()

float | None feedtwin.session.hookup.bottle_charge ( Model model,
str regulator )
The drawn charge [psig] of the vehicle bottle ``regulator`` fills, or
None: where a COPV fill knob starts when the fill regulator itself carries
no setting. The drawing's bottle pressure is the charge it was drawn at
(LE4 (6): COPV 4000, PR-1 blank), and starting the knob at the session's
4,500 put the gauge amber at its own "normal" charge.

Definition at line 506 of file hookup.py.

References _charged_bottle().

Referenced by knob_starts(), and suggest().

◆ drawn_settings()

dict[str, float] feedtwin.session.hookup.drawn_settings ( Model model)
What the drawing sets each regulator to [psig], by drawing id: a
loader's or plain regulator's ``setpoint``, a dome-loaded one's
``dome_pressure``. A regulator the sheet says nothing about is absent.

A dome loader drawn with no setpoint of its own is set to what the drawing
says the dome it loads holds: the loaded regulator's ``dome_pressure``.
That number is the loader's whole job, and LE4 (6) draws it there (DPR_HP
535, DR-REG-G blank); without it the dome knob started at the session's
500 and the cockpit primed 35 psi under the Layer X stand on the same
drawing.

Definition at line 464 of file hookup.py.

Referenced by knob_starts(), regulators(), and suggest().

◆ knob_starts()

dict[str, float] feedtwin.session.hookup.knob_starts ( Hookup hookup,
Model model )
Where each of ``hookup``'s knobs starts on this drawing [psig], by knob
id: the drawing's setting of the first regulator on it that states one.
A knob on regulators the sheet says nothing about is absent -- it starts
at the session's own setting.

Definition at line 520 of file hookup.py.

References _first_drawn(), bottle_charge(), and drawn_settings().

◆ lost_connectors()

list[Channel] feedtwin.session.hookup.lost_connectors ( Hookup hookup,
Model model )
The box's connectors whose cable goes to a symbol the drawing no longer
has, which the stand should say. A connector named for a table row (a
valve's) has its row matched by name instead (:func:`binding`); any other
-- a transducer's -- names nothing until it is rewired. Give it the whole
drawing: on a rocket-only one the cart's connectors are cut on purpose
(:func:`on_vehicle`).

Definition at line 706 of file hookup.py.

◆ on_vehicle()

Hookup feedtwin.session.hookup.on_vehicle ( Hookup saved,
Model model )
``saved`` for a stand built on the vehicle alone (``Setup.ignore_gse``):
the valves a person pinned on the vehicle kept, the knobs the cut drawing
suggests. The saved knobs turn the cart's regulators, which are not there;
with the cart's dome loader gone, the dome knob sets the dome-loaded
regulator itself, as on a drawing of the rocket alone, and the COPV fill
is the built-in charge's target.

Definition at line 427 of file hookup.py.

References suggest().

◆ regulators()

list[RegulatorInfo] feedtwin.session.hookup.regulators ( Model model)
Every regulator on the drawing a knob could set.

Definition at line 313 of file hookup.py.

References drawn_settings().

◆ suggest()

Hookup feedtwin.session.hookup.suggest ( Model model,
float dome_psig = 500.0,
float charge_psig = 4500.0 )
The hookup the drawing implies, before anyone writes one down.

No pinned valves (names and roles decide). The knob :data:`DOME` on every
dome loader -- or, with none drawn, on the first dome-loaded regulator --
which is what the session's dome knob always drove. Then a knob for every
regulator a hand sets: every regulator on the ground support, whatever the
sheet says (the cart's regulators are turned on the pad), and any other
the drawing gives no setting at all. The one whose outlet charges the
vehicle's pressurant bottle is :data:`CHARGE` (the COPV fill), the rest are
knobs of their own. Every knob starts at the drawing's setting
(:func:`drawn_settings`); only a regulator the sheet says nothing about
starts at ``dome_psig``, ``charge_psig`` or where the build left it. A
drawing of the rocket alone whose regulators all carry their settings gets
only the dome knob, as before.

Definition at line 351 of file hookup.py.

References _charges_vehicle_bottle(), _first_drawn(), _hand_loaded_regulators(), _or(), bottle_charge(), drawn_settings(), and max.

Referenced by on_vehicle().

◆ valves()

list[ValveInfo] feedtwin.session.hookup.valves ( Model model)
Every valve a state-machine actuator could drive. Hand valves are turned
by a person on the P&ID, never by the table, so they are not among them.

Definition at line 292 of file hookup.py.

Variable Documentation

◆ _READS

tuple feedtwin.session.hookup._READS = (1, 2)
protected

Definition at line 58 of file hookup.py.

◆ CHARGE

str feedtwin.session.hookup.CHARGE = "charge"

Definition at line 67 of file hookup.py.

◆ DOME

str feedtwin.session.hookup.DOME = "dome"

Definition at line 61 of file hookup.py.

◆ SCHEMA

int feedtwin.session.hookup.SCHEMA = 2

Definition at line 57 of file hookup.py.

◆ UNSET_PSIG

float feedtwin.session.hookup.UNSET_PSIG = 500.0 - 14.695948775513449

Definition at line 72 of file hookup.py.