STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
backend.naming Namespace Reference

Classes

class  Component

Functions

str _family (str entity)
str _unit (str field)
Component classify (str name)

Variables

dict _DISCRETE_FIELDS
dict _SECONDARY_FIELDS
dict _UNIT_BY_FIELD
 _HASH_RE = re.compile(r"^\d{6,}$")

Detailed Description

Classify exported component names into family/field/unit/kind.

A flattened Elodin export names each file `<Entity>.<field>` where Entity is like
`PT_Cal.Ox_Upstream`, `TC1.CH2`, `ACT4.CH5`, `CONTROLLER.diagnostics`,
`BOARD.HB_52`. The last dotted segment is the field (`pressure_psi`, `raw_adc`,
`to_state`, ...). A handful of components are genuinely unnamed and arrive as a
bare numeric hash — those are grouped as "Other".

Function Documentation

◆ _family()

str backend.naming._family ( str entity)
protected
Coarse family for grouping in the UI, derived from the entity prefix.

Definition at line 88 of file naming.py.

Referenced by classify().

◆ _unit()

str backend.naming._unit ( str field)
protected

Definition at line 103 of file naming.py.

Referenced by classify().

◆ classify()

Component backend.naming.classify ( str name)
Split a component name into (entity, field) and classify it.

Definition at line 121 of file naming.py.

References _family(), and _unit().

Variable Documentation

◆ _DISCRETE_FIELDS

dict backend.naming._DISCRETE_FIELDS
protected
Initial value:
1= {
2 "to_state",
3 "from_state",
4 "engine_state",
5 "board_state",
6 "current_state",
7 "debug_mode",
8 "actuator_state",
9 "actuator_state_commanded",
10 "fire_active",
11 "cutoff_active",
12 "safety_filtered",
13 "valid",
14 "cal_status",
15 "reason",
16 "channel_id",
17}

Definition at line 17 of file naming.py.

◆ _HASH_RE

backend.naming._HASH_RE = re.compile(r"^\d{6,}$")
protected

Definition at line 85 of file naming.py.

◆ _SECONDARY_FIELDS

dict backend.naming._SECONDARY_FIELDS
protected
Initial value:
1= {
2 "cal_status",
3 "channel_id",
4 "timestamp_ns",
5 "packet_ts_ms",
6 "reason",
7 "raw_adc",
8 "raw_uv",
9}

Definition at line 36 of file naming.py.

◆ _UNIT_BY_FIELD

dict backend.naming._UNIT_BY_FIELD
protected

Definition at line 51 of file naming.py.