Monolithic design achieved! (jfjoch_broker is NOT up to date!)

This commit is contained in:
2023-11-14 18:23:43 +01:00
parent 2b6901af58
commit 3f7fc04d84
29 changed files with 176 additions and 824 deletions
+3 -55
View File
@@ -585,58 +585,6 @@ TEST_CASE("DiffractionExperiment_StorageCells_Pedestal","[DiffractionExperiment]
REQUIRE(x.GetFrameNumPerTrigger() == 2);
}
TEST_CASE("DiffractionExperiment_DetectorInput_MultiTriggger","[DiffractionExperiment]") {
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
x.FrameTime(700us).ImagesPerTrigger(350).NumTriggers(7);
JFJochProtoBuf::DetectorInput ret = x;
REQUIRE(ret.modules_num() == 8);
REQUIRE(ret.period_us() == x.GetFrameTime().count());
REQUIRE(ret.count_time_us() == x.GetFrameCountTime().count());
REQUIRE(ret.num_triggers() == 8);
REQUIRE(ret.num_frames() == 350);
REQUIRE(ret.storage_cell_number() == 1);
REQUIRE(ret.mode() == JFJochProtoBuf::CONVERSION);
}
TEST_CASE("DiffractionExperiment_DetectorInput_NoTriggger","[DiffractionExperiment]") {
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
x.FrameTime(1200us).ImagesPerTrigger(350).NumTriggers(1);
JFJochProtoBuf::DetectorInput ret = x;
REQUIRE(ret.modules_num() == 8);
REQUIRE(ret.period_us() == x.GetFrameTime().count());
REQUIRE(ret.count_time_us() == x.GetFrameCountTime().count());
REQUIRE(ret.num_triggers() == 1);
REQUIRE(ret.num_frames() == 350 + DELAY_FRAMES_STOP_AND_QUIT);
REQUIRE(ret.storage_cell_number() == 1);
REQUIRE(ret.mode() == JFJochProtoBuf::CONVERSION);
}
TEST_CASE("DiffractionExperiment_DetectorInput_PedestalG2","[DiffractionExperiment]") {
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
x.FrameTime(1200us).PedestalG2Frames(4560).NumTriggers(1).Mode(DetectorMode::PedestalG2);
JFJochProtoBuf::DetectorInput ret = x;
REQUIRE(ret.modules_num() == 8);
REQUIRE(ret.period_us() == x.GetFrameTime().count());
REQUIRE(ret.count_time_us() == x.GetFrameCountTime().count());
REQUIRE(ret.num_triggers() == 1);
REQUIRE(ret.num_frames() == 4560 + DELAY_FRAMES_STOP_AND_QUIT);
REQUIRE(ret.storage_cell_number() == 1);
}
TEST_CASE("DiffractionExperiment_DetectorInput_StorageCell","[DiffractionExperiment]") {
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
x.FrameTime(1200us).NumTriggers(4560).StorageCells(8).StorageCellDelay(7000ns);
JFJochProtoBuf::DetectorInput ret = x;
REQUIRE(ret.modules_num() == 8);
REQUIRE(ret.period_us() == 8 * (x.GetFrameTime().count() + 10));
REQUIRE(ret.count_time_us() == x.GetFrameCountTime().count());
REQUIRE(ret.num_triggers() == 4560 + 1);
REQUIRE(ret.num_frames() == 1);
REQUIRE(ret.storage_cell_number() == 8);
REQUIRE(ret.storage_cell_delay_ns() == 7000);
REQUIRE(ret.storage_cell_start() == x.GetStorageCellStart());
}
TEST_CASE("DiffractionExperiment_DefaultDataProcessingSettings","[DiffractionExperiment]") {
REQUIRE_NOTHROW(DiffractionExperiment::CheckDataProcessingSettings(
DiffractionExperiment::DefaultDataProcessingSettings()));
@@ -680,7 +628,6 @@ TEST_CASE("DiffractionExperiment_FPGA_Summation_output","[DiffractionExperiment]
TEST_CASE("DiffractionExperiment_DetectorModuleHostname","[DiffractionExperiment]") {
std::vector<std::string> h = {"mx1", "mx2", "mx3"};
DiffractionExperiment x(DetectorSetup(3, "X", h));
JFJochProtoBuf::DetectorConfig det_cfg;
std::vector<AcquisitionDeviceNetConfig> net_cfg;
@@ -695,9 +642,10 @@ TEST_CASE("DiffractionExperiment_DetectorModuleHostname","[DiffractionExperiment
.udp_port = 1234});
std::vector<std::string> h_out;
REQUIRE_NOTHROW(x.GetDetectorModuleHostname(h_out));
REQUIRE_NOTHROW(h_out = x.GetDetectorModuleHostname());
REQUIRE(h == h_out);
REQUIRE_NOTHROW(det_cfg = x.DetectorConfig(net_cfg));
auto det_cfg = x.GetDetectorModuleConfig(net_cfg);
REQUIRE(det_cfg.size() == x.GetModulesNum());
}