broker: initialize clears the image buffer, turns live rugnux off and removes its model

Initialize is the fresh start between users, so nothing of the previous one's session is left:
the image buffer is cleared, live rugnux processing is disabled and the uploaded MR model is
dropped. It is done at the start of Initialize, under m then rugnux_mutex (the order the other
setters take), so it happens even if configuring the detector then fails. The receiver is always
Idle when the state machine is not running, so the buffer clear has no unmet precondition.

The dashboard's rugnux panel read the settings only once, on mount, so after an initialize from
any client it kept showing the previous run; it now polls them like the Rugnux tab does.

The /initialize description in jfjoch_api.yaml says so; the frontend client is regenerated
(description only). The python client docs and redoc follow at the release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXc1zD1yxHqaR1DGdCTHL4
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-19 22:11:51 +02:00
1 parent aa05882c46
commit c2e5e4a4e8
6 files changed
+37 -2

No files matched your search

+19
View File
@@ -30,6 +30,25 @@ TEST_CASE("JFJochStateMachine_States") {
REQUIRE(state_machine.GetStatus().state == JFJochState::Inactive);
}
TEST_CASE("JFJochStateMachine_Initialize_DisablesRugnux") {
Logger logger("JFJochStateMachine_Initialize_DisablesRugnux");
JFJochServices services(logger);
DiffractionExperiment experiment;
JFJochStateMachine state_machine(experiment, services, logger);
state_machine.AddDetectorSetup(DetJF4M());
state_machine.SetRugnuxLive(true, 4, 30.0);
REQUIRE(state_machine.GetRugnuxLive().enable);
REQUIRE_NOTHROW(state_machine.Initialize());
REQUIRE_NOTHROW(state_machine.WaitTillMeasurementDone());
const auto s = state_machine.GetRugnuxLive();
CHECK(!s.enable);
CHECK(s.model == nullptr);
CHECK(s.model_size_bytes == 0);
}
TEST_CASE("JFJochStateMachine_State_Pedestal") {
Logger logger("JFJochStateMachine_State_Pedestal");
JFJochServices services(logger);