From 472759ee0bb37cd170b63c8f02efbf13c58766cd Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Wed, 18 Nov 2026 19:53:42 +0100 Subject: [PATCH] FPGAImagePuller: a silent end stops the cards and still delivers what they have The broker ends every run with a silent cancel once the detector is done (JFJochServices -> JFJochReceiverService::Cancel(true)). With every image now waiting for the receiver, a full cancel there would cut the images still on their way. StopCards() stops the cards and lets what they hold through, then the end message; Cancel() is StopCards() plus "the receiver takes no more images". The service uses StopCards() for a silent cancel and Cancel() otherwise. Stop() still cancels first, for a receiver that ended on an error. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQrPqZ52Tp6rzzZGxf3 --- receiver/JFJochReceiverService.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/receiver/JFJochReceiverService.cpp b/receiver/JFJochReceiverService.cpp index d7f44b31c..22beb46c2 100644 --- a/receiver/JFJochReceiverService.cpp +++ b/receiver/JFJochReceiverService.cpp @@ -241,7 +241,10 @@ void JFJochReceiverService::Cancel(bool silent) { std::unique_lock ul(state_mutex); if (state == ReceiverState::Running) { receiver->Cancel(silent); - if (fpga_puller) + // Silent: the detector has finished, and what the cards have got still goes to the receiver + if (fpga_puller && silent) + fpga_puller->StopCards(); + else if (fpga_puller) fpga_puller->Cancel(); } }