9 return b.section.rfind(
"boards.", 0) == 0 ?
b.section.substr(7) :
b.section;
18 r.board_key = std::move(board_key);
19 r.role = std::move(role);
21 r.board_number =
b.slot();
23 r.table_lo =
static_cast<uint8_t
>((
r.board_number - 1) * 0x20 + 0x10 + channel);
29 return b.type ==
"PT" &&
b.enabled &&
b.board_id > 0;
37 r.board_key =
b.section.rfind(
"boards.", 0) == 0 ?
b.section.substr(7) :
b.section;
40 r.board_number =
b.slot();
50 std::vector<PtRoleRef> out;
51 if (!cfg.t7_errors.empty())
53 for (
const auto&
b : cfg.t7_boards) {
54 if (!
b.enabled ||
b.board_id <= 0)
56 for (
const auto& c :
b.channels)
57 if (c.kind ==
"PT" && !c.role.empty())
66 std::vector<PtRoleRef> out;
67 for (
const auto&
b : cfg.boards) {
68 if (!usablePtBoard(
b))
71 const auto* roles = cfg.sensor_roles_for(
"sensor_roles_" + board_key);
74 for (
const auto& [role, channel] : *roles)
75 out.push_back(makeRef(
b, board_key, role, channel));
77 for (
auto&
r : t7PtRefs(cfg))
78 out.push_back(std::move(
r));
83 for (
const auto&
b : cfg.boards) {
84 if (!usablePtBoard(
b))
87 const auto* roles = cfg.sensor_roles_for(
"sensor_roles_" + board_key);
90 auto it = roles->find(role);
91 if (it == roles->end())
93 return makeRef(
b, board_key, role, it->second);
95 for (
auto&
r : t7PtRefs(cfg))
*brief create JSON pointer *sa reference_tokens const string_t const string_t & b
bool usablePtBoard(const BoardConfig &b)
The boards a PT role can live on.
PtRoleRef makeT7Ref(const T7Board &b, const T7Channel &c)
A PT input on a LabJack T7: calibration_service publishes it on the T7 calibrated table in the same C...
PtRoleRef makeRef(const BoardConfig &b, std::string board_key, std::string role, int channel)
Fill in the derived half of a ref once board/role/channel are known.
std::vector< PtRoleRef > t7PtRefs(const Config &cfg)
Every PT input t7_bridge will actually 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.
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...
std::array< uint8_t, 2 > calibrated_table_id(uint8_t slot, uint8_t ain)
Calibrated table for one AIN: table_id + 0x10, e.g.
Motorized ball valve position: raw ADC counts -> % open.
The whole parsed config.toml, restricted to what C++ consumes.
Where a named PT sensor role lives: which board, which channel, and which Elodin table its calibrated...
One streamed analog input.
int ain
AIN number on the device, 0-13.
std::string role
Sensor name, e.g. "LOX Tank" — what the GUI calls it.