JFJochReceiver: Give one plot at a time

This commit is contained in:
2023-04-18 13:55:43 +02:00
parent 962edaa4ad
commit 25cb4df0bf
21 changed files with 186 additions and 152 deletions

View File

@@ -814,13 +814,27 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_background_estimation", "[JFJochReceiver]")
REQUIRE_NOTHROW(state_machine.Stop());
logger.Info("Stopped measurement");
JFJochProtoBuf::ReceiverDataProcessingPlots plots;
REQUIRE(fpga_receiver.GetDataProcessingPlots(nullptr, nullptr, &plots).ok());
JFJochProtoBuf::PlotRequest req;
req.set_type(JFJochProtoBuf::BKG_ESTIMATE);
req.set_binning(10);
REQUIRE(plots.bkg_estimate().x_size() == 1);
REQUIRE(plots.bkg_estimate().y_size() == 1);
REQUIRE(plots.bkg_estimate().x(0) == Approx(4.5));
REQUIRE(plots.bkg_estimate().y(0) == Approx((5 + 23) / 2.0));
JFJochProtoBuf::Plot plot;
REQUIRE(fpga_receiver.GetDataProcessingPlots(nullptr, &req, &plot).ok());
REQUIRE(plot.x_size() == 1);
REQUIRE(plot.y_size() == 1);
REQUIRE(plot.x(0) == Approx(4.5));
REQUIRE(plot.y(0) == Approx((5 + 23) / 2.0));
req.set_type(JFJochProtoBuf::BKG_ESTIMATE);
req.set_binning(1);
REQUIRE(fpga_receiver.GetDataProcessingPlots(nullptr, &req, &plot).ok());
REQUIRE(plot.x_size() == 10);
REQUIRE(plot.y_size() == 10);
req.set_binning(0);
REQUIRE(!fpga_receiver.GetDataProcessingPlots(nullptr, &req, &plot).ok());
auto tmp = state_machine.GetMeasurementStatistics();
REQUIRE(tmp.has_value());