STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_script_states.cpp File Reference
#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"
Include dependency graph for test_script_states.cpp:

Go to the source code of this file.

Classes

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...

Enumerations

enum class  State
 System state IDs — must match the TypeScript SystemState enum in web-gui/shared/types.ts. More...

Functions

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 ()

Variables

static int g_failures = 0
static fs::path g_dir
static constexpr uint16_t kActPort = 45917

Enumeration Type Documentation

◆ State

enum class sequencer::State : uint8_t
strong

System state IDs — must match the TypeScript SystemState enum in web-gui/shared/types.ts.

Definition at line 14 of file StateMachine.hpp.

Function Documentation

◆ attemptEntry()

◆ check()

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

Definition at line 35 of file test_script_states.cpp.

References g_failures, and ok.

Referenced by main(), and refuses().

◆ main()

◆ refuses()

void refuses ( const Cfg & f,
const std::string & what )
static

A refusal case: the state must not be enterable AND no board may hear anything.

Definition at line 217 of file test_script_states.cpp.

References a, attemptEntry(), check(), StateMachine::name(), ok, and writeConfig().

Referenced by main().

◆ writeConfig()

Variable Documentation

◆ g_dir

fs::path g_dir
static

Definition at line 41 of file test_script_states.cpp.

◆ g_failures

int g_failures = 0
static

Definition at line 33 of file test_script_states.cpp.

◆ kActPort

uint16_t kActPort = 45917
staticconstexpr

Definition at line 42 of file test_script_states.cpp.