13void addName(
const std::string& canonical,
const char* where,
15 if (canonical.empty())
17 const std::string slug =
slugify(canonical);
22 out.bad.push_back({canonical, slug, where});
27 if (it->second != canonical)
28 out.collisions.push_back({slug, it->second, canonical, where});
31 table.emplace(slug, canonical);
39 for (
const auto& [name, role] : cfg.actuator_roles)
40 addName(name,
"actuator", out.tables.actuators, out);
47 addName(ref.role,
"sensor", out.tables.sensors, out);
49 for (
const auto& s : cfg.states)
50 addName(s.name,
"state", out.tables.states, out);
TOML_PURE_GETTER TOML_EXPORTED_MEMBER_FUNCTION iterator find(std::string_view key) noexcept
TOML_PURE_INLINE_GETTER iterator end() noexcept
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...
void addName(const std::string &canonical, const char *where, std::map< std::string, std::string > &table, TableBuild &out)
Insert canonical->slug into table, recording a bad slug or an in-namespace collision.
std::string slugify(const std::string &name)
Canonical name -> slug: trim, uppercase, collapse internal whitespace runs to a single '_'.
bool is_valid_slug(const std::string &slug)
True when a slug is usable as a bare identifier: ^[A-Z][A-Z0-9_]*$.
TableBuild build_slug_tables(const fsw::config::Config &cfg)
Build the actuator / sensor / state slug tables from a loaded config.
Motorized ball valve position: raw ADC counts -> % open.
The whole parsed config.toml, restricted to what C++ consumes.