STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_controller_pwm_roles.cpp File Reference
#include <iostream>
#include <map>
#include <string>
#include "config/Config.hpp"
#include "control/PWMTargets.hpp"
Include dependency graph for test_controller_pwm_roles.cpp:

Go to the source code of this file.

Functions

static void check (bool ok, const std::string &what)
static fsw::config::Config makeConfig (const std::map< std::string, std::string > &assign, bool declare_board_14=true)
 assign maps an actuator name to its 4th element; a name absent from it is unassigned.
int main ()

Variables

static int g_failures = 0
 Which actuators the controller PWMs, resolved from config alone.

Function Documentation

◆ check()

void check ( bool ok,
const std::string & what )
static

Definition at line 29 of file test_controller_pwm_roles.cpp.

References g_failures, and ok.

Referenced by main().

◆ main()

◆ makeConfig()

fsw::config::Config makeConfig ( const std::map< std::string, std::string > & assign,
bool declare_board_14 = true )
static

assign maps an actuator name to its 4th element; a name absent from it is unassigned.

Definition at line 36 of file test_controller_pwm_roles.cpp.

References board(), ch(), and fsw::config::load_from_string().

Referenced by main().

Variable Documentation

◆ g_failures

int g_failures = 0
static

Which actuators the controller PWMs, resolved from config alone.

An [actuator_roles] entry's optional 4th element — "pwm_fuel" or "pwm_ox" — assigns that actuator to controller_service. It is the single statement of what the controller drives, and the same fact makes ActuatorCommander stop commanding the actuator during a burn, so the two cannot disagree about who owns a valve.

Before this was config-driven, controller_main matched the literal names "Fuel Press"/"LOX Press" and every step had a fallback: a missing role became CH3/CH8 on board 12, an undeclared board became "192.168.2.<board_id>", an empty board table became a synthesized 11-14, and two roles on two boards silently shared the first one's IP. Each drove PWM at whatever hardware happened to sit on the guessed channel, behind a warning in a log nobody reads.

So what is pinned here is mostly the absence of fallbacks: every unresolvable input must be reported rather than substituted, because the caller turns a report into a disabled fire gate.

Pure resolution — no sockets, no files, no dependence on the host's interfaces.

Definition at line 27 of file test_controller_pwm_roles.cpp.