v1.0.0-rc.36

This commit is contained in:
2025-05-05 19:32:22 +02:00
parent 759243d1bf
commit 040cf08386
333 changed files with 22724 additions and 15251 deletions

View File

@@ -14,7 +14,7 @@ TEST_CASE("ImageBuffer_Location size") {
}
TEST_CASE("ImageBuffer") {
DiffractionExperiment experiment(DetectorGeometry(18,3,8,36));
DiffractionExperiment experiment(DetJF(18,3,8,36));
ImageBuffer buf_ctrl(4*experiment.GetImageBufferLocationSize());
buf_ctrl.StartMeasurement(experiment);
@@ -50,7 +50,7 @@ TEST_CASE("ImageBuffer") {
}
TEST_CASE("ImageBuffer_Preview_Access") {
DiffractionExperiment experiment(DetectorGeometry(18,3,8,36));
DiffractionExperiment experiment(DetJF(18,3,8,36));
ImageBuffer buf_ctrl(4*experiment.GetImageBufferLocationSize());
buf_ctrl.StartMeasurement(experiment);
@@ -71,11 +71,14 @@ TEST_CASE("ImageBuffer_Preview_Access") {
REQUIRE(ret2 != nullptr);
ret2->SetImageNumber(2);
ret2->SetImageSize(3456);
ret2->SetIndexed(true);
ret2->release();
ZeroCopyReturnValue *ret3 = buf_ctrl.GetImageSlot();
REQUIRE(ret3 != nullptr);
ret3->SetImageNumber(15);
ret3->SetImageSize(1234);
ret3->SetIndexed(false);
ret3->release();
REQUIRE(buf_ctrl.GetAvailSlots() == 4);
@@ -85,7 +88,7 @@ TEST_CASE("ImageBuffer_Preview_Access") {
REQUIRE(v[0] == 0);
REQUIRE(v[3] == 15);
std::vector<uint8_t> image_2, image_2_2, image_12;
std::vector<uint8_t> image_2, image_2_2, image_12, image_max, image_max_indexed;
REQUIRE(buf_ctrl.GetImage(image_2, 2));
REQUIRE(image_2.size() == 3456);
@@ -97,8 +100,51 @@ TEST_CASE("ImageBuffer_Preview_Access") {
REQUIRE(!buf_ctrl.GetImage(image_2_2, 2));
}
TEST_CASE("ImageBuffer_Preview_Access_GetImage_MaxImage") {
DiffractionExperiment experiment(DetJF(18,3,8,36));
ImageBuffer buf_ctrl(4*experiment.GetImageBufferLocationSize());
buf_ctrl.StartMeasurement(experiment);
REQUIRE(buf_ctrl.GetAvailSlots() == 4);
ZeroCopyReturnValue *ret0 = buf_ctrl.GetImageSlot();
REQUIRE(ret0 != nullptr);
ret0->SetImageNumber(0);
ret0->release();
ZeroCopyReturnValue *ret1 = buf_ctrl.GetImageSlot();
REQUIRE(ret1 != nullptr);
ret1->SetImageNumber(1);
ret1->release();
ZeroCopyReturnValue *ret2 = buf_ctrl.GetImageSlot();
REQUIRE(ret2 != nullptr);
ret2->SetImageNumber(2);
ret2->SetImageSize(3456);
ret2->SetIndexed(true);
ret2->release();
ZeroCopyReturnValue *ret3 = buf_ctrl.GetImageSlot();
REQUIRE(ret3 != nullptr);
ret3->SetImageNumber(15);
ret3->SetImageSize(1234);
ret3->SetIndexed(false);
ret3->release();
std::vector<uint8_t> image_max, image_max_indexed;
REQUIRE(buf_ctrl.GetImage(image_max, ImageBuffer::MaxImage));
REQUIRE(image_max.size() == 1234);
REQUIRE(buf_ctrl.GetImage(image_max_indexed, ImageBuffer::MaxIndexedImage));
REQUIRE(image_max_indexed.size() == 3456);
REQUIRE(buf_ctrl.Finalize(std::chrono::microseconds(1)));
}
TEST_CASE("ImageBuffer_Restart") {
DiffractionExperiment experiment(DetectorGeometry(18,3,8,36));
DiffractionExperiment experiment(DetJF(18,3,8,36));
ImageBuffer buf_ctrl(4*experiment.GetImageBufferLocationSize());
buf_ctrl.StartMeasurement(experiment);
@@ -126,7 +172,7 @@ TEST_CASE("ImageBuffer_Restart") {
}
TEST_CASE("ImageBuffer_BuffersNotReturned") {
DiffractionExperiment experiment(DetectorGeometry(18,3,8,36));
DiffractionExperiment experiment(DetJF(18,3,8,36));
ImageBuffer buf_ctrl(4*experiment.GetImageBufferLocationSize());
buf_ctrl.StartMeasurement(experiment);