|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <unistd.h>#include <chrono>#include <cstdio>#include <filesystem>#include <fstream>#include <iostream>#include <string>#include <thread>#include "BoardListener.hpp"#include "control/SequencerService.hpp"#include "control/StateMachine.hpp"Go to the source code of this file.
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) |
| template<typename F> | |
| static std::string | captureStdout (F &&body) |
| Channel 1 = Vent Valve (column always CLOSE — only a script opens it), 2 = Main Valve. | |
| static std::string | writeConfig (const std::string &script, uint32_t timeout_ms, const std::string &return_target, const std::string &timeout_target) |
| static long long | waitForState (SequencerService &svc, State want, int timeout_ms) |
| int | main () |
| long long | firstCommand (const std::vector< Burst > &bursts, uint8_t ch, uint8_t hw, long long after_ms=-1) |
| When ch was first commanded to hw at or after after_ms. | |
Variables | |
| static int | g_failures = 0 |
| static fs::path | g_dir |
| static constexpr uint16_t | kActPort = 45919 |
| static constexpr uint16_t | kAbortPort = 15007 |
|
strong |
System state IDs — must match the TypeScript SystemState enum in web-gui/shared/types.ts.
Definition at line 14 of file StateMachine.hpp.
|
static |
Channel 1 = Vent Valve (column always CLOSE — only a script opens it), 2 = Main Valve.
Run body with stdout redirected to a file, and give back what it printed.
The diagnostics these tests pin are log lines and nothing else — they exist so an operator can tell a loop that never ran from one that ran and timed out, which are the two outcomes that looked identical on the stand. Asserting on the text is the only way to keep them honest.
Definition at line 64 of file test_script_runtime.cpp.
References g_dir.
Referenced by main().
|
static |
Definition at line 44 of file test_script_runtime.cpp.
References g_failures, and ok.
Referenced by main().
|
inline |
When ch was first commanded to hw at or after after_ms.
-1 if it never was.
Definition at line 133 of file BoardListener.hpp.
Referenced by main().
| int main | ( | ) |
Definition at line 153 of file test_script_runtime.cpp.
References b, daqtest::BoardListener::bursts(), captureStdout(), check(), sequencer::SequencerService::currentState(), firstCommand(), g_dir, g_failures, IDLE, sequencer::SequencerService::init(), kAbortPort, kActPort, sequencer::SequencerService::manualActuator(), sequencer::SequencerService::scriptStatusReport(), sequencer::SequencerService::setDebugMode(), daqtest::BoardListener::start(), daqtest::BoardListener::stop(), sequencer::SequencerService::transitionTo(), waitForState(), and writeConfig().
|
static |
Definition at line 140 of file test_script_runtime.cpp.
References sequencer::SequencerService::currentState().
Referenced by main().
|
static |
Definition at line 78 of file test_script_runtime.cpp.
References a, g_dir, kAbortPort, kActPort, and fs::path::string().
Referenced by main().
|
static |
Definition at line 50 of file test_script_runtime.cpp.
|
static |
Definition at line 42 of file test_script_runtime.cpp.
|
staticconstexpr |
Definition at line 52 of file test_script_runtime.cpp.
|
staticconstexpr |
Definition at line 51 of file test_script_runtime.cpp.
Referenced by attemptEntry(), main(), writeConfig(), and writeConfig().