STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
fsw::config::PtRoleRef Struct Reference

Where a named PT sensor role lives: which board, which channel, and which Elodin table its calibrated pressure is published on. More...

#include <SensorTables.hpp>

Collaboration diagram for fsw::config::PtRoleRef:
[legend]

Public Member Functions

std::pair< uint8_t, uint8_t > table () const

Public Attributes

const BoardConfig * board = nullptr
 The ESP32 PT board declaring this role.
const T7Board * t7 = nullptr
 The LabJack T7 this PT input is on (a [[boards.
std::string board_key
 The board's section name with the "boards." prefix stripped, e.g.
std::string role
 Canonical role name as config spells it, e.g.
int channel = 0
 Connector channel on that board, 1-based, straight from [sensor_roles_<key>]; the AIN number for a T7 input.
uint8_t board_number = 0
 Elodin slot, BoardConfig::slot() — board_id % 10, with 0 meaning 10.
uint8_t table_hi = 0x20
 The calibrated-PT table this sensor publishes on: {0x20, (slot-1)*0x20 + 0x10 + channel}, or {0x26, (slot-1)*0x20 + 0x10 + ain} for a T7 input (t7::calibrated_table_id).
uint8_t table_lo = 0

Detailed Description

Where a named PT sensor role lives: which board, which channel, and which Elodin table its calibrated pressure is published on.

This walk — a name -> [sensor_roles_<board_key>] -> board -> table id — used to exist inline in exactly one place (config_broadcast_service_main.cpp) and nowhere else, so every other consumer that wanted a live pressure by name reached for a hardcoded channel number instead. That is how ControllerService ended up assigning P_copv from channel 6, which is "GN2 Regulated" on this rig and not the COPV at all, and how its subscriber filter came to drop every sensor on PT board 2 — "GN2 High" included. Resolving by role through config makes both unrepresentable.

Definition at line 25 of file SensorTables.hpp.

Member Function Documentation

◆ table()

std::pair< uint8_t, uint8_t > fsw::config::PtRoleRef::table ( ) const
inline

Definition at line 57 of file SensorTables.hpp.

References table_hi, and table_lo.

Member Data Documentation

◆ board

const BoardConfig* fsw::config::PtRoleRef::board = nullptr

The ESP32 PT board declaring this role.

Points into the Config that was passed in, so it is valid exactly as long as that Config is. Null exactly when t7 is set.

Definition at line 28 of file SensorTables.hpp.

◆ board_key

std::string fsw::config::PtRoleRef::board_key

The board's section name with the "boards." prefix stripped, e.g.

"pt_board_2". This is the suffix every per-board section is keyed by: sensor_roles_<key>, calibration_model_<key>, calibration_full_scale_<key>. Resolved here so callers do not each re-derive it.

Definition at line 37 of file SensorTables.hpp.

◆ board_number

uint8_t fsw::config::PtRoleRef::board_number = 0

Elodin slot, BoardConfig::slot() — board_id % 10, with 0 meaning 10.

Definition at line 44 of file SensorTables.hpp.

◆ channel

int fsw::config::PtRoleRef::channel = 0

Connector channel on that board, 1-based, straight from [sensor_roles_<key>]; the AIN number for a T7 input.

Definition at line 42 of file SensorTables.hpp.

◆ role

std::string fsw::config::PtRoleRef::role

Canonical role name as config spells it, e.g.

"GN2 High" — not a slug.

Definition at line 39 of file SensorTables.hpp.

◆ t7

const T7Board* fsw::config::PtRoleRef::t7 = nullptr

The LabJack T7 this PT input is on (a [[boards.

<name>.channels]] row with kind = "PT"), or null for an ESP32 PT. Its pressure arrives on the T7 calibrated table in the same message layout, so a pressure reader needs only table(); anything that talks to the board itself (abort thresholds in a config packet) must skip it.

Definition at line 33 of file SensorTables.hpp.

◆ table_hi

uint8_t fsw::config::PtRoleRef::table_hi = 0x20

The calibrated-PT table this sensor publishes on: {0x20, (slot-1)*0x20 + 0x10 + channel}, or {0x26, (slot-1)*0x20 + 0x10 + ain} for a T7 input (t7::calibrated_table_id).

The encoding is DatabaseConfig.cpp's, which is what actually registers the VTables — not [routing.pt_calibrated]'s description string, which claims board 2 lives at 0x1B-0x1E, has no consumer anywhere in the tree, and is wrong.

Definition at line 54 of file SensorTables.hpp.

Referenced by table().

◆ table_lo

uint8_t fsw::config::PtRoleRef::table_lo = 0

Definition at line 55 of file SensorTables.hpp.

Referenced by table().


The documentation for this struct was generated from the following file: