mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-06-07 01:58:40 +02:00
readoutspeed in rx master file and other master file inconsistencies (#1245)
readout speed added to json and h5 master files. Also fixed master file inconsistencies Sserver binaries - update server binaries because readoutspeed needs to be sent to receiver with rx_hostname command API - added const to Detector class set/getburstmode Python - updated python bindings (burstmode const and roi arguments) Cmd generation - added pragma once in Caller.in.h as Caller is included in test files m3: num channels due to #counters < 3 * workaround for m3 for messed up num channels (client always assumes all counters enabled and adds them to num channels), fix for hdf5 g2: exptime master file inconsistency - exptime didnt match because of round of when setting burst mode (sets to a different clk divider) - so updating actual time for all timers (exptime, period, subexptime etc, ) in Module class, get timer values from detector when setting it and then send to receiver to write in master file ctb image size incorrect: - write actual size into master file and not the reserved size (digital reduces depending on dbit list and dbit offset) - added a calculate ctb image size free function in generalData.h that is used there as well as for the tests. master file inconsistencies - refactored master attributes writing using templates - names changed to keep it consistent between json and hdf5 master file (Version, Pixels, Exposure Times, GateDelays, Acquisition Period, etc.) - datatypes changed to keep it simple where possible: imageSize, dynamicRange, tengiga, quad, readnrows, analog, analogsamples, digital, digitalsamples, dbitreorder, dbitoffset, transceivermask, transeiver, transceiversamples, countermask, gates =>int - replacing "toString" with arrays, objects etc for eg for scan, rois, etc. - json header always written (empty dataset or empty brackets) - hdf5 needs const char* so have to convert strings to it, but taking care that strings exist prior to push_back - master attributes (redundant string literals->error prone tests for master file - suppressed deprecated functions in rapidjson warnings just for the tests - added slsREceiverSoftware/src to allow access to receiver_defs.h to test binary/hdf5 version - refactored acquire tests by moving all the acquire tests from individual detector type files to a single one=test-Caller-acquire.cpp - set some default settings (loadBasicSettings) for a basic acquire at load config part for the test_simulator python scripts. so minimum number of settings for detector to be set for any acquire tests. - added tests to test master files for json and hdf5= test-Caller-master-attributes.cpp - added option to add '-m' markers for tests using test_simulator python script
This commit is contained in:
@@ -738,43 +738,19 @@ TEST_CASE("rx_roi", "[.cmdcall]") {
|
||||
// check master file creation
|
||||
// TODO: check roi in master file
|
||||
{
|
||||
auto prev_write = det.getFileWrite().tsquash(
|
||||
"inconsistent file write values in test");
|
||||
auto prev_path = det.getFilePath().tsquash(
|
||||
"inconsistent file path values in test");
|
||||
auto prev_format = det.getFileFormat().tsquash(
|
||||
"inconsistent file format values in test");
|
||||
auto prev_index = det.getAcquisitionIndex().tsquash(
|
||||
"inconsistent file index values in test");
|
||||
auto prev_fname = det.getFileNamePrefix().tsquash(
|
||||
"inconsistent file name prefix values in test");
|
||||
|
||||
det.setFileWrite(true);
|
||||
det.setFilePath("/tmp");
|
||||
det.setFileNamePrefix("test");
|
||||
|
||||
det.setAcquisitionIndex(0);
|
||||
det.setFileFormat(defs::BINARY);
|
||||
REQUIRE_NOTHROW(caller.call("acquire", {}, -1, PUT));
|
||||
std::string file_path = "/tmp/test_master_0.json";
|
||||
REQUIRE(std::filesystem::exists(file_path) == true);
|
||||
create_files_for_acquire(det, caller);
|
||||
testFileInfo file_info;
|
||||
std::string master_file_prefix =
|
||||
file_info.getMasterFileNamePrefix();
|
||||
|
||||
std::string fname = master_file_prefix + ".json";
|
||||
REQUIRE(std::filesystem::exists(fname) == true);
|
||||
#ifdef HDF5C
|
||||
det.setAcquisitionIndex(0);
|
||||
det.setFileFormat(defs::HDF5);
|
||||
REQUIRE_NOTHROW(caller.call("acquire", {}, -1, PUT));
|
||||
file_path = "/tmp/test_master_0.h5";
|
||||
REQUIRE(std::filesystem::exists(file_path) == true);
|
||||
file_path = "/tmp/test_virtual_0.h5";
|
||||
REQUIRE(std::filesystem::exists(file_path) == true);
|
||||
fname = master_file_prefix + ".h5";
|
||||
REQUIRE(std::filesystem::exists(fname) == true);
|
||||
fname = file_info.getVirtualFileName();
|
||||
REQUIRE(std::filesystem::exists(fname) == true);
|
||||
#endif
|
||||
|
||||
det.setFileWrite(prev_write);
|
||||
if (!prev_path.empty())
|
||||
det.setFilePath(prev_path);
|
||||
det.setFileFormat(prev_format);
|
||||
det.setAcquisitionIndex(prev_index);
|
||||
det.setFileNamePrefix(prev_fname);
|
||||
}
|
||||
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
@@ -801,7 +777,11 @@ TEST_CASE("rx_clearroi", "[.cmdcall]") {
|
||||
REQUIRE(oss.str() == "rx_clearroi successful\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setRxROI(prev_val);
|
||||
if (prev_val.size() == 1 && prev_val[0].completeRoi()) {
|
||||
det.clearRxROI();
|
||||
} else {
|
||||
det.setRxROI(prev_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user