rugnux live: the rotation receiver counts its slots as the service does
The service decides on GetBufferSize() / GetImageBufferLocationSize() before the start; the receiver now repeats the same expression after the start message, which sets the bit depth and so may enlarge the slot. The buffer-too-small test now also checks that the Lite receiver took the collection: every image has its spot finding and the per-image plot has a point per image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK
This commit is contained in:
1 parent
807f791b3f
commit
8b0f654679
2 files changed
+11
-3
No files matched your search
@@ -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<double>(experiment.GetImageTime()).count();
|
||||
std::optional<double> expected_collection_s;
|
||||
|
||||
@@ -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<std::string>{"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);
|
||||
|
||||
Reference in new issue
Block a user