mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-05 20:30:03 +02:00
fixed hardcoded values of nchip nchan etc from detPArameters
This commit is contained in:
parent
aabec193ff
commit
5073769403
@ -260,6 +260,26 @@ TEST_CASE("ctb_acquire_check_file_size", "[.cmdcall]") {
|
|||||||
test_ctb_acquire_with_receiver(test_ctb_config,
|
test_ctb_acquire_with_receiver(test_ctb_config,
|
||||||
num_frames_to_acquire, det, caller);
|
num_frames_to_acquire, det, caller);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
testCtbAcquireInfo test_ctb_config;
|
||||||
|
test_ctb_config.readout_mode = defs::TRANSCEIVER_ONLY;
|
||||||
|
test_ctb_config.dbit_offset = 16;
|
||||||
|
test_ctb_config.dbit_list.clear();
|
||||||
|
test_ctb_config.dbit_reorder = true;
|
||||||
|
set_ctb_config_state(det, test_ctb_config);
|
||||||
|
test_ctb_acquire_with_receiver(test_ctb_config,
|
||||||
|
num_frames_to_acquire, det, caller);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
testCtbAcquireInfo test_ctb_config;
|
||||||
|
test_ctb_config.readout_mode = defs::ANALOG_ONLY;
|
||||||
|
test_ctb_config.dbit_offset = 16;
|
||||||
|
test_ctb_config.dbit_list.clear();
|
||||||
|
test_ctb_config.dbit_reorder = true;
|
||||||
|
set_ctb_config_state(det, test_ctb_config);
|
||||||
|
test_ctb_acquire_with_receiver(test_ctb_config,
|
||||||
|
num_frames_to_acquire, det, caller);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,11 +57,16 @@ TEST_CASE("eiger_acquire_check_file_size", "[.cmdcall]") {
|
|||||||
test_frames_caught(det, num_frames_to_acquire);
|
test_frames_caught(det, num_frames_to_acquire);
|
||||||
|
|
||||||
// check file size (assuming local pc)
|
// check file size (assuming local pc)
|
||||||
// pixels_row_per_chip * pixels_col_per_chip * num_chips *
|
{
|
||||||
// bytes_per_pixel
|
detParameters par(det_type);
|
||||||
size_t expected_image_size = 256 * 256 * 2 * 2;
|
// data split into half due to 2 udp interfaces per half module
|
||||||
test_acquire_binary_file_size(test_file_info, num_frames_to_acquire,
|
int num_chips = (par.nChipX / 2);
|
||||||
expected_image_size);
|
int bytes_per_pixel = (dynamic_range / 8);
|
||||||
|
size_t expected_image_size =
|
||||||
|
par.nChanX * par.nChanY * num_chips * bytes_per_pixel;
|
||||||
|
test_acquire_binary_file_size(test_file_info, num_frames_to_acquire,
|
||||||
|
expected_image_size);
|
||||||
|
}
|
||||||
|
|
||||||
// restore previous state
|
// restore previous state
|
||||||
set_file_state(det, prev_file_info);
|
set_file_state(det, prev_file_info);
|
||||||
|
@ -58,11 +58,14 @@ TEST_CASE("gotthard2_acquire_check_file_size", "[.cmdcall]") {
|
|||||||
test_frames_caught(det, num_frames_to_acquire);
|
test_frames_caught(det, num_frames_to_acquire);
|
||||||
|
|
||||||
// check file size (assuming local pc)
|
// check file size (assuming local pc)
|
||||||
// num_channels * num_chips * bytes_per_pixel * num_frames
|
{
|
||||||
size_t expected_image_size = 128 * 10 * 2;
|
detParameters par(det_type);
|
||||||
test_acquire_binary_file_size(test_file_info, num_frames_to_acquire,
|
int bytes_per_pixel = det.getDynamicRange().squash() / 8;
|
||||||
expected_image_size);
|
size_t expected_image_size =
|
||||||
|
par.nChanX * par.nChipX * bytes_per_pixel;
|
||||||
|
test_acquire_binary_file_size(test_file_info, num_frames_to_acquire,
|
||||||
|
expected_image_size);
|
||||||
|
}
|
||||||
// restore previous state
|
// restore previous state
|
||||||
set_file_state(det, prev_file_info);
|
set_file_state(det, prev_file_info);
|
||||||
set_common_acquire_config_state(det, prev_det_config_info);
|
set_common_acquire_config_state(det, prev_det_config_info);
|
||||||
|
@ -52,17 +52,16 @@ TEST_CASE("jungfrau_acquire_check_file_size", "[.cmdcall]") {
|
|||||||
test_frames_caught(det, num_frames_to_acquire);
|
test_frames_caught(det, num_frames_to_acquire);
|
||||||
|
|
||||||
// check file size (assuming local pc)
|
// check file size (assuming local pc)
|
||||||
size_t expected_image_size = 0;
|
{
|
||||||
// pixels_row_per_chip * pixels_col_per_chip * num_chips *
|
detParameters par(det_type);
|
||||||
// bytes_per_pixel
|
int bytes_per_pixel = det.getDynamicRange().squash() / 8;
|
||||||
if (num_udp_interfaces == 1) {
|
// if 2 udp interfaces, data split into half
|
||||||
expected_image_size = 256 * 256 * 8 * 2;
|
size_t expected_image_size = (par.nChanX * par.nChanY * par.nChipX *
|
||||||
} else {
|
par.nChipY * bytes_per_pixel) /
|
||||||
expected_image_size = 256 * 256 * 4 * 2;
|
num_udp_interfaces;
|
||||||
|
test_acquire_binary_file_size(test_file_info, num_frames_to_acquire,
|
||||||
|
expected_image_size);
|
||||||
}
|
}
|
||||||
test_acquire_binary_file_size(test_file_info, num_frames_to_acquire,
|
|
||||||
expected_image_size);
|
|
||||||
|
|
||||||
// restore previous state
|
// restore previous state
|
||||||
set_file_state(det, prev_file_info);
|
set_file_state(det, prev_file_info);
|
||||||
set_common_acquire_config_state(det, prev_det_config_info);
|
set_common_acquire_config_state(det, prev_det_config_info);
|
||||||
|
@ -52,15 +52,16 @@ TEST_CASE("moench_acquire_check_file_size", "[.cmdcall]") {
|
|||||||
test_frames_caught(det, num_frames_to_acquire);
|
test_frames_caught(det, num_frames_to_acquire);
|
||||||
|
|
||||||
// check file size (assuming local pc)
|
// check file size (assuming local pc)
|
||||||
size_t expected_image_size = 0;
|
{
|
||||||
// pixels_row * pixels_col * bytes_per_pixel
|
detParameters par(det_type);
|
||||||
if (num_udp_interfaces == 1) {
|
int bytes_per_pixel = det.getDynamicRange().squash() / 8;
|
||||||
expected_image_size = 400 * 400 * 2;
|
// if 2 udp interfaces, data split into half
|
||||||
} else {
|
size_t expected_image_size = (par.nChanX * par.nChanY * par.nChipX *
|
||||||
expected_image_size = 400 * 200 * 2;
|
par.nChipY * bytes_per_pixel) /
|
||||||
|
num_udp_interfaces;
|
||||||
|
test_acquire_binary_file_size(test_file_info, num_frames_to_acquire,
|
||||||
|
expected_image_size);
|
||||||
}
|
}
|
||||||
test_acquire_binary_file_size(test_file_info, num_frames_to_acquire,
|
|
||||||
expected_image_size);
|
|
||||||
|
|
||||||
// restore previous state
|
// restore previous state
|
||||||
set_file_state(det, prev_file_info);
|
set_file_state(det, prev_file_info);
|
||||||
|
@ -45,8 +45,9 @@ TEST_CASE("mythen3_acquire_check_file_size", "[.cmdcall]") {
|
|||||||
set_common_acquire_config_state(det, det_config);
|
set_common_acquire_config_state(det, det_config);
|
||||||
|
|
||||||
// set default specific det type config
|
// set default specific det type config
|
||||||
det.setDynamicRange(16);
|
int test_dynamic_range = 16;
|
||||||
int test_counter_mask = 0x1;
|
det.setDynamicRange(test_dynamic_range);
|
||||||
|
int test_counter_mask = 0x3;
|
||||||
int num_counters = __builtin_popcount(test_counter_mask);
|
int num_counters = __builtin_popcount(test_counter_mask);
|
||||||
det.setCounterMask(test_counter_mask);
|
det.setCounterMask(test_counter_mask);
|
||||||
|
|
||||||
@ -57,10 +58,16 @@ TEST_CASE("mythen3_acquire_check_file_size", "[.cmdcall]") {
|
|||||||
test_frames_caught(det, num_frames_to_acquire);
|
test_frames_caught(det, num_frames_to_acquire);
|
||||||
|
|
||||||
// check file size (assuming local pc)
|
// check file size (assuming local pc)
|
||||||
// num_channels * num_chips * num_counters
|
{
|
||||||
size_t expected_image_size = 128 * 10 * num_counters * 2;
|
detParameters par(det_type);
|
||||||
test_acquire_binary_file_size(test_file_info, num_frames_to_acquire,
|
int bytes_per_pixel = test_dynamic_range / 8;
|
||||||
expected_image_size);
|
int num_channels_per_counter = par.nChanX / 3;
|
||||||
|
size_t expected_image_size = num_channels_per_counter *
|
||||||
|
num_counters * par.nChipX *
|
||||||
|
bytes_per_pixel;
|
||||||
|
test_acquire_binary_file_size(test_file_info, num_frames_to_acquire,
|
||||||
|
expected_image_size);
|
||||||
|
}
|
||||||
|
|
||||||
// restore previous state
|
// restore previous state
|
||||||
set_file_state(det, prev_file_info);
|
set_file_state(det, prev_file_info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user