Tests: receiver, state machine and writer tests on MockAcquisitionDevice; FPGAIntegrationTest removed
The host-side tests run on the mock instead of the HLS simulation: JFJochReceiverIntegrationTest, JFJochReceiverProcessingTest (the GPU-stills cases too, in raw mode the card writes the generator's frame), JFJochStateMachineTest, StreamWriterTest. tests/MockCardOutput.h gives the mock what the card would write for a test's image - its conversion by the host's floating-point reference, pixel statistics, ROI counts and the strong pixels of the CPU spot finder - so the checks of the receiver's images and plots stay as they were. Two cases are new: a receiver on two cards at once (not possible with the HLS simulation) and a cancelled pedestal run. FPGAIntegrationTest.cpp (60 cases) tested the HLS device itself - conversion, summation, spot finder, integration, ROI, ADU histogram, pixel counts, in every mode - and is removed, not ported. Its host-side checks (FPGAAcquisitionDevice and AcquisitionCounters: the internal generator, data streams, missing modules, delays, lost frames, the last frame, bunch ID, the generator's memory limit) are FPGAAcquisitionDeviceTest.cpp on the mock, plus a check that the generator's frames are what the mock writes. Fromce8918062and710edd61e(rc186), resolved against rc188: JFJochReceiverTest() without quick_integrate, the FPGA receiver that indexes and does not integrate, StillsGPUAnalysisFPGA. JFJochReceiverFPGA_RugnuxOnStaysPerImage is not taken (rc188 keeps live stills on the FPGA receiver). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UqXYdHHZ4cogS1mrGUtfN7
This commit is contained in:
1 parent
fc6e3512a4
commit
cb95938bc7
10 files changed
+788
-3241
No files matched your search
@@ -8,7 +8,7 @@
|
||||
|
||||
#define STORAGE_CELL_FOR_TEST 11
|
||||
|
||||
static JFCalibration GeneratePedestalCalibration(const DiffractionExperiment &x) {
|
||||
JFCalibration GeneratePedestalCalibration(const DiffractionExperiment &x) {
|
||||
JFCalibration ret(x);
|
||||
|
||||
std::vector<float> pedestal_g0( RAW_MODULE_SIZE), pedestal_g1(RAW_MODULE_SIZE), pedestal_g2(RAW_MODULE_SIZE);
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// The calibration JFJochReceiverTest() converts with
|
||||
JFCalibration GeneratePedestalCalibration(const DiffractionExperiment &x);
|
||||
|
||||
bool JFJochReceiverTest(JFJochReceiverOutput &output, Logger &logger,
|
||||
AcquisitionDeviceGroup &aq_devices,
|
||||
const DiffractionExperiment &x,
|
||||
|
||||
@@ -69,8 +69,9 @@ ADD_EXECUTABLE(jfjoch_test
|
||||
../common/RawToConvertedGeometry.h
|
||||
../common/DiffractionExperiment.h
|
||||
CheckImageOutput.h
|
||||
FPGAIntegrationTest.cpp
|
||||
MockCardOutput.h
|
||||
MockAcquisitionDeviceTest.cpp
|
||||
FPGAAcquisitionDeviceTest.cpp
|
||||
StrongPixelSetTest.cpp
|
||||
AdaptiveThresholdTest.cpp
|
||||
AdaptiveSpotFinderCPUTest.cpp
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
// The host side of the card - FPGAAcquisitionDevice and its AcquisitionCounters - on the mock of the card: what
|
||||
// arrived, where it went, delays, the end of the data collection. The card itself is compared with the mock in
|
||||
// MockAcquisitionDeviceTest.cpp.
|
||||
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../acquisition_device/MockAcquisitionDevice.h"
|
||||
|
||||
TEST_CASE("FPGAAcquisitionDevice_InternalPacketGenerator", "[FPGAAcquisitionDevice]") {
|
||||
const uint16_t nmodules = 4;
|
||||
DiffractionExperiment x(DetJF(nmodules));
|
||||
x.Raw();
|
||||
x.UseInternalPacketGenerator(true).ImagesPerTrigger(4).PedestalG0Frames(0);
|
||||
|
||||
MockAcquisitionDevice test(0, 64);
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * 4 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
for (int image = 0; image < 4; image++) {
|
||||
for (int m = 0; m < nmodules; m++) {
|
||||
const auto &stats = test.GetDeviceOutput(image, m)->module_statistics;
|
||||
CHECK(stats.frame_number == image);
|
||||
CHECK(stats.module_number == m);
|
||||
CHECK(stats.timestamp == INT_PKT_GEN_EXPTTIME * image);
|
||||
CHECK(stats.pulse_id == INT_PKT_GEN_BUNCHID + image);
|
||||
CHECK(stats.exptime == INT_PKT_GEN_EXPTTIME);
|
||||
CHECK(stats.detector_type == SLS_DETECTOR_TYPE_JUNGFRAU);
|
||||
}
|
||||
}
|
||||
REQUIRE(test.GetExpectedDescriptorsPerModule() == DMA_DESCRIPTORS_PER_MODULE);
|
||||
}
|
||||
|
||||
// Of four data streams, the card of the last one generates only its own module
|
||||
TEST_CASE("FPGAAcquisitionDevice_InternalPacketGenerator_DataStream", "[FPGAAcquisitionDevice]") {
|
||||
const uint16_t nmodules = 4;
|
||||
DiffractionExperiment x(DetJF(nmodules));
|
||||
x.DataStreams(4);
|
||||
x.Raw();
|
||||
x.UseInternalPacketGenerator(true).ImagesPerTrigger(4).PedestalG0Frames(0);
|
||||
|
||||
MockAcquisitionDevice test(3, 64);
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * 4 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
for (int image = 0; image < 4; image++)
|
||||
REQUIRE(test.Counters().IsFullModuleCollected(image, 0));
|
||||
}
|
||||
|
||||
// Module 0 runs on, module 1 stops after 3 frames, modules 2 and 3 never come: the slowest frame moves on once the
|
||||
// fastest module is far enough ahead
|
||||
TEST_CASE("FPGAAcquisitionDevice_MissingModules", "[FPGAAcquisitionDevice]") {
|
||||
const uint16_t nmodules = 4;
|
||||
const uint64_t nframes = AcquisitionCounters::ThresholdFramesLost + 5;
|
||||
|
||||
DiffractionExperiment x(DetJF(nmodules));
|
||||
x.Raw();
|
||||
x.PedestalG0Frames(0).ImagesPerTrigger(nframes).NumTriggers(1);
|
||||
|
||||
MockAcquisitionDevice test(0, nframes + 2);
|
||||
test.CreateJFPackets(x, 1, nframes, 0, nullptr);
|
||||
test.CreateJFPackets(x, 1, 3, 1, nullptr);
|
||||
test.CreateFinalPacket(x);
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.Counters().GetSlowestFrameNumber() == 5 - 1);
|
||||
REQUIRE(test.Counters().GetBufferHandle(0, 0) != AcquisitionCounters::HandleNotFound);
|
||||
REQUIRE(test.Counters().GetBufferHandle(0, 1) == AcquisitionCounters::HandleNotFound);
|
||||
REQUIRE(test.Counters().GetBufferHandle(0, 2) == AcquisitionCounters::HandleNotFound);
|
||||
REQUIRE(test.GetBytesReceived() == nframes * 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
}
|
||||
|
||||
TEST_CASE("FPGAAcquisitionDevice_Delay", "[FPGAAcquisitionDevice]") {
|
||||
const uint16_t nmodules = 4;
|
||||
DiffractionExperiment x(DetJF(nmodules));
|
||||
x.Raw();
|
||||
x.PedestalG0Frames(0).ImagesPerTrigger(3).NumTriggers(1);
|
||||
|
||||
MockAcquisitionDevice test(0, 64);
|
||||
for (int f = 1; f <= 3; f++)
|
||||
for (int m = 0; m < nmodules; m++)
|
||||
test.CreateJFPacket(x, f, 0, m, nullptr);
|
||||
test.CreateFinalPacket(x);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.Counters().CalculateDelay(0) == 2);
|
||||
REQUIRE(test.Counters().CalculateDelay(0, 0) == 2);
|
||||
REQUIRE(test.Counters().CalculateDelay(1) == 1);
|
||||
REQUIRE(test.Counters().CalculateDelay(1, 0) == 1);
|
||||
REQUIRE(test.Counters().CalculateDelay(2) == 0);
|
||||
REQUIRE(test.Counters().CalculateDelay(2, 0) == 0);
|
||||
}
|
||||
|
||||
// A single packet of one module: that module of that frame is there, nothing else is
|
||||
TEST_CASE("FPGAAcquisitionDevice_LostFrame", "[FPGAAcquisitionDevice]") {
|
||||
const uint16_t nmodules = 4;
|
||||
DiffractionExperiment x(DetJF(nmodules));
|
||||
x.Raw();
|
||||
x.PedestalG0Frames(0).ImagesPerTrigger(3).NumTriggers(1);
|
||||
|
||||
MockAcquisitionDevice test(0, 64);
|
||||
test.CreateJFPacket(x, 1, 0, 0, nullptr);
|
||||
test.CreateFinalPacket(x);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
REQUIRE_NOTHROW(test.GetDeviceOutput(0, 0));
|
||||
REQUIRE(!test.Counters().IsFullModuleCollected(0, 0));
|
||||
REQUIRE_THROWS(test.GetDeviceOutput(0, 1));
|
||||
REQUIRE_THROWS(test.GetDeviceOutput(1, 0));
|
||||
REQUIRE_THROWS(test.GetDeviceOutput(2, 1));
|
||||
}
|
||||
|
||||
TEST_CASE("FPGAAcquisitionDevice_OneFrame", "[FPGAAcquisitionDevice]") {
|
||||
const uint16_t nmodules = 4;
|
||||
DiffractionExperiment x(DetJF(nmodules));
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1);
|
||||
|
||||
MockAcquisitionDevice test(0, 64);
|
||||
test.CreateJFPackets(x, 1, 1, 0, nullptr);
|
||||
test.CreateFinalPacket(x);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
test.WaitForActionComplete();
|
||||
REQUIRE(test.Counters().IsAcquisitionFinished());
|
||||
|
||||
// address properly aligned
|
||||
REQUIRE((uint64_t) test.GetDeviceOutput(0, 0)->pixels % 128 == 0);
|
||||
|
||||
REQUIRE(test.Counters().GetSlowestFrameNumber() == 0);
|
||||
REQUIRE(test.Counters().GetCurrFrameNumber(0) == 0);
|
||||
REQUIRE(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
}
|
||||
|
||||
// A frame far past the last one ends the data collection
|
||||
TEST_CASE("FPGAAcquisitionDevice_DetectLastFrame", "[FPGAAcquisitionDevice]") {
|
||||
const uint16_t nmodules = 4;
|
||||
DiffractionExperiment x(DetJF(nmodules));
|
||||
x.PedestalG0Frames(0).NumTriggers(2).ImagesPerTrigger(5);
|
||||
|
||||
MockAcquisitionDevice test(0, 64);
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE(!test.Counters().IsAcquisitionFinished());
|
||||
|
||||
test.CreateJFPacket(x, 15, 0, 0, nullptr);
|
||||
test.WaitForActionComplete();
|
||||
REQUIRE(test.Counters().IsAcquisitionFinished());
|
||||
}
|
||||
|
||||
TEST_CASE("FPGAAcquisitionDevice_BunchID", "[FPGAAcquisitionDevice]") {
|
||||
const uint64_t bunchid = 0xAAAAAAAA87345600;
|
||||
DiffractionExperiment x(DetJF(4));
|
||||
x.Raw();
|
||||
x.PedestalG0Frames(0).ImagesPerTrigger(3).NumTriggers(1);
|
||||
|
||||
MockAcquisitionDevice test(0, 64);
|
||||
test.CreateXfelBunchIDPacket(bunchid, 0);
|
||||
test.CreateFinalPacket(x);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 0);
|
||||
REQUIRE(test.GetDataCollectionStatus().current_pulseid == bunchid);
|
||||
}
|
||||
|
||||
TEST_CASE("FPGAAcquisitionDevice_InternalGeneratorMemory", "[FPGAAcquisitionDevice]") {
|
||||
// 64 module frames in the card memory; the generator takes 63 at most
|
||||
DiffractionExperiment x(DetJF(2));
|
||||
x.UseInternalPacketGenerator(true).ImagesPerTrigger(1).NumTriggers(1);
|
||||
MockAcquisitionDevice test(0, 64);
|
||||
|
||||
x.InternalPacketGeneratorImages(31);
|
||||
REQUIRE_NOTHROW(test.PrepareAction(x));
|
||||
|
||||
x.InternalPacketGeneratorImages(32);
|
||||
REQUIRE_THROWS(test.PrepareAction(x));
|
||||
|
||||
std::vector<uint16_t> frame(RAW_MODULE_SIZE);
|
||||
REQUIRE_NOTHROW(test.SetInternalGeneratorFrame(frame.data(), 62));
|
||||
REQUIRE_THROWS(test.SetInternalGeneratorFrame(frame.data(), 63));
|
||||
}
|
||||
|
||||
// The generator's frames are what the card writes when no output was set for a module
|
||||
TEST_CASE("FPGAAcquisitionDevice_InternalGeneratorFrames", "[FPGAAcquisitionDevice]") {
|
||||
const uint16_t nmodules = 2;
|
||||
DiffractionExperiment x(DetJF(nmodules));
|
||||
x.Raw();
|
||||
x.UseInternalPacketGenerator(true).InternalPacketGeneratorImages(2).ImagesPerTrigger(5).PedestalG0Frames(0);
|
||||
|
||||
MockAcquisitionDevice test(0, 64);
|
||||
std::vector<uint16_t> frame(RAW_MODULE_SIZE);
|
||||
for (int slot = 0; slot < 4; slot++) {
|
||||
std::fill(frame.begin(), frame.end(), 100 + slot);
|
||||
test.SetInternalGeneratorFrame(frame.data(), slot);
|
||||
}
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
for (int image = 0; image < 5; image++) {
|
||||
for (int m = 0; m < nmodules; m++) {
|
||||
const auto pixels = reinterpret_cast<const uint16_t *>(test.GetDeviceOutput(image, m)->pixels);
|
||||
CHECK(pixels[0] == 100 + (image % 2) * nmodules + m);
|
||||
CHECK(pixels[RAW_MODULE_SIZE - 1] == 100 + (image % 2) * nmodules + m);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -4,7 +4,7 @@
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../receiver/JFJochReceiverTest.h"
|
||||
#include "../acquisition_device/HLSSimulatedDevice.h"
|
||||
#include "MockCardOutput.h"
|
||||
#include "../jungfrau/JFPedestalCalc.h"
|
||||
#include "../image_pusher/TestImagePusher.h"
|
||||
#include "../receiver/JFJochReceiverService.h"
|
||||
@@ -19,15 +19,11 @@ TEST_CASE("JFJochReceiverTest_Raw", "[JFJochReceiver]") {
|
||||
x.PedestalG0Frames(0).NumTriggers(1).UseInternalPacketGenerator(true)
|
||||
.ImagesPerTrigger(100).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::NO_COMPRESSION);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
Logger logger("JFJochReceiverTest_Raw");
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -41,6 +37,31 @@ TEST_CASE("JFJochReceiverTest_Raw", "[JFJochReceiver]") {
|
||||
REQUIRE(!output.status.cancelled);
|
||||
}
|
||||
|
||||
// Two cards running at the same time - not possible with the HLS simulation
|
||||
TEST_CASE("JFJochReceiverTest_Raw_TwoDevices", "[JFJochReceiver]") {
|
||||
DiffractionExperiment x(DetJF(4));
|
||||
const uint16_t nthreads = 4;
|
||||
|
||||
x.Raw();
|
||||
x.DataStreams(2);
|
||||
x.PedestalG0Frames(0).NumTriggers(1).UseInternalPacketGenerator(true)
|
||||
.ImagesPerTrigger(100).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::NO_COMPRESSION);
|
||||
REQUIRE(x.GetDataStreamsNum() == 2);
|
||||
|
||||
Logger logger("JFJochReceiverTest_Raw_TwoDevices");
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
REQUIRE_NOTHROW(ret = JFJochReceiverTest(output, logger, aq_devices, x, mask, nthreads));
|
||||
REQUIRE(ret);
|
||||
REQUIRE(output.efficiency == 1.0);
|
||||
REQUIRE(output.status.images_sent == x.GetImageNum());
|
||||
REQUIRE(!output.status.cancelled);
|
||||
}
|
||||
|
||||
TEST_CASE("JFJochReceiverTest_Conversion", "[JFJochReceiver]") {
|
||||
Logger logger("JFJochReceiverTest_Conversion");
|
||||
|
||||
@@ -51,15 +72,11 @@ TEST_CASE("JFJochReceiverTest_Conversion", "[JFJochReceiver]") {
|
||||
x.PedestalG0Frames(0).NumTriggers(1).UseInternalPacketGenerator(true)
|
||||
.ImagesPerTrigger(32).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
REQUIRE(x.IsGeometryTransformed());
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -94,12 +111,12 @@ TEST_CASE("JFJochReceiverTest_ForceCPUAzInt", "[JFJochReceiver]") {
|
||||
for (int i = 0; i < raw_image.size(); i++)
|
||||
raw_image[i] = 1000 + i % 1000;
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++)
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(i, 64));
|
||||
|
||||
PixelMask mask(x);
|
||||
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(ConvertedImage(x, JFCalibration(x), mask, raw_image));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(x, images);
|
||||
|
||||
TestImagePusher pusher(x.GetImageNum() - 1);
|
||||
JFJochReceiverService service(aq_devices, logger, pusher);
|
||||
service.NumThreads(nthreads);
|
||||
@@ -136,7 +153,7 @@ TEST_CASE("JFJochReceiverTest_AzIntBinsExceedFPGA", "[JFJochReceiver]") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++)
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(i, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(i, 64));
|
||||
|
||||
PixelMask mask(x);
|
||||
TestImagePusher pusher(0);
|
||||
@@ -157,13 +174,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_NoGeomTransform", "[JFJochReceiver]") {
|
||||
.ImagesPerTrigger(32).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD)
|
||||
.GeometryTransformation(false);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -187,13 +200,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_Poisson", "[JFJochReceiver]") {
|
||||
CompressionAlgorithm::BSHUF_ZSTD);
|
||||
x.LossyCompressionPoisson(1);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i, 64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -217,13 +226,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_Threshold", "[JFJochReceiver]") {
|
||||
CompressionAlgorithm::BSHUF_ZSTD);
|
||||
x.PixelValueLowThreshold(50);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i, 64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -246,13 +251,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_ApplyMask", "[JFJochReceiver]") {
|
||||
.ImagesPerTrigger(32).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD);
|
||||
x.ApplyPixelMask(true).MaskChipEdges(true).MaskModuleEdges(true);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i, 64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -276,13 +277,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_Threshold_Summation", "[JFJochReceiver]
|
||||
CompressionAlgorithm::BSHUF_ZSTD);
|
||||
x.PixelValueLowThreshold(10);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i, 64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -305,13 +302,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_FixedGainG1", "[JFJochReceiver]") {
|
||||
.ImagesPerTrigger(32).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD)
|
||||
.FixedGainG1(true);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -336,13 +329,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_FixedGainG1_onlyG1", "[JFJochReceiver]"
|
||||
.FixedGainG1(true);
|
||||
|
||||
std::vector<uint16_t> input(RAW_MODULE_SIZE*2, 0x4000 + 3000);
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask, input);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -366,13 +355,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_U16", "[JFJochReceiver]") {
|
||||
.BitDepthImage(16).PixelSigned(false);
|
||||
|
||||
REQUIRE(!x.IsPixelSigned());
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -398,13 +383,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_U8", "[JFJochReceiver]") {
|
||||
REQUIRE(!x.IsPixelSigned());
|
||||
REQUIRE(x.GetByteDepthImage() == 1);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -427,13 +408,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_I32", "[JFJochReceiver]") {
|
||||
.ImagesPerTrigger(32).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD)
|
||||
.PixelSigned(true).BitDepthImage(32);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -455,13 +432,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_Summation2", "[JFJochReceiver]") {
|
||||
x.PedestalG0Frames(0).NumTriggers(1).UseInternalPacketGenerator(true)
|
||||
.ImagesPerTrigger(32).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD).Summation(2);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -484,13 +457,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_Summation7_CPU", "[JFJochReceiver]") {
|
||||
.ImagesPerTrigger(8).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD)
|
||||
.Summation(7).CPUSummation(true);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -515,13 +484,9 @@ TEST_CASE("JFJochReceiverTest_Conversion_StorageCell", "[JFJochReceiver]") {
|
||||
REQUIRE(x.GetImageNum() == 16);
|
||||
REQUIRE(x.GetStorageCellNumber() == 16);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -537,10 +502,10 @@ TEST_CASE("JFJochReceiverTest_PedestalG1", "[JFJochReceiver]") {
|
||||
|
||||
const uint16_t nthreads = 4;
|
||||
size_t nframes = 256;
|
||||
// The card output repeats every distinct_frames frames
|
||||
size_t distinct_frames = 32;
|
||||
|
||||
std::vector<uint16_t> pedestal_in(RAW_MODULE_SIZE*nframes);
|
||||
|
||||
for (auto &i: pedestal_in) i = 16384 | 14000;
|
||||
std::vector<uint16_t> pedestal_in(RAW_MODULE_SIZE * distinct_frames);
|
||||
|
||||
// Predictable random number generator
|
||||
std::mt19937 g1(1900);
|
||||
@@ -560,15 +525,17 @@ TEST_CASE("JFJochReceiverTest_PedestalG1", "[JFJochReceiver]") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
test->CreateJFPackets(x, 1, nframes, 0, pedestal_in.data());
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(i, 64);
|
||||
for (int f = 0; f < distinct_frames; f++)
|
||||
test->SetOutput(f, 0, *OutputWithPixels(pedestal_in.data() + f * RAW_MODULE_SIZE));
|
||||
test->CreateJFPackets(x, 1, nframes, 0, nullptr);
|
||||
test->CreateFinalPacket(x);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
JFPedestalCalc pc(x);
|
||||
for (int i = 0; i < nframes; i++)
|
||||
pc.AnalyzeImage(pedestal_in.data() + i * RAW_MODULE_SIZE);
|
||||
pc.AnalyzeImage(pedestal_in.data() + (i % distinct_frames) * RAW_MODULE_SIZE);
|
||||
|
||||
Logger logger("JFJochReceiverTest_PedestalG1");
|
||||
|
||||
@@ -594,8 +561,10 @@ TEST_CASE("JFJochReceiverTest_PedestalG2_storage_cell", "[JFJochReceiver]") {
|
||||
|
||||
const uint16_t nthreads = 4;
|
||||
size_t nframes = 150;
|
||||
// The card output repeats every 2 * distinct_frames frames
|
||||
size_t distinct_frames = 25;
|
||||
|
||||
std::vector<uint16_t> pedestal_in(RAW_MODULE_SIZE*nframes), pedestal_in2(RAW_MODULE_SIZE*nframes);;
|
||||
std::vector<uint16_t> pedestal_in(RAW_MODULE_SIZE * distinct_frames), pedestal_in2(RAW_MODULE_SIZE * distinct_frames);
|
||||
|
||||
// Predictable random number generator
|
||||
std::mt19937 g2(1900);
|
||||
@@ -625,10 +594,14 @@ TEST_CASE("JFJochReceiverTest_PedestalG2_storage_cell", "[JFJochReceiver]") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
auto test = std::make_unique<HLSSimulatedDevice>(i, nframes * 2);
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(i, nframes * 2);
|
||||
for (int j = 0; j < distinct_frames; j++) {
|
||||
test->SetOutput(2 * j, 0, *OutputWithPixels(pedestal_in2.data() + j * RAW_MODULE_SIZE));
|
||||
test->SetOutput(2 * j + 1, 0, *OutputWithPixels(pedestal_in.data() + j * RAW_MODULE_SIZE));
|
||||
}
|
||||
for (int j = 0; j < nframes; j++) {
|
||||
test->CreateJFPackets(x, 2 * j + 1, 1, 0, pedestal_in2.data() + j * RAW_MODULE_SIZE);
|
||||
test->CreateJFPackets(x, 2 * j + 2, 1, 0, pedestal_in.data() + j * RAW_MODULE_SIZE);
|
||||
test->CreateJFPackets(x, 2 * j + 1, 1, 0, nullptr);
|
||||
test->CreateJFPackets(x, 2 * j + 2, 1, 0, nullptr);
|
||||
}
|
||||
test->CreateFinalPacket(x);
|
||||
aq_devices.Add(std::move(test));
|
||||
@@ -636,7 +609,7 @@ TEST_CASE("JFJochReceiverTest_PedestalG2_storage_cell", "[JFJochReceiver]") {
|
||||
|
||||
JFPedestalCalc pc(x);
|
||||
for (int i = 0; i < nframes; i++)
|
||||
pc.AnalyzeImage(pedestal_in.data() + i * RAW_MODULE_SIZE);
|
||||
pc.AnalyzeImage(pedestal_in.data() + (i % distinct_frames) * RAW_MODULE_SIZE);
|
||||
|
||||
Logger logger("JFJochReceiverTest_PedestalG2_storage_cell");
|
||||
|
||||
@@ -660,10 +633,10 @@ TEST_CASE("JFJochReceiverTest_PedestalG0", "[JFJochReceiver]") {
|
||||
DiffractionExperiment x(DetJF(1));
|
||||
const uint16_t nthreads = 4;
|
||||
size_t nframes = 500;
|
||||
// The card output repeats every distinct_frames frames
|
||||
size_t distinct_frames = 25;
|
||||
|
||||
std::vector<uint16_t> pedestal_in(RAW_MODULE_SIZE*nframes);
|
||||
|
||||
for (auto &i: pedestal_in) i = 16384 | 14000;
|
||||
std::vector<uint16_t> pedestal_in(RAW_MODULE_SIZE * distinct_frames);
|
||||
|
||||
// Predictable random number generator
|
||||
std::mt19937 g1(1900);
|
||||
@@ -683,15 +656,17 @@ TEST_CASE("JFJochReceiverTest_PedestalG0", "[JFJochReceiver]") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
auto test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
test->CreateJFPackets(x, 1, nframes, 0, pedestal_in.data());
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(i, 64);
|
||||
for (int f = 0; f < distinct_frames; f++)
|
||||
test->SetOutput(f, 0, *OutputWithPixels(pedestal_in.data() + f * RAW_MODULE_SIZE));
|
||||
test->CreateJFPackets(x, 1, nframes, 0, nullptr);
|
||||
test->CreateFinalPacket(x);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
JFPedestalCalc pc(x);
|
||||
for (int i = 0; i < nframes; i++)
|
||||
pc.AnalyzeImage(pedestal_in.data() + i * RAW_MODULE_SIZE);
|
||||
pc.AnalyzeImage(pedestal_in.data() + (i % distinct_frames) * RAW_MODULE_SIZE);
|
||||
|
||||
PixelMask mask(x);
|
||||
|
||||
@@ -732,13 +707,12 @@ TEST_CASE("JFJochReceiverTest_PedestalG0_StorageCell", "[JFJochReceiver]") {
|
||||
.ImagesPerTrigger(0).IncidentEnergy_keV(12.4);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
auto test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int i = 0; i < nframes; i++) {
|
||||
test->CreateJFPackets(x, i * 4 + 1, 1, 0, pedestal_in_0.data());
|
||||
test->CreateJFPackets(x, i * 4 + 2, 1, 0, pedestal_in_1.data());
|
||||
test->CreateJFPackets(x, i * 4 + 3, 1, 0, pedestal_in_2.data());
|
||||
test->CreateJFPackets(x, i * 4 + 4, 1, 0, pedestal_in_3.data());
|
||||
}
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(0, 64);
|
||||
test->SetOutput(0, 0, *OutputWithPixels(pedestal_in_0.data()));
|
||||
test->SetOutput(1, 0, *OutputWithPixels(pedestal_in_1.data()));
|
||||
test->SetOutput(2, 0, *OutputWithPixels(pedestal_in_2.data()));
|
||||
test->SetOutput(3, 0, *OutputWithPixels(pedestal_in_3.data()));
|
||||
test->CreateJFPackets(x, 1, nframes * 4, 0, nullptr);
|
||||
test->CreateFinalPacket(x);
|
||||
aq_devices.Add(std::move(test));
|
||||
|
||||
@@ -790,13 +764,12 @@ TEST_CASE("JFJochReceiverTest_PedestalFixedG1_StorageCell", "[JFJochReceiver]")
|
||||
REQUIRE(x.GetStorageCellNumber() == 4);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
auto test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int i = 0; i < nframes; i++) {
|
||||
test->CreateJFPackets(x, i * 4 + 1, 1, 0, pedestal_in_0.data());
|
||||
test->CreateJFPackets(x, i * 4 + 2, 1, 0, pedestal_in_1.data());
|
||||
test->CreateJFPackets(x, i * 4 + 3, 1, 0, pedestal_in_2.data());
|
||||
test->CreateJFPackets(x, i * 4 + 4, 1, 0, pedestal_in_3.data());
|
||||
}
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(0, 64);
|
||||
test->SetOutput(0, 0, *OutputWithPixels(pedestal_in_0.data()));
|
||||
test->SetOutput(1, 0, *OutputWithPixels(pedestal_in_1.data()));
|
||||
test->SetOutput(2, 0, *OutputWithPixels(pedestal_in_2.data()));
|
||||
test->SetOutput(3, 0, *OutputWithPixels(pedestal_in_3.data()));
|
||||
test->CreateJFPackets(x, 1, nframes * 4, 0, nullptr);
|
||||
test->CreateFinalPacket(x);
|
||||
aq_devices.Add(std::move(test));
|
||||
|
||||
@@ -840,7 +813,7 @@ TEST_CASE("JFJochReceiverTest_PedestalG1_NoFrames", "[JFJochReceiver]") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
auto test = std::make_unique<HLSSimulatedDevice>(i, nframes + 8);
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(i, nframes + 8);
|
||||
test->CreateFinalPacket(x);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
@@ -875,19 +848,28 @@ TEST_CASE("JFJochReceiverTest_PacketLost_Raw", "[JFJochReceiver]") {
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
|
||||
// The card writes the missing packet as UINT16_MAX
|
||||
std::vector<uint16_t> frame_lost = frame_in;
|
||||
for (int i = 127 * 4096; i < RAW_MODULE_SIZE; i++)
|
||||
frame_lost[i] = UINT16_MAX;
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
auto test = std::make_unique<HLSSimulatedDevice>(i, 64);
|
||||
test->CreateJFPackets(x, 1, 1, 0, frame_in.data());
|
||||
test->CreateJFPackets(x, 1, 1, 1, frame_in.data());
|
||||
test->CreateJFPackets(x, 2, 1, 0, frame_in.data());
|
||||
test->CreateJFPackets(x, 2, 1, 1, frame_in.data());
|
||||
test->CreateJFPackets(x, 3, 1, 0, frame_in.data());
|
||||
test->CreateJFPackets(x, 3, 1, 1, frame_in.data());
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(i, 64);
|
||||
for (int image = 0; image < 4; image++) {
|
||||
test->SetOutput(image, 0, *OutputWithPixels((image == 3) ? frame_lost.data() : frame_in.data()));
|
||||
test->SetOutput(image, 1, *OutputWithPixels(frame_in.data()));
|
||||
}
|
||||
test->CreateJFPackets(x, 1, 1, 0, nullptr);
|
||||
test->CreateJFPackets(x, 1, 1, 1, nullptr);
|
||||
test->CreateJFPackets(x, 2, 1, 0, nullptr);
|
||||
test->CreateJFPackets(x, 2, 1, 1, nullptr);
|
||||
test->CreateJFPackets(x, 3, 1, 0, nullptr);
|
||||
test->CreateJFPackets(x, 3, 1, 1, nullptr);
|
||||
|
||||
for (int j = 0; j < 127; j++)
|
||||
test->CreateJFPacket(x, 4, j, 0, frame_in.data() + (i * 128 + j) * 4096);
|
||||
test->CreateJFPackets(x, 4, 1, 1, frame_in.data());
|
||||
test->CreateJFPacket(x, 4, j, 0, nullptr);
|
||||
test->CreateJFPackets(x, 4, 1, 1, nullptr);
|
||||
test->CreateFinalPacket(x);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
@@ -939,13 +921,15 @@ TEST_CASE("JFJochReceiverTest_Cancel", "[JFJochReceiver]") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
auto test = std::make_unique<HLSSimulatedDevice>(i, 64);
|
||||
test->CreateJFPackets(x, 1, 1, 0, frame_in.data());
|
||||
test->CreateJFPackets(x, 1, 1, 1, frame_in.data());
|
||||
test->CreateJFPackets(x, 2, 1, 0, frame_in.data());
|
||||
test->CreateJFPackets(x, 2, 1, 1, frame_in.data());
|
||||
test->CreateJFPackets(x, 3, 1, 0, frame_in.data());
|
||||
test->CreateJFPackets(x, 3, 1, 1, frame_in.data());
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(i, 64);
|
||||
test->SetOutput(0, 0, *OutputWithPixels(frame_in.data()));
|
||||
test->SetOutput(0, 1, *OutputWithPixels(frame_in.data()));
|
||||
test->CreateJFPackets(x, 1, 1, 0, nullptr);
|
||||
test->CreateJFPackets(x, 1, 1, 1, nullptr);
|
||||
test->CreateJFPackets(x, 2, 1, 0, nullptr);
|
||||
test->CreateJFPackets(x, 2, 1, 1, nullptr);
|
||||
test->CreateJFPackets(x, 3, 1, 0, nullptr);
|
||||
test->CreateJFPackets(x, 3, 1, 1, nullptr);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
Logger logger("JFJochReceiverTest_Cancel");
|
||||
@@ -958,13 +942,49 @@ TEST_CASE("JFJochReceiverTest_Cancel", "[JFJochReceiver]") {
|
||||
|
||||
service.Start(x, pixel_mask, &calib);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(60));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
service.Cancel(false);
|
||||
|
||||
auto receiver_out = service.Stop();
|
||||
REQUIRE(receiver_out.status.cancelled);
|
||||
}
|
||||
|
||||
TEST_CASE("JFJochReceiverTest_Pedestal_Cancel", "[JFJochReceiver]") {
|
||||
Logger logger("JFJochReceiverTest_Pedestal_Cancel");
|
||||
|
||||
DiffractionExperiment x(DetJF(1));
|
||||
x.Mode(DetectorMode::PedestalG0);
|
||||
x.PedestalG0Frames(100).NumTriggers(1).UseInternalPacketGenerator(false).IncidentEnergy_keV(12.4);
|
||||
|
||||
std::vector<uint16_t> frame_in(RAW_MODULE_SIZE, 1000);
|
||||
|
||||
// Only the first frames of the 100 arrive, and no final packet: the run waits until it is cancelled.
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(0, 64);
|
||||
test->SetOutput(0, 0, *OutputWithPixels(frame_in.data()));
|
||||
test->CreateJFPackets(x, 1, 10, 0, nullptr);
|
||||
aq_devices.Add(std::move(test));
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
TestImagePusher pusher(0);
|
||||
JFJochReceiverService service(aq_devices, logger, pusher);
|
||||
service.NumThreads(4);
|
||||
|
||||
service.Start(x, pixel_mask, nullptr);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
service.Cancel(false);
|
||||
|
||||
auto output = service.Stop();
|
||||
REQUIRE(output.status.cancelled);
|
||||
REQUIRE(output.efficiency < 1.0);
|
||||
REQUIRE(output.received_packets.at(0) > 0);
|
||||
REQUIRE(output.received_packets.at(0) < output.expected_packets.at(0));
|
||||
// Too few frames for a pedestal, so every pixel is reported as wrong
|
||||
REQUIRE(output.pedestal_result.size() == 1);
|
||||
REQUIRE(output.pedestal_result[0].CountMaskedPixels() == RAW_MODULE_SIZE);
|
||||
REQUIRE(pusher.GetCounter() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("JFJochReceiverTest_EIGER", "[JFJochReceiver]") {
|
||||
Logger logger("JFJochReceiverTest_EIGER");
|
||||
|
||||
@@ -975,13 +995,9 @@ TEST_CASE("JFJochReceiverTest_EIGER", "[JFJochReceiver]") {
|
||||
x.PedestalG0Frames(0).NumTriggers(1).UseInternalPacketGenerator(true)
|
||||
.ImagesPerTrigger(32).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -1003,13 +1019,9 @@ TEST_CASE("JFJochReceiverTest_EIGER_8bit", "[JFJochReceiver]") {
|
||||
.ImagesPerTrigger(32).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD);
|
||||
x.EigerBitDepth(8);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -1031,13 +1043,9 @@ TEST_CASE("JFJochReceiverTest_EIGER_32bit", "[JFJochReceiver]") {
|
||||
.ImagesPerTrigger(32).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD);
|
||||
x.EigerBitDepth(32);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
@@ -1059,13 +1067,9 @@ TEST_CASE("JFJochReceiverTest_EIGER_conversion", "[JFJochReceiver]") {
|
||||
x.PedestalG0Frames(0).NumTriggers(1).UseInternalPacketGenerator(true)
|
||||
.ImagesPerTrigger(32).ImagesPerFile(10).IncidentEnergy_keV(12.4).Compression(CompressionAlgorithm::BSHUF_ZSTD);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++) {
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(i,64);
|
||||
aq_devices.Add(std::move(test));
|
||||
}
|
||||
|
||||
PixelMask mask(x);
|
||||
AcquisitionDeviceGroup aq_devices = ConvertingMocks(x, mask);
|
||||
|
||||
JFJochReceiverOutput output;
|
||||
bool ret;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <fstream>
|
||||
|
||||
#include "../receiver/JFJochReceiverTest.h"
|
||||
#include "../acquisition_device/HLSSimulatedDevice.h"
|
||||
#include "MockCardOutput.h"
|
||||
#include "../writer/HDF5Objects.h"
|
||||
#include "../receiver/JFJochReceiverService.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
@@ -50,13 +50,17 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index", "[JFJochReceiver]"
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -72,13 +76,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index", "[JFJochReceiver]"
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -142,7 +139,7 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_GPUStills", "[JFJoch
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
@@ -225,7 +222,7 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_GPUStills_writer_down", "[JFJochReceiver]")
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
auto test = std::make_unique<MockAcquisitionDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
aq_devices.Add(std::move(test));
|
||||
@@ -257,9 +254,7 @@ TEST_CASE("JFJochIntegrationTest_GPUStills_cancel_during_prepass", "[JFJochRecei
|
||||
// A cancel while the frames are held for the pre-pass ends the collection.
|
||||
Logger logger(Catch::getResultCapture().getCurrentTestName());
|
||||
|
||||
// Few images: after the cancel, the simulated FPGA still processes, at CPU speed, the frames it has already
|
||||
// taken in, which takes minutes for a long collection on a loaded machine. For the same reason, how long the
|
||||
// stop takes is not checked.
|
||||
// How long the stop takes is not checked.
|
||||
DiffractionExperiment experiment(DetJF4M());
|
||||
experiment.ImagesPerTrigger(30).NumTriggers(1).UseInternalPacketGenerator(true)
|
||||
.FilePrefix("gpu_stills_cancel").JungfrauConvPhotonCnt(false)
|
||||
@@ -269,7 +264,7 @@ TEST_CASE("JFJochIntegrationTest_GPUStills_cancel_during_prepass", "[JFJochRecei
|
||||
PixelMask pixel_mask(experiment);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(0, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(0, 64));
|
||||
|
||||
NonePusher pusher;
|
||||
JFJochReceiverService service(aq_devices, logger, pusher);
|
||||
@@ -323,13 +318,17 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_refinement", "[JFJoc
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -345,13 +344,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_refinement", "[JFJoc
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -416,13 +408,17 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_refinement_tetragona
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -438,13 +434,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_refinement_tetragona
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -504,13 +493,18 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_index_no_integration", "[JFJoc
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
settings.quick_integration = true; // asked for, and still not done
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -526,14 +520,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_index_no_integration", "[JFJoc
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
settings.quick_integration = true; // asked for, and still not done
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -603,13 +589,17 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_index_no_spots", "[JFJochRecei
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 20; // make sure there are zero spots possible
|
||||
settings.photon_count_threshold = 10000;
|
||||
settings.min_pix_per_spot = 5;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -625,13 +615,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_index_no_spots", "[JFJochRecei
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 20; // make sure there are zero spots possible
|
||||
settings.photon_count_threshold = 10000;
|
||||
settings.min_pix_per_spot = 5;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -684,13 +667,11 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_azint_2d", "[JFJochReceiver]") {
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom,
|
||||
DiffractionExperiment::DefaultDataProcessingSettings()));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -757,13 +738,17 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_FFT", "[JFJochReceiv
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -779,13 +764,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_FFT", "[JFJochReceiv
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -846,13 +824,17 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_FFTW", "[JFJochRecei
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -868,13 +850,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_FFTW", "[JFJochRecei
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -936,13 +911,17 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_FFT_reference", "[JF
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -958,13 +937,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_FFT_reference", "[JF
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -1026,13 +998,17 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_FFT_wrong_reference"
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -1048,13 +1024,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_FFT_wrong_reference"
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -1120,13 +1089,17 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_grid", "[JFJochRecei
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -1142,13 +1115,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_grid", "[JFJochRecei
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -1224,13 +1190,17 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_32", "[JFJochReceive
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -1246,13 +1216,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_32", "[JFJochReceive
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -1313,12 +1276,15 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_min_pix_2", "[JFJoch
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 3;
|
||||
settings.min_pix_per_spot = 2;
|
||||
settings.max_pix_per_spot = 200;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
ZMQImagePuller puller(pusher.GetAddress()[0]);
|
||||
@@ -1329,11 +1295,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_crystal_spot_and_index_min_pix_2", "[JFJoch
|
||||
service.NumThreads(nthreads);
|
||||
service.Indexing(experiment.GetIndexingSettings());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 3;
|
||||
settings.min_pix_per_spot = 2;
|
||||
settings.max_pix_per_spot = 200;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -1449,13 +1410,11 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_ROI", "[JFJochReceiver]") {
|
||||
}
|
||||
}
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom,
|
||||
DiffractionExperiment::DefaultDataProcessingSettings()));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
ZMQImagePuller puller(pusher.GetAddress()[0]);
|
||||
@@ -1523,7 +1482,7 @@ TEST_CASE("JFJochIntegrationTest_ZMQPreview", "[JFJochReceiver]") {
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(0, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(0, 64));
|
||||
|
||||
NonePusher pusher;
|
||||
|
||||
@@ -1587,7 +1546,7 @@ TEST_CASE("JFJochIntegrationTest_ZMQMetadata", "[JFJochReceiver]") {
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(0, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(0, 64));
|
||||
|
||||
NonePusher pusher;
|
||||
|
||||
@@ -1647,7 +1606,7 @@ TEST_CASE("JFJochIntegrationTest_HDF5FilePusher", "[JFJochReceiver]") {
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(0, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(0, 64));
|
||||
|
||||
HDF5FilePusher pusher;
|
||||
|
||||
@@ -1681,7 +1640,7 @@ TEST_CASE("JFJochIntegrationTest_HDF5FilePusher_republish", "[JFJochReceiver]")
|
||||
PixelMask pixel_mask(experiment);
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(0, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(0, 64));
|
||||
|
||||
HDF5FilePusher pusher(repub_addr);
|
||||
|
||||
@@ -1743,7 +1702,7 @@ TEST_CASE("JFJochIntegrationTest_HDF5FilePusher_Raw", "[JFJochReceiver]") {
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(0, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(0, 64));
|
||||
|
||||
HDF5FilePusher pusher;
|
||||
|
||||
@@ -1793,13 +1752,13 @@ TEST_CASE("JFJochIntegrationTest_TCP_crystal_no_processing", "[JFJochReceiver]")
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.enable = false;
|
||||
settings.indexing = true;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
TCPStreamPusher pusher("tcp://127.0.0.1:*", 1);
|
||||
TCPImagePuller puller(pusher.GetAddress()[0]);
|
||||
@@ -1813,9 +1772,6 @@ TEST_CASE("JFJochIntegrationTest_TCP_crystal_no_processing", "[JFJochReceiver]")
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.enable = false;
|
||||
settings.indexing = true;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -1870,13 +1826,17 @@ TEST_CASE("JFJochIntegrationTest_TCP_crystal_spot_and_index", "[JFJochReceiver]"
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
TCPStreamPusher pusher("tcp://127.0.0.1:*", 1);
|
||||
|
||||
@@ -1891,13 +1851,6 @@ TEST_CASE("JFJochIntegrationTest_TCP_crystal_spot_and_index", "[JFJochReceiver]"
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
@@ -1952,9 +1905,7 @@ TEST_CASE("JFJochIntegrationTest_TCP_calibration", "[JFJochReceiver]") {
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(0, 64));
|
||||
|
||||
TCPStreamPusher pusher("tcp://127.0.0.1:*", 1);
|
||||
|
||||
@@ -2012,13 +1963,17 @@ TEST_CASE("JFJochIntegrationTest_TCP_crystal_spot_and_index_single_file", "[JFJo
|
||||
ConvertedToRawGeometry(experiment, image_raw_geom.data(), image_conv.data());
|
||||
logger.Info("Loaded image");
|
||||
|
||||
// Setup acquisition device
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
std::unique_ptr<HLSSimulatedDevice> test = std::make_unique<HLSSimulatedDevice>(0, 64);
|
||||
for (int m = 0; m < experiment.GetModulesNum(); m++)
|
||||
test->SetInternalGeneratorFrame((uint16_t *) image_raw_geom.data() + m * RAW_MODULE_SIZE, m);
|
||||
|
||||
aq_devices.Add(std::move(test));
|
||||
// Setup acquisition device: the card writes the image, with the strong pixels of its spot finder
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
std::vector<CardImage> images;
|
||||
images.push_back(Int16Image(experiment, pixel_mask, image_raw_geom, settings));
|
||||
AcquisitionDeviceGroup aq_devices = MockDevices(experiment, images);
|
||||
|
||||
TCPStreamPusher pusher("tcp://127.0.0.1:*", 1);
|
||||
|
||||
@@ -2033,13 +1988,6 @@ TEST_CASE("JFJochIntegrationTest_TCP_crystal_spot_and_index_single_file", "[JFJo
|
||||
// No progress value at the start of measurement
|
||||
REQUIRE(!service.GetProgress().has_value());
|
||||
|
||||
SpotFindingSettings settings = DiffractionExperiment::DefaultDataProcessingSettings();
|
||||
settings.signal_to_noise_threshold = 2.5;
|
||||
settings.photon_count_threshold = 5;
|
||||
settings.min_pix_per_spot = 1;
|
||||
settings.max_pix_per_spot = 200;
|
||||
settings.high_resolution_limit = 2.0;
|
||||
settings.low_resolution_limit = 50.0;
|
||||
service.SetSpotFindingSettings(settings);
|
||||
|
||||
service.Start(experiment, pixel_mask, nullptr);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../broker/JFJochStateMachine.h"
|
||||
#include "../acquisition_device/HLSSimulatedDevice.h"
|
||||
#include "../acquisition_device/MockAcquisitionDevice.h"
|
||||
#include "../receiver/JFJochReceiverService.h"
|
||||
#include "../broker/OpenAPIConvert.h"
|
||||
#include "../broker/ModulePlacementConvert.h"
|
||||
@@ -278,7 +278,7 @@ TEST_CASE("JFJochStateMachine_AsyncStartFailure") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < experiment.GetDataStreamsNum(); i++)
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(i, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(i, 64));
|
||||
|
||||
RefusingImagePusher pusher;
|
||||
JFJochReceiverService receiver_service(aq_devices, logger, pusher);
|
||||
@@ -452,7 +452,7 @@ TEST_CASE("JFJochStateMachine_CancelledRunIsNotAnError") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < experiment.GetDataStreamsNum(); i++)
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(i, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(i, 64));
|
||||
|
||||
GatedPusher pusher;
|
||||
JFJochReceiverService receiver_service(aq_devices, logger, pusher);
|
||||
@@ -508,7 +508,7 @@ TEST_CASE("JFJochStateMachine_WriterFailureAtEndIsAnError") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < experiment.GetDataStreamsNum(); i++)
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(i, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(i, 64));
|
||||
|
||||
FinalizeFailingPusher pusher;
|
||||
JFJochReceiverService receiver_service(aq_devices, logger, pusher);
|
||||
@@ -563,7 +563,7 @@ TEST_CASE("JFJochStateMachine_PreflightRefusesBeforeStarting") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < experiment.GetDataStreamsNum(); i++)
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(i, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(i, 64));
|
||||
|
||||
PreflightRefusingPusher pusher;
|
||||
JFJochReceiverService receiver_service(aq_devices, logger, pusher);
|
||||
@@ -682,7 +682,7 @@ TEST_CASE("JFJochStateMachine_StartModulePlacement") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < experiment.GetDataStreamsNum(); i++)
|
||||
aq_devices.Add(std::make_unique<HLSSimulatedDevice>(i, 64));
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(i, 64));
|
||||
StartMessageCapture pusher;
|
||||
JFJochReceiverService receiver_service(aq_devices, logger, pusher);
|
||||
JFJochServices services(logger);
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#pragma once
|
||||
|
||||
// What the FPGA card writes, precalculated on the CPU for the tests on MockAcquisitionDevice. It does not matter how
|
||||
// it is calculated here: that the mock gives the host what the card gives is checked against the HLS simulation in
|
||||
// MockAcquisitionDeviceTest.cpp.
|
||||
|
||||
#include "CheckImageOutput.h"
|
||||
#include "../acquisition_device/AcquisitionDeviceGroup.h"
|
||||
#include "../acquisition_device/MockAcquisitionDevice.h"
|
||||
#include "../common/PixelMask.h"
|
||||
#include "../image_analysis/spot_finding/DetModuleSpotFinder_cpu.h"
|
||||
#include "../receiver/JFJochReceiverTest.h"
|
||||
|
||||
// The card output of one image, one entry per module (absolute module number)
|
||||
using CardImage = std::vector<std::unique_ptr<DeviceOutput>>;
|
||||
|
||||
inline std::unique_ptr<DeviceOutput> OutputWithPixels(const uint16_t *pixels) {
|
||||
auto ret = std::make_unique<DeviceOutput>();
|
||||
memcpy(ret->pixels, pixels, RAW_MODULE_SIZE * sizeof(uint16_t));
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void StorePixels(DeviceOutput &output, const std::vector<int64_t> &values) {
|
||||
auto pixels = reinterpret_cast<T *>(output.pixels);
|
||||
for (int i = 0; i < RAW_MODULE_SIZE; i++)
|
||||
pixels[i] = static_cast<T>(values[i]);
|
||||
}
|
||||
|
||||
// The values in the pixel format the card writes for the experiment
|
||||
inline void StorePixels(DeviceOutput &output, const DiffractionExperiment &x, const std::vector<int64_t> &values) {
|
||||
switch (x.GetByteDepthFPGA()) {
|
||||
case 1:
|
||||
x.IsPixelSigned() ? StorePixels<int8_t>(output, values) : StorePixels<uint8_t>(output, values);
|
||||
break;
|
||||
case 2:
|
||||
x.IsPixelSigned() ? StorePixels<int16_t>(output, values) : StorePixels<uint16_t>(output, values);
|
||||
break;
|
||||
default:
|
||||
x.IsPixelSigned() ? StorePixels<int32_t>(output, values) : StorePixels<uint32_t>(output, values);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Error and saturated pixels counted, the others summed, masked pixels left out; and the same for each ROI of
|
||||
// the experiment's ROI map (one bit per ROI)
|
||||
inline void PixelStatistics(DeviceOutput &output, const DiffractionExperiment &x, const PixelMask &mask,
|
||||
const std::vector<uint16_t> &experiment_roi_map, size_t module,
|
||||
const std::vector<int64_t> &values, int64_t err, int64_t sat) {
|
||||
std::vector<uint16_t> roi_map(RAW_MODULE_SIZE);
|
||||
ConvertedToRawGeometry(x, module, roi_map.data(), experiment_roi_map.data());
|
||||
const uint32_t *module_mask = mask.GetMaskRaw().data() + module * RAW_MODULE_SIZE;
|
||||
|
||||
auto &stats = output.module_statistics;
|
||||
stats.max_value = INT24_MIN;
|
||||
stats.min_value = INT24_MAX;
|
||||
for (int r = 0; r < FPGA_ROI_COUNT; r++)
|
||||
output.roi_counts[r].max_value = INT24_MIN;
|
||||
|
||||
for (int i = 0; i < RAW_MODULE_SIZE; i++) {
|
||||
const int64_t v = values[i];
|
||||
if (module_mask[i] != 0) {
|
||||
stats.masked_pixels++;
|
||||
continue;
|
||||
}
|
||||
if (v == err)
|
||||
stats.err_pixels++;
|
||||
else if (v == sat)
|
||||
stats.saturated_pixels++;
|
||||
else {
|
||||
stats.pixel_sum += v;
|
||||
stats.max_value = std::max<int64_t>(stats.max_value, v);
|
||||
stats.min_value = std::min<int64_t>(stats.min_value, v);
|
||||
}
|
||||
|
||||
// roi_calc.cpp: the coordinates include the multipixels
|
||||
const int64_t line = i / RAW_MODULE_COLS + (i / RAW_MODULE_COLS / 256) * 2;
|
||||
const int64_t col = i % RAW_MODULE_COLS + (i % RAW_MODULE_COLS / 256) * 2;
|
||||
for (int r = 0; r < FPGA_ROI_COUNT; r++) {
|
||||
if (((roi_map[i] >> r) & 1) == 0 || v == err)
|
||||
continue;
|
||||
ROICount &roi = output.roi_counts[r];
|
||||
if (v != sat) {
|
||||
roi.sum += v;
|
||||
roi.sum2 += v * v;
|
||||
roi.good_pixels++;
|
||||
roi.sum_x_weighted += v * col;
|
||||
roi.sum_y_weighted += v * line;
|
||||
}
|
||||
roi.max_value = std::max<int64_t>(roi.max_value, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The strong pixels of the card's spot finder, by its CPU version, on the pixels in the output
|
||||
inline void FindStrongPixels(DeviceOutput &output, const DiffractionExperiment &x, const SpotFindingSettings &settings,
|
||||
size_t module) {
|
||||
std::vector<float> d_map(RAW_MODULE_SIZE), mean(RAW_MODULE_SIZE), stddev(RAW_MODULE_SIZE);
|
||||
std::vector<uint32_t> valid_count(RAW_MODULE_SIZE), strong_pixel(RAW_MODULE_SIZE);
|
||||
x.CalcSpotFinderResolutionMap(d_map.data(), module);
|
||||
switch (x.GetByteDepthFPGA()) {
|
||||
case 1:
|
||||
FindSpots<int8_t>(output, settings, d_map.data(), mean.data(), stddev.data(), valid_count.data(),
|
||||
strong_pixel.data());
|
||||
break;
|
||||
case 2:
|
||||
FindSpots<int16_t>(output, settings, d_map.data(), mean.data(), stddev.data(), valid_count.data(),
|
||||
strong_pixel.data());
|
||||
break;
|
||||
default:
|
||||
FindSpots<int32_t>(output, settings, d_map.data(), mean.data(), stddev.data(), valid_count.data(),
|
||||
strong_pixel.data());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// JUNGFRAU conversion of a raw image (all modules) as CheckImageOutput.h computes it; with host summation the card
|
||||
// converts single frames to 16 bit. With conversion, error and saturated pixels are counted from the conversion into
|
||||
// signed 32 bit, as the card counts them before the pixel is written in the image's format, where unsigned they have
|
||||
// one value; without, the card reads UINT16_MAX from the detector as saturated.
|
||||
inline CardImage ConvertedImage(const DiffractionExperiment &x, const JFCalibration &calib, const PixelMask &mask,
|
||||
const std::vector<uint16_t> &raw, size_t storage_cell = 0) {
|
||||
DiffractionExperiment card_x(x);
|
||||
if (x.IsCPUSummation())
|
||||
card_x.Summation(1).BitDepthImage(16);
|
||||
DiffractionExperiment signed_x(card_x);
|
||||
signed_x.PixelSigned(true).BitDepthImage(32);
|
||||
|
||||
const auto ref = ConversionRef(card_x, calib, raw.data(), x.GetModulesNum(), storage_cell);
|
||||
const auto ref_signed = ConversionRef(signed_x, calib, raw.data(), x.GetModulesNum(), storage_cell);
|
||||
const auto roi_map = x.ExportROIMap();
|
||||
|
||||
CardImage ret;
|
||||
std::vector<int64_t> values(RAW_MODULE_SIZE), stats_values(RAW_MODULE_SIZE);
|
||||
for (int m = 0; m < x.GetModulesNum(); m++) {
|
||||
for (size_t i = 0; i < RAW_MODULE_SIZE; i++) {
|
||||
const size_t pxl = m * RAW_MODULE_SIZE + i;
|
||||
values[i] = std::llround(ref[pxl]);
|
||||
if (x.IsJungfrauConvPhotonCnt())
|
||||
stats_values[i] = std::llround(ref_signed[pxl]);
|
||||
else
|
||||
stats_values[i] = (raw[pxl] == UINT16_MAX) ? INT32_MAX : values[i];
|
||||
}
|
||||
auto output = std::make_unique<DeviceOutput>();
|
||||
StorePixels(*output, card_x, values);
|
||||
PixelStatistics(*output, x, mask, roi_map, m, stats_values, INT32_MIN, INT32_MAX);
|
||||
ret.push_back(std::move(output));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// The card passing a signed 16-bit image (raw geometry, all modules) through, INT16_MIN marking an error and
|
||||
// INT16_MAX a saturated pixel, with the strong pixels of its spot finder
|
||||
inline CardImage Int16Image(const DiffractionExperiment &x, const PixelMask &mask, const std::vector<int16_t> &image,
|
||||
const SpotFindingSettings &settings) {
|
||||
const int64_t err = (x.GetByteDepthFPGA() == 4) ? INT32_MIN : INT16_MIN;
|
||||
const int64_t sat = (x.GetByteDepthFPGA() == 4) ? INT32_MAX : INT16_MAX;
|
||||
const auto roi_map = x.ExportROIMap();
|
||||
|
||||
CardImage ret;
|
||||
std::vector<int64_t> values(RAW_MODULE_SIZE);
|
||||
for (int m = 0; m < x.GetModulesNum(); m++) {
|
||||
for (int i = 0; i < RAW_MODULE_SIZE; i++) {
|
||||
const int16_t v = image[m * RAW_MODULE_SIZE + i];
|
||||
values[i] = (v == INT16_MIN) ? err : ((v == INT16_MAX) ? sat : v);
|
||||
}
|
||||
auto output = std::make_unique<DeviceOutput>();
|
||||
StorePixels(*output, x, values);
|
||||
PixelStatistics(*output, x, mask, roi_map, m, values, err, sat);
|
||||
FindStrongPixels(*output, x, settings, m);
|
||||
ret.push_back(std::move(output));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Frame F of the mock of data stream d writes images[F % images.size()]
|
||||
inline void SetOutputs(MockAcquisitionDevice &mock, const DiffractionExperiment &x, uint16_t data_stream,
|
||||
const std::vector<CardImage> &images) {
|
||||
for (size_t i = 0; i < images.size(); i++)
|
||||
for (int m = 0; m < x.GetModulesNum(data_stream); m++)
|
||||
mock.SetOutput(i, m, *images[i][x.GetFirstModuleOfDataStream(data_stream) + m]);
|
||||
}
|
||||
|
||||
// One mock per data stream
|
||||
inline AcquisitionDeviceGroup MockDevices(const DiffractionExperiment &x, const std::vector<CardImage> &images) {
|
||||
AcquisitionDeviceGroup ret;
|
||||
for (int d = 0; d < x.GetDataStreamsNum(); d++) {
|
||||
auto mock = std::make_unique<MockAcquisitionDevice>(d, 64);
|
||||
SetOutputs(*mock, x, d, images);
|
||||
ret.Add(std::move(mock));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// The mocks for JFJochReceiverTest(): the conversion of its raw image with its calibration, the pixel mask applied
|
||||
// if the experiment asks for it, one image per storage cell
|
||||
inline AcquisitionDeviceGroup ConvertingMocks(const DiffractionExperiment &x, const PixelMask &mask,
|
||||
std::vector<uint16_t> raw) {
|
||||
if (x.IsApplyPixelMask()) {
|
||||
for (int i = 0; i < raw.size(); i++)
|
||||
if (mask.GetMaskRaw().at(i) != 0)
|
||||
raw[i] = UINT16_MAX;
|
||||
}
|
||||
const JFCalibration calib = GeneratePedestalCalibration(x);
|
||||
std::vector<CardImage> images;
|
||||
for (int s = 0; s < x.GetStorageCellNumber(); s++)
|
||||
images.push_back(ConvertedImage(x, calib, mask, raw, s));
|
||||
return MockDevices(x, images);
|
||||
}
|
||||
|
||||
// The default raw image of JFJochReceiverTest()
|
||||
inline AcquisitionDeviceGroup ConvertingMocks(const DiffractionExperiment &x, const PixelMask &mask) {
|
||||
std::vector<uint16_t> raw(RAW_MODULE_SIZE * x.GetModulesNum());
|
||||
for (int i = 0; i < raw.size(); i++)
|
||||
raw[i] = i % 65536;
|
||||
return ConvertingMocks(x, mask, raw);
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "../receiver/JFJochReceiverService.h"
|
||||
#include "../image_pusher/ZMQWriterNotificationPuller.h"
|
||||
#include "../image_puller/TestImagePuller.h"
|
||||
#include "../acquisition_device/MockAcquisitionDevice.h"
|
||||
|
||||
TEST_CASE("StreamWriterTest_ZMQ", "[StreamWriter]") {
|
||||
RegisterHDF5Filter();
|
||||
@@ -27,7 +28,7 @@ TEST_CASE("StreamWriterTest_ZMQ", "[StreamWriter]") {
|
||||
JFModuleGainCalibration gain;
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++)
|
||||
aq_devices.AddHLSDevice(64);
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(i, 64));
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
JFJochReceiverService fpga_receiver_service(aq_devices, logger, pusher);
|
||||
@@ -83,7 +84,7 @@ TEST_CASE("StreamWriterTest_ZMQ_Update", "[StreamWriter]") {
|
||||
JFModuleGainCalibration gain;
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++)
|
||||
aq_devices.AddHLSDevice(64);
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(i, 64));
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -144,7 +145,7 @@ TEST_CASE("StreamWriterTest_ZMQ_Update_NoNotification", "[StreamWriter]") {
|
||||
JFModuleGainCalibration gain;
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++)
|
||||
aq_devices.AddHLSDevice(64);
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(i, 64));
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
@@ -208,7 +209,7 @@ TEST_CASE("StreamWriterTest_ZMQ_MasterAfterAllDataFiles", "[StreamWriter]") {
|
||||
|
||||
AcquisitionDeviceGroup aq_devices;
|
||||
for (int i = 0; i < x.GetDataStreamsNum(); i++)
|
||||
aq_devices.AddHLSDevice(64);
|
||||
aq_devices.Add(std::make_unique<MockAcquisitionDevice>(i, 64));
|
||||
|
||||
ZMQStream2Pusher pusher({"ipc://*", "ipc://*"});
|
||||
pusher.WriterNotificationSocket("ipc://*");
|
||||
|
||||
Reference in new issue
Block a user