diff --git a/receiver/JFJochReceiverRugnuxRotation.cpp b/receiver/JFJochReceiverRugnuxRotation.cpp index 87c1d8b1b..9ba232608 100644 --- a/receiver/JFJochReceiverRugnuxRotation.cpp +++ b/receiver/JFJochReceiverRugnuxRotation.cpp @@ -144,8 +144,10 @@ JFJochReceiverRugnuxRotation::~JFJochReceiverRugnuxRotation() { void JFJochReceiverRugnuxRotation::OnStart(std::chrono::steady_clock::time_point received) { SendStartMessage(); - // Rugnux reads the images back from the buffer: without one slot per image the collection is only forwarded - const auto slots = image_buffer.GetStatus().total_slots; + // Rugnux reads the images back from the buffer: without one slot per image the collection is only forwarded. + // The service counted the slots the same way before the start; this is repeated because the start message + // sets the bit depth, so the slot size may have grown since. + const int64_t slots = image_buffer.GetBufferSize() / experiment.GetImageBufferLocationSize(); // The image time as the detector produces images, summation included const double image_time_s = std::chrono::duration(experiment.GetImageTime()).count(); std::optional expected_collection_s; diff --git a/tests/JFJochReceiverRugnuxTest.cpp b/tests/JFJochReceiverRugnuxTest.cpp index 7f95dfcb6..18789f6c5 100644 --- a/tests/JFJochReceiverRugnuxTest.cpp +++ b/tests/JFJochReceiverRugnuxTest.cpp @@ -826,9 +826,15 @@ TEST_CASE("JFJochReceiverRugnux_Rotation_DoesNotFit", "[JFJochReceiverRugnux]") const auto out = service.Stop(); CHECK(out.status.images_collected == images); - CHECK(out.scan_result.images.size() == images); CHECK(pusher.Events() == std::vector{"start", "image", "end"}); CHECK(out.analysis_warning.find("image buffer") != std::string::npos); + // The Lite receiver took the collection: every image has its spot finding, and the per-image plots are there + REQUIRE(out.scan_result.images.size() == images); + for (const auto &i: out.scan_result.images) + CHECK(i.spot_count.has_value()); + const auto spot_plot = service.GetDataProcessingPlot(PlotRequest{.type = PlotType::SpotCount, .binning = 1}); + REQUIRE(spot_plot.GetPlots().size() == 1); + CHECK(spot_plot.GetPlots()[0].x.size() == images); const auto live = service.GetRugnuxStatus(); CHECK(live.state == RugnuxLiveState::Skipped); CHECK(live.message.find("image buffer") != std::string::npos);