mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-09 08:18:41 +01:00
refactoring wip
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user