11static void require(
bool condition,
const char* what) {
13 throw std::runtime_error(std::string(
"Ball valve config assertion failed: ") + what);
20active_connectors = [1, 2]
22[boards.ball_valve_board]
26active_connectors = [1]
29"Ball Valve NC" = ["NC", 1, 71]
30"Ball Valve NO" = ["NO", 1, 71]
31"Actuator NO" = ["NO", 2, 11]
32"Actuator NC" = ["NC", 1, 11]
42 require(cfg.actuator_roles.at(
"Ball Valve NC").ball_valve,
"NC role flagged ball_valve");
43 require(!cfg.actuator_roles.at(
"Ball Valve NC").is_no,
"NC role pass-through");
44 require(cfg.actuator_roles.at(
"Ball Valve NO").ball_valve,
"NO role flagged ball_valve");
45 require(!cfg.actuator_roles.at(
"Ball Valve NO").is_no,
46 "NO on a ball valve forced pass-through");
49 require(!cfg.actuator_roles.at(
"Actuator NO").ball_valve,
"actuator role not a ball valve");
50 require(cfg.actuator_roles.at(
"Actuator NO").is_no,
"actuator NO stays NO");
51 require(!cfg.actuator_roles.at(
"Actuator NC").is_no,
"actuator NC stays NC");
61 std::cout <<
"Ball valve config passed\n";
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 ...
ActiveBoardKind kind_of(const std::string &type_str)
[boards.
Config load_from_string(const std::string &text)
Parse config from an in-memory TOML string (SequencerService / ActuatorCommander hold it so).
static void require(bool condition, const char *what)
static const uint8_t kConfig[]