|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Namespaces | |
| namespace | anonymous_namespace{AbortBroadcaster.cpp} |
| namespace | anonymous_namespace{PressureFeed.cpp} |
| namespace | anonymous_namespace{ScriptRunner.cpp} |
| namespace | anonymous_namespace{ScriptStates.cpp} |
| namespace | anonymous_namespace{StateMachine.cpp} |
Classes | |
| class | AbortBroadcaster |
| Sends ABORT / ABORT_DONE / CLEAR_ABORT UDP broadcast packets (PacketHeader only — 6 bytes) to the configured broadcast address and port. More... | |
| struct | ActuatorRole |
| Config entry for one named actuator role loaded from config.toml [actuator_roles]. More... | |
| class | ActuatorCommander |
| Sends UDP actuator commands based on state transitions. More... | |
| struct | HoldSpec |
| What one hold is: how long, and who to tell. More... | |
| class | HoldTimer |
| A cancellable hold of an exact length, and nothing else. More... | |
| class | PressureFeed |
| Live calibrated pressures, by ROLE NAME, for the sequencer. More... | |
| struct | ScriptEnv |
| What a running script is allowed to do to the world. More... | |
| class | ScriptRunner |
| Runs one dynamic state's script on its own thread. More... | |
| struct | DynamicState |
| One dynamic state, resolved and proven usable. More... | |
| struct | ScriptLoadResult |
| What a config load made of its dynamic states. More... | |
| struct | ScriptLoadContext |
| Everything load_dynamic_states needs that it cannot get from Config alone. More... | |
| class | SequencerService |
| Top-level sequencer service. More... | |
| class | StateMachine |
| Parses state_transitions.csv and validates state transitions. More... | |
| struct | Expr |
| struct | ScriptProgram |
| A parsed script, as a flat arena. More... | |
| struct | Stmt |
Typedefs | |
| using | ActuatorCommandedMsg = comms::CommsMessage<uint64_t, uint8_t, uint8_t> |
| using | SequencerStateMsg |
| using | StateTransitionMsg = comms::CommsMessage<uint64_t, uint8_t, uint8_t, uint8_t> |
Enumerations | |
| enum class | State : uint8_t { DEBUG = 0 , IDLE = 1 , ARMED = 2 , FUEL_FILL = 3 , OX_FILL = 4 , GN2_LOW_PRESS = 5 , GN2_VENT = 6 , FUEL_PRESS = 7 , FUEL_VENT = 8 , OX_PRESS = 9 , OX_VENT = 10 , GN2_HIGH_PRESS = 11 , GN2_HIGH_VENT = 12 , VENT = 13 , CALIBRATE = 14 , READY = 15 , FIRE = 16 , ENGINE_ABORT = 17 , GSE_ABORT = 18 , EMERGENCY_ABORT = 19 , PRESS_STANDBY = 20 , UNKNOWN = 255 } |
| System state IDs — must match the TypeScript SystemState enum in web-gui/shared/types.ts. More... | |
| enum class | ExprKind |
| enum class | Op |
| enum class | StmtKind |
Functions | |
| bool | parseHoldMs (const std::string &text, uint32_t &out) |
| Parse a hold duration off the wire, strictly. | |
| ScriptLoadResult | load_dynamic_states (const fsw::config::Config &cfg, const std::string &config_text, const ScriptLoadContext &ctx) |
| Resolve, load and validate every [[states]] entry carrying a script_file. | |
| bool | is_valid_script_filename (const std::string &name) |
| True when name is a safe bare script filename: ^[A-Za-z0-9_-]+.script$, no separators. | |
| static uint8_t | actuator_elodin_low_byte (uint32_t board_id, uint8_t local_channel) |
| Elodin low byte for [0x32, lo]: (board_slot - 1) * 0x20 + local_channel; slot = board_id % 10, 0 → 10. | |
| static std::string | trimVal (const std::string &s) |
| static std::string | toLower (std::string s) |
| static uint64_t | now_ns () |
| static std::string | readFile (const std::string &path) |
| static std::string | resolveDataPath (const std::string &rel) |
| static std::string | trimCell (const std::string &s) |
Variables | |
| constexpr uint32_t | kMaxHoldMs = 3600000 |
| Hard ceiling on any client-supplied hold, independent of per-state config. | |
| constexpr uint32_t | kMaxScriptTimeoutMs = 600000 |
| Hard ceiling on script_timeout_ms, independent of per-state config. | |
| static constexpr uint16_t | VTABLE_SEQUENCER_STATE = 0x5000 |
| static constexpr uint16_t | VTABLE_STATE_TRANSITION = 0x4300 |
| static constexpr int | kControllerConnectTimeoutMs = 300 |
| using sequencer::ActuatorCommandedMsg = comms::CommsMessage<uint64_t, uint8_t, uint8_t> |
Definition at line 32 of file ActuatorCommander.cpp.
Definition at line 43 of file SequencerService.cpp.
| using sequencer::StateTransitionMsg = comms::CommsMessage<uint64_t, uint8_t, uint8_t, uint8_t> |
Definition at line 47 of file SequencerService.cpp.
|
strong |
Definition at line 93 of file StateScript.hpp.
|
strong |
Definition at line 102 of file StateScript.hpp.
|
strong |
System state IDs — must match the TypeScript SystemState enum in web-gui/shared/types.ts.
Definition at line 14 of file StateMachine.hpp.
|
strong |
Definition at line 83 of file StateScript.hpp.
|
static |
Elodin low byte for [0x32, lo]: (board_slot - 1) * 0x20 + local_channel; slot = board_id % 10, 0 → 10.
Definition at line 36 of file ActuatorCommander.cpp.
References board_id.
Referenced by sequencer::ActuatorCommander::applyForState(), and sequencer::ActuatorCommander::publishInitialState().
| bool sequencer::is_valid_script_filename | ( | const std::string & | name | ) |
True when name is a safe bare script filename: ^[A-Za-z0-9_-]+.script$, no separators.
Definition at line 12 of file ScriptStates.cpp.
References ok.
Referenced by load_dynamic_states().
| ScriptLoadResult sequencer::load_dynamic_states | ( | const fsw::config::Config & | cfg, |
| const std::string & | config_text, | ||
| const ScriptLoadContext & | ctx ) |
Resolve, load and validate every [[states]] entry carrying a script_file.
Never throws and never partially applies: a state either comes back fully usable or fully refused with a reason fit to show an operator.
Definition at line 60 of file ScriptStates.cpp.
References fsw::script::Actuator, b, fsw::script::build_slug_tables(), sequencer::ScriptLoadContext::config_dir, fsw::script::ParseResult::diagnostics, fsw::script::ScriptProgram::empty(), sequencer::ScriptLoadContext::fire_state, sequencer::StateMachine::fromName(), sequencer::ScriptLoadContext::has_actuator_column, is_valid_script_filename(), sequencer::StateMachine::isAllowed(), kMaxScriptTimeoutMs, sequencer::DynamicState::name, fsw::script::ParseResult::ok(), fsw::script::parse(), sequencer::DynamicState::pressure_roles, fsw::script::ParseResult::program, sequencer::DynamicState::program, fsw::script::PtSensor, readFile(), sequencer::DynamicState::return_target, sequencer::DynamicState::slug_names, sequencer::DynamicState::slug_states, fsw::script::slugify(), fsw::script::ScriptProgram::slugs, fsw::script::State, sequencer::DynamicState::state, sequencer::ScriptLoadContext::state_machine, tables(), sequencer::DynamicState::timeout_ms, sequencer::DynamicState::timeout_target, UNKNOWN, and fsw::script::validate().
Referenced by sequencer::SequencerService::applyConfig().
|
static |
Definition at line 49 of file SequencerService.cpp.
Referenced by sequencer::SequencerService::publishState(), and sequencer::SequencerService::publishStateTransition().
|
inline |
Parse a hold duration off the wire, strictly.
Strictly, because the lenient version of this is a hazard: atoi("1e3") returns 1, so a frame asking for a thousand seconds would have quietly run a one-millisecond pulse and the operator would have weighed a mass against a window that never happened. The whole string must be digits.
Rejects: empty, non-digits, a leading sign, trailing junk, anything over kMaxHoldMs, and zero — zero is the "no duration supplied" sentinel everywhere else, so it must never arrive as one.
| out | written only on success. |
Definition at line 31 of file HoldParse.hpp.
References b, kMaxHoldMs, and res.
Referenced by anonymous_namespace{sequencer_main.cpp}::handleCommandLine(), and main().
|
static |
Definition at line 140 of file SequencerService.cpp.
Referenced by load_dynamic_states(), and sequencer::SequencerService::loadConfig().
|
static |
Definition at line 192 of file SequencerService.cpp.
Referenced by sequencer::SequencerService::applyConfig().
|
static |
Definition at line 52 of file ActuatorCommander.cpp.
Referenced by sequencer::ActuatorCommander::findStateActuators(), sequencer::ActuatorCommander::sendSingleActuator(), and sequencer::ActuatorCommander::setManualOverride().
|
static |
Definition at line 216 of file StateMachine.cpp.
Referenced by sequencer::StateMachine::load().
|
static |
Definition at line 46 of file ActuatorCommander.cpp.
Referenced by sequencer::ActuatorCommander::load().
|
staticconstexpr |
Definition at line 39 of file SequencerService.cpp.
Referenced by sequencer::SequencerService::notifyControllerFireOnce().
|
inlineconstexpr |
Hard ceiling on any client-supplied hold, independent of per-state config.
This is not the real limit — each holdable state carries its own, usually far smaller, max. This one exists so a typo or a garbage frame is rejected at the wire before it reaches anything that has to reason about it.
Definition at line 16 of file HoldParse.hpp.
Referenced by main(), and parseHoldMs().
|
inlineconstexpr |
Hard ceiling on script_timeout_ms, independent of per-state config.
Same posture as HoldParse's kMaxHoldMs: this is not the real limit — each state carries its own, usually far smaller — it exists so a typo cannot arm a valve-open window measured in hours.
Definition at line 20 of file ScriptStates.hpp.
Referenced by load_dynamic_states(), and main().
|
staticconstexpr |
Definition at line 32 of file SequencerService.cpp.
Referenced by sequencer::SequencerService::publishState().
|
staticconstexpr |
Definition at line 33 of file SequencerService.cpp.
Referenced by sequencer::SequencerService::publishStateTransition().