#include <atomic>
#include <chrono>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <string>
#include <thread>
#include "BoardListener.hpp"
#include "control/ScriptStates.hpp"
#include "control/SequencerService.hpp"
#include "control/StateMachine.hpp"
Go to the source code of this file.
|
| struct | Cfg |
| | Everything a case may vary. More...
|
| struct | Attempt |
| | Bring a service up on cfg, try to enter Dyn State, and report what happened. More...
|
|
| enum class | State |
| | System state IDs — must match the TypeScript SystemState enum in web-gui/shared/types.ts. More...
|
|
| static void | check (bool ok, const std::string &what) |
| static std::string | writeConfig (const Cfg &f) |
| static Attempt | attemptEntry (const std::string &cfg_path, const char *target="Dyn State") |
| static void | refuses (const Cfg &f, const std::string &what) |
| | A refusal case: the state must not be enterable AND no board may hear anything.
|
| int | main () |
◆ State
System state IDs — must match the TypeScript SystemState enum in web-gui/shared/types.ts.
Definition at line 14 of file StateMachine.hpp.
◆ attemptEntry()
| Attempt attemptEntry |
( |
const std::string & | cfg_path, |
|
|
const char * | target = "Dyn State" ) |
|
static |
Definition at line 186 of file test_script_states.cpp.
References a, daqtest::BoardListener::bursts(), sequencer::SequencerService::currentState(), daqtest::firstCommand(), sequencer::SequencerService::init(), kActPort, daqtest::BoardListener::start(), daqtest::BoardListener::stop(), target, and sequencer::SequencerService::transitionTo().
Referenced by main(), and refuses().
◆ check()
| void check |
( |
bool | ok, |
|
|
const std::string & | what ) |
|
static |
◆ main()
Definition at line 229 of file test_script_states.cpp.
References a, attemptEntry(), check(), Cfg::drop_actuator_column, StateMachine::fromName(), g_dir, g_failures, sequencer::SequencerService::init(), Cfg::is_abort, Cfg::is_flow, sequencer::kMaxScriptTimeoutMs, Cfg::on_fire_state, refuses(), Cfg::return_target, Cfg::script_body, Cfg::script_file, sequencer::SequencerService::scriptStatusReport(), Cfg::timeout_ms, Cfg::timeout_target, Cfg::write_script, and writeConfig().
◆ refuses()
| void refuses |
( |
const Cfg & | f, |
|
|
const std::string & | what ) |
|
static |
◆ writeConfig()
| std::string writeConfig |
( |
const Cfg & | f | ) |
|
|
static |
Definition at line 64 of file test_script_states.cpp.
References a, Cfg::drop_actuator_column, g_dir, Cfg::is_abort, Cfg::is_flow, kActPort, o, Cfg::on_fire_state, Cfg::return_target, Cfg::script_body, Cfg::script_file, fs::path::string(), Cfg::timeout_ms, Cfg::timeout_target, and Cfg::write_script.
Referenced by main(), and refuses().
◆ g_dir
◆ g_failures
◆ kActPort
| uint16_t kActPort = 45917 |
|
staticconstexpr |