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

Namespaces

namespace  detail
namespace  anonymous_namespace{Config.cpp}
namespace  anonymous_namespace{SensorTables.cpp}

Classes

struct  BoardSignature
 Board signature/identifier structure. More...
struct  SensorInfo
 Detected sensor information from board. More...
struct  DiscoveredBoard
 Discovered board information. More...
class  BoardDiscovery
 Board Discovery and Configuration Manager. More...
class  DynamicConfigManager
 Dynamic Configuration Manager. More...
struct  NetworkConfig
struct  DatabaseConfig
struct  ServerHeartbeatConfig
struct  HeartbeatServiceConfig
struct  LogsConfig
struct  ControllerServiceConfig
struct  ControllerConfig
struct  ActuatorServiceConfig
struct  CalibrationConfig
struct  FireConfig
struct  FlowConfig
 [flow] — the characterization hold: open a valve for an exact interval, then close it. More...
struct  StateMachinePaths
struct  StateDef
struct  ActuatorRole
struct  BoardConfig
struct  Config
 The whole parsed config.toml, restricted to what C++ consumes. More...
struct  PtBoardConfig
 Per-board 4-20 mA conversion parameters, keyed by Elodin slot (board_number). More...
struct  PressureSensorSpec
 Pressure sensor specifications. More...
struct  SensorAssignment
 Sensor assignment to board. More...
struct  BoardConfiguration
 Board configuration (assigned by FSW). More...
class  SensorAssignmentManager
 Sensor Assignment Manager. More...
struct  PtRoleRef
 Where a named PT sensor role lives: which board, which channel, and which Elodin table its calibrated pressure is published on. More...
struct  T7Channel
 One streamed analog input. More...
struct  T7Board
 One [boards. More...

Enumerations

enum class  ActiveBoardKind : uint8_t {
  PT , LC , TC , RTD ,
  ACTUATOR , ENCODER , ENVIRONMENTAL , BALL_VALVE ,
  UNKNOWN
}
 Board kinds from [boards. More...
enum class  PtInterface : uint8_t { RATIOMETRIC_0_5V , CURRENT_LOOP_4_20MA , ABSOLUTE_0_5V }
 Sensor interface of a PT board, declared by pt_type in its [boards. More...
enum class  SystemState { GSE , FLIGHT }
 System state (GSE or Flight). More...
enum class  SensorType {
  PT , TC , RTD , LC ,
  ACTUATOR
}
 Sensor types. More...

Functions

Config load (const std::string &path)
 Parse config.toml.
Config load_from_string (const std::string &text)
 Parse config from an in-memory TOML string (SequencerService / ActuatorCommander hold it so).
std::map< ActiveBoardKind, std::vector< elodin::BoardChannels > > active_boards (const Config &cfg)
 Derive the active-board table (enabled boards -> Elodin BoardChannels), with the same slot-collision validation the old load_active_boards() logged.
ActiveBoardKind kind_of (const std::string &type_str)
 [boards.
std::map< uint8_t, PtBoardConfig > pt_boards (const Config &cfg)
 Derive PT board 4-20 mA parameters keyed by Elodin slot (mirrors old load_pt_boards()).
bool is_current_loop (const PtBoardConfig &b)
 True when this board's channels convert through the 4-20 mA current-loop path.
std::map< ActiveBoardKind, std::vector< elodin::BoardChannels > > load_active_boards (const std::string &config_path)
 Parse [boards.
std::map< uint8_t, PtBoardConfig > load_pt_boards (const std::string &config_path)
 Parse the PT boards' sensor interface and 4-20 mA conversion parameters, keyed by Elodin slot.
std::vector< PtRoleRef > pt_role_tables (const Config &cfg)
 Every PT sensor role declared by an enabled PT board, in board-declaration order, then every PT input on an enabled LabJack T7 (none while the T7 config has errors, as t7_bridge then refuses to stream).
std::optional< PtRoleRef > find_pt_role (const Config &cfg, const std::string &role)
 Resolve one role by its canonical config name.
std::string board_key_of (const BoardConfig &b)
 The board's section name minus a leading "boards.", e.g.

Variables

constexpr int kT7MaxAin = 13
 Highest AIN number on a T7 without an expansion mux (AIN0-AIN13).

Enumeration Type Documentation

◆ ActiveBoardKind

enum class fsw::config::ActiveBoardKind : uint8_t
strong

Board kinds from [boards.

*] in config.toml (order matches prior daq_bridge enum).

BALL_VALVE is a motorized ball valve board (firmware/Hotfire_Code/BallValve_Hotfire): commanded like an actuator through [actuator_roles], but its SENSOR_DATA is a 4-20 mA position, not a current sense, and it has its own Elodin namespace (0x33-0x35) so it never shares keys with an ACTUATOR board on the same board_id % 10 slot.

Enumerator
PT 
LC 
TC 
RTD 
ACTUATOR 
ENCODER 
ENVIRONMENTAL 
BALL_VALVE 
UNKNOWN 

Definition at line 19 of file LoadActiveBoards.hpp.

◆ PtInterface

enum class fsw::config::PtInterface : uint8_t
strong

Sensor interface of a PT board, declared by pt_type in its [boards.

*] section.

The board hardware is identical; what differs is the sensor interface and therefore the ADC reference, which is set once per board and so cannot be mixed across connectors.

Enumerator
RATIOMETRIC_0_5V 

0-5V ratiometric: excitation is the reference, ratio cancels in HW.

CURRENT_LOOP_4_20MA 

4-20 mA absolute: supply-independent loop across a shunt resistor.

ABSOLUTE_0_5V 

0-5V absolute. Not implemented in firmware; see load_pt_boards().

Definition at line 37 of file LoadActiveBoards.hpp.

◆ SensorType

enum class fsw::config::SensorType
strong

Sensor types.

Enumerator
PT 
TC 
RTD 
LC 
ACTUATOR 

Definition at line 25 of file SensorAssignment.hpp.

◆ SystemState

enum class fsw::config::SystemState
strong

System state (GSE or Flight).

Enumerator
GSE 
FLIGHT 

Definition at line 17 of file SensorAssignment.hpp.

Function Documentation

◆ active_boards()

std::map< ActiveBoardKind, std::vector< elodin::BoardChannels > > fsw::config::active_boards ( const Config & cfg)

Derive the active-board table (enabled boards -> Elodin BoardChannels), with the same slot-collision validation the old load_active_boards() logged.

Free-function form used by daq_bridge/calibration/sequencer.

Definition at line 468 of file Config.cpp.

References b, fsw::elodin::BoardChannels::board_id, fsw::elodin::BoardChannels::board_number, ch(), fsw::elodin::BoardChannels::channels, ENVIRONMENTAL, kind_of(), result, and UNKNOWN.

Referenced by load_active_boards(), and main().

◆ board_key_of()

std::string fsw::config::board_key_of ( const BoardConfig & b)

The board's section name minus a leading "boards.", e.g.

"boards.pt_board_2" -> "pt_board_2".

Definition at line 8 of file SensorTables.cpp.

References b.

Referenced by find_pt_role(), main(), and pt_role_tables().

◆ find_pt_role()

std::optional< PtRoleRef > fsw::config::find_pt_role ( const Config & cfg,
const std::string & role )

Resolve one role by its canonical config name.

First enabled PT board that declares the name wins, in config order — the same "not on this board, keep looking" rule the inline walk used — then the T7 PT inputs. (A role on both is refused by config validation.) Returns nullopt when no enabled PT board declares it, which callers must treat as a refusal rather than a default: a sensor that cannot be located has no safe stand-in value.

Definition at line 82 of file SensorTables.cpp.

References b, board_key_of(), and r.

Referenced by anonymous_namespace{config_broadcast_service_main.cpp}::buildPackets(), main(), and sequencer::PressureFeed::start().

◆ is_current_loop()

bool fsw::config::is_current_loop ( const PtBoardConfig & b)
inline

True when this board's channels convert through the 4-20 mA current-loop path.

Definition at line 54 of file LoadActiveBoards.hpp.

References b, and CURRENT_LOOP_4_20MA.

Referenced by main().

◆ kind_of()

ActiveBoardKind fsw::config::kind_of ( const std::string & type_str)

[boards.

*].type string -> kind; anything unrecognised is UNKNOWN.

Definition at line 60 of file Config.cpp.

References ACTUATOR, BALL_VALVE, ENCODER, ENVIRONMENTAL, LC, PT, RTD, TC, and UNKNOWN.

Referenced by active_boards(), fsw::config::anonymous_namespace{Config.cpp}::from_table(), and main().

◆ load()

Config fsw::config::load ( const std::string & path)

Parse config.toml.

Invalid environmental identities throw std::invalid_argument; other read/parse errors log and return a default-constructed Config.

Definition at line 442 of file Config.cpp.

Referenced by anonymous_namespace{config_broadcast_service_main.cpp}::buildPackets(), load_active_boards(), load_board_map_from_config(), load_pt_boards(), and main().

◆ load_active_boards()

std::map< ActiveBoardKind, std::vector< elodin::BoardChannels > > fsw::config::load_active_boards ( const std::string & config_path)

Parse [boards.

*] sections: enabled boards, board_id, channels / active_connectors. Used by daq_bridge (full table registration) and sequencer_service (ACT_CMD registration).

Also validates Elodin slot assignment (see check_board_slots) and logs to stderr on conflict.

Definition at line 12 of file LoadActiveBoards.cpp.

References active_boards(), and load().

Referenced by sequencer::SequencerService::init(), and main().

◆ load_from_string()

Config fsw::config::load_from_string ( const std::string & text)

◆ load_pt_boards()

std::map< uint8_t, PtBoardConfig > fsw::config::load_pt_boards ( const std::string & config_path)

Parse the PT boards' sensor interface and 4-20 mA conversion parameters, keyed by Elodin slot.

pt_type is authoritative. A board that predates it is treated as 4-20 mA if it carries the legacy hp_pt_* keys, so a deployed config keeps working; that fallback logs a deprecation once.

Definition at line 17 of file LoadActiveBoards.cpp.

References load(), and pt_boards().

Referenced by main().

◆ pt_boards()

std::map< uint8_t, PtBoardConfig > fsw::config::pt_boards ( const Config & cfg)

Derive PT board 4-20 mA parameters keyed by Elodin slot (mirrors old load_pt_boards()).

Definition at line 496 of file Config.cpp.

References ABSOLUTE_0_5V, b, CURRENT_LOOP_4_20MA, p, RATIOMETRIC_0_5V, and result.

Referenced by load_pt_boards().

◆ pt_role_tables()

std::vector< PtRoleRef > fsw::config::pt_role_tables ( const Config & cfg)

Every PT sensor role declared by an enabled PT board, in board-declaration order, then every PT input on an enabled LabJack T7 (none while the T7 config has errors, as t7_bridge then refuses to stream).

Boards that are disabled, not of type "PT", or carry no usable board_id are skipped, matching what the config-broadcast abort-threshold path has always done. A role declared on more than one board appears once per board; callers wanting a single answer should use find_pt_role.

Definition at line 65 of file SensorTables.cpp.

References b, board_key_of(), and r.

Referenced by fsw::script::build_slug_tables(), and main().

Variable Documentation

◆ kT7MaxAin

int fsw::config::kT7MaxAin = 13
constexpr

Highest AIN number on a T7 without an expansion mux (AIN0-AIN13).

Definition at line 99 of file T7Config.hpp.

Referenced by fsw::config::detail::parse_t7_boards().