refactoring wip

This commit is contained in:
2025-07-02 19:38:42 +02:00
parent 67042e8315
commit 66ee7954db
3 changed files with 19 additions and 6 deletions

View File

@@ -206,14 +206,11 @@ std::string DataProcessor::CreateVirtualFile(
const std::string &filePath, const std::string &fileNamePrefix,
const uint64_t fileIndex, const bool overWriteEnable, const bool silentMode,
const int modulePos, const int numModX, const int numModY,
std::mutex *hdf5LibMutex) {
std::mutex *hdf5LibMutex, bool gotthard25um) {
int ny = generalData->nPixelsY;
if (generalData->dynamicRange == 4)
ny /= 2;
bool gotthard25um = ((generalData->detType == GOTTHARD ||
generalData->detType == GOTTHARD2) &&
(numModX * numModY) == 2);
// 0 for infinite files
uint32_t framesPerFile =

View File

@@ -70,7 +70,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
const bool overWriteEnable,
const bool silentMode, const int modulePos,
const int numModX, const int numModY,
std::mutex *hdf5LibMutex);
std::mutex *hdf5LibMutex, bool gotthard25um);
void LinkFileInMaster(const std::string &masterFileName,
const std::string &virtualFileName,
const bool silentMode, std::mutex *hdf5LibMutex);

View File

@@ -992,14 +992,30 @@ void Implementation::StartMasterWriter() {
fileFormatType, &masterAttributes, &hdf5LibMutex);
}
#ifdef HDF5C
// create virtual and master file
if (fileFormatType == HDF5) {
bool gotthard25um = ((generalData->detType == GOTTHARD || generalData->detType == GOTTHARD2) && (numPorts.x * numPorts.y) == 2);
// virtual hdf5 not allowed with roi for the following cases in hdf5
if (multiRoiMetadata.size() > 1 || (!multiRoiMetadata[0].completeRoi())) {
if (generalData->dynamicRange == 4) {
throw std::runtime_error("Skipping virtual hdf5 file since rx_roi is enabled and it is in 4 bit mode.");
}
if (gotthard25um && (numPorts.x * numPorts.y) == 2) {
throw std::runtime_error(
"Skipping virtual hdf5 file since rx_roi is "
"enabled and there are 2 Gotthard 25um modules.");
}
}
std::string virtualFileName;
// create virtual hdf5 file (if multiple files)
if (dataProcessor[0]->GetFilesInAcquisition() > 1 ||
(numPorts.x * numPorts.y) > 1) {
virtualFileName = dataProcessor[0]->CreateVirtualFile(
filePath, fileName, fileIndex, overwriteEnable, silentMode,
modulePos, numPorts.x, numPorts.y, &hdf5LibMutex);
modulePos, numPorts.x, numPorts.y, &hdf5LibMutex, gotthard25um);
}
// link file in master
if (masterFileWriteEnable) {