mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
removing warnings, hdfmutexlib moved from class member in dataprocessor to just arguments when required in dataprocessor (setupfilewriter and createvirtualfile)
This commit is contained in:
parent
4fce0dcd9c
commit
ae9691e848
@ -34,15 +34,14 @@ DataProcessor::DataProcessor(int index, detectorType detectorType, Fifo *fifo,
|
||||
uint32_t *streamingTimerInMs,
|
||||
uint32_t *streamingStartFnum, bool *framePadding,
|
||||
std::vector<int> *ctbDbitList, int *ctbDbitOffset,
|
||||
int *ctbAnalogDataBytes, std::mutex *hdf5Lib)
|
||||
int *ctbAnalogDataBytes)
|
||||
: ThreadObject(index, typeName_), fifo_(fifo), detectorType_(detectorType),
|
||||
dataStreamEnable_(dataStreamEnable), activated_(activated),
|
||||
streamingFrequency_(streamingFrequency),
|
||||
streamingTimerInMs_(streamingTimerInMs),
|
||||
streamingStartFnum_(streamingStartFnum), framePadding_(framePadding),
|
||||
ctbDbitList_(ctbDbitList), ctbDbitOffset_(ctbDbitOffset),
|
||||
ctbAnalogDataBytes_(ctbAnalogDataBytes), firstStreamerFrame_(false),
|
||||
hdf5Lib_(hdf5Lib) {
|
||||
ctbAnalogDataBytes_(ctbAnalogDataBytes), firstStreamerFrame_(false) {
|
||||
|
||||
LOG(logDEBUG) << "DataProcessor " << index << " created";
|
||||
|
||||
@ -124,16 +123,16 @@ void DataProcessor::DeleteFiles() {
|
||||
void DataProcessor::SetupFileWriter(const bool filewriteEnable,
|
||||
const bool masterFilewriteEnable,
|
||||
const fileFormat fileFormatType,
|
||||
const int modulePos) {
|
||||
const int modulePos, std::mutex *hdf5Lib) {
|
||||
DeleteFiles();
|
||||
if (filewriteEnable) {
|
||||
switch (fileFormatType) {
|
||||
#ifdef HDF5C
|
||||
case HDF5:
|
||||
dataFile_ = new HDF5DataFile(index, hdf5Lib_);
|
||||
dataFile_ = new HDF5DataFile(index, hdf5Lib);
|
||||
if (modulePos == 0 && index == 0) {
|
||||
if (masterFilewriteEnable) {
|
||||
masterFile_ = new HDF5MasterFile(hdf5Lib_);
|
||||
masterFile_ = new HDF5MasterFile(hdf5Lib);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -208,12 +207,13 @@ void DataProcessor::CreateVirtualFile(
|
||||
const uint64_t fileIndex, const bool overWriteEnable, const bool silentMode,
|
||||
const int modulePos, const int numUnitsPerReadout,
|
||||
const uint32_t maxFramesPerFile, const uint64_t numImages,
|
||||
const uint32_t dynamicRange, const int numModX, const int numModY) {
|
||||
const uint32_t dynamicRange, const int numModX, const int numModY,
|
||||
std::mutex *hdf5Lib) {
|
||||
|
||||
if (virtualFile_) {
|
||||
delete virtualFile_;
|
||||
}
|
||||
virtualFile_ = new HDF5VirtualFile(hdf5Lib_);
|
||||
virtualFile_ = new HDF5VirtualFile(hdf5Lib);
|
||||
|
||||
uint64_t numImagesProcessed = GetProcessedIndex() + 1;
|
||||
// maxframesperfile = 0 for infinite files
|
||||
|
@ -32,7 +32,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
||||
uint32_t *streamingFrequency, uint32_t *streamingTimerInMs,
|
||||
uint32_t *streamingStartFnum, bool *framePadding,
|
||||
std::vector<int> *ctbDbitList, int *ctbDbitOffset,
|
||||
int *ctbAnalogDataBytes, std::mutex *hdf5Lib);
|
||||
int *ctbAnalogDataBytes);
|
||||
|
||||
~DataProcessor() override;
|
||||
|
||||
@ -52,7 +52,8 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
||||
void DeleteFiles();
|
||||
void SetupFileWriter(const bool filewriteEnable,
|
||||
const bool masterFilewriteEnable,
|
||||
const fileFormat fileFormatType, const int modulePos);
|
||||
const fileFormat fileFormatType, const int modulePos,
|
||||
std::mutex *hdf5Lib);
|
||||
|
||||
void CreateFirstFiles(MasterAttributes *attr, const std::string filePath,
|
||||
const std::string fileNamePrefix,
|
||||
@ -73,7 +74,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
||||
const uint32_t maxFramesPerFile,
|
||||
const uint64_t numImages,
|
||||
const uint32_t dynamicRange, const int numModX,
|
||||
const int numModY);
|
||||
const int numModY, std::mutex *hdf5Lib);
|
||||
void LinkDataInMasterFile(const bool silentMode);
|
||||
#endif
|
||||
void UpdateMasterFile(bool silentMode);
|
||||
@ -188,7 +189,6 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
|
||||
|
||||
File *dataFile_{nullptr};
|
||||
File *masterFile_{nullptr};
|
||||
std::mutex *hdf5Lib_;
|
||||
#ifdef HDF5C
|
||||
File *virtualFile_{nullptr};
|
||||
#endif
|
||||
|
@ -174,7 +174,7 @@ void Implementation::setDetectorType(const detectorType d) {
|
||||
i, detType, fifo_ptr, &activated, &dataStreamEnable,
|
||||
&streamingFrequency, &streamingTimerInMs, &streamingStartFnum,
|
||||
&framePadding, &ctbDbitList, &ctbDbitOffset,
|
||||
&ctbAnalogDataBytes, &hdf5Lib));
|
||||
&ctbAnalogDataBytes));
|
||||
} catch (...) {
|
||||
listener.clear();
|
||||
dataProcessor.clear();
|
||||
@ -237,7 +237,7 @@ void Implementation::setModulePositionId(const int id) {
|
||||
|
||||
for (const auto &it : dataProcessor)
|
||||
it->SetupFileWriter(fileWriteEnable, masterFileWriteEnable,
|
||||
fileFormatType, modulePos);
|
||||
fileFormatType, modulePos, &hdf5Lib);
|
||||
assert(numMods[1] != 0);
|
||||
for (unsigned int i = 0; i < listener.size(); ++i) {
|
||||
uint16_t row = 0, col = 0;
|
||||
@ -345,7 +345,7 @@ void Implementation::setFileFormat(const fileFormat f) {
|
||||
}
|
||||
for (const auto &it : dataProcessor)
|
||||
it->SetupFileWriter(fileWriteEnable, masterFileWriteEnable,
|
||||
fileFormatType, modulePos);
|
||||
fileFormatType, modulePos, &hdf5Lib);
|
||||
}
|
||||
|
||||
LOG(logINFO) << "File Format: " << sls::ToString(fileFormatType);
|
||||
@ -382,7 +382,7 @@ void Implementation::setFileWriteEnable(const bool b) {
|
||||
fileWriteEnable = b;
|
||||
for (const auto &it : dataProcessor)
|
||||
it->SetupFileWriter(fileWriteEnable, masterFileWriteEnable,
|
||||
fileFormatType, modulePos);
|
||||
fileFormatType, modulePos, &hdf5Lib);
|
||||
}
|
||||
LOG(logINFO) << "File Write Enable: "
|
||||
<< (fileWriteEnable ? "enabled" : "disabled");
|
||||
@ -397,7 +397,7 @@ void Implementation::setMasterFileWriteEnable(const bool b) {
|
||||
masterFileWriteEnable = b;
|
||||
for (const auto &it : dataProcessor)
|
||||
it->SetupFileWriter(fileWriteEnable, masterFileWriteEnable,
|
||||
fileFormatType, modulePos);
|
||||
fileFormatType, modulePos, &hdf5Lib);
|
||||
}
|
||||
LOG(logINFO) << "Master File Write Enable: "
|
||||
<< (masterFileWriteEnable ? "enabled" : "disabled");
|
||||
@ -566,7 +566,7 @@ void Implementation::stopReceiver() {
|
||||
dataProcessor[0]->CreateVirtualFile(
|
||||
filePath, fileName, fileIndex, overwriteEnable, silentMode,
|
||||
modulePos, numThreads, framesPerFile, numberOfTotalFrames,
|
||||
dynamicRange, numMods[X], numMods[Y]);
|
||||
dynamicRange, numMods[X], numMods[Y], &hdf5Lib);
|
||||
}
|
||||
// link file in master
|
||||
dataProcessor[0]->LinkDataInMasterFile(silentMode);
|
||||
@ -895,7 +895,7 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
|
||||
i, detType, fifo_ptr, &activated, &dataStreamEnable,
|
||||
&streamingFrequency, &streamingTimerInMs,
|
||||
&streamingStartFnum, &framePadding, &ctbDbitList,
|
||||
&ctbDbitOffset, &ctbAnalogDataBytes, &hdf5Lib));
|
||||
&ctbDbitOffset, &ctbAnalogDataBytes));
|
||||
dataProcessor[i]->SetGeneralData(generalData);
|
||||
} catch (...) {
|
||||
listener.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user