mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-15 22:37:14 +02:00
frames in file added for master file in receiver, binary done, hdf5 not done
This commit is contained in:
@ -117,6 +117,7 @@ void HDF5MasterFile::CreateMasterFile(const std::string filePath,
|
||||
Group group5(group3.createGroup("detector"));
|
||||
Group group6(group1.createGroup("sample"));
|
||||
|
||||
groupId_ = group5.getId();
|
||||
attr->WriteMasterHDF5Attributes(fd_, &group5);
|
||||
fd_->close();
|
||||
|
||||
@ -129,4 +130,32 @@ void HDF5MasterFile::CreateMasterFile(const std::string filePath,
|
||||
if (!silentMode) {
|
||||
LOG(logINFO) << "Master File: " << fileName_;
|
||||
}
|
||||
}
|
||||
|
||||
void HDF5MasterFile::UpdateMasterFile(MasterAttributes *attr, bool silentMode) {
|
||||
std::lock_guard<std::mutex> lock(*hdf5Lib_);
|
||||
|
||||
try {
|
||||
Exception::dontPrint(); // to handle errors
|
||||
|
||||
FileAccPropList flist;
|
||||
flist.setFcloseDegree(H5F_CLOSE_STRONG);
|
||||
fd_ = new H5File(fileName_.c_str(), H5F_ACC_RDWR,
|
||||
FileCreatPropList::DEFAULT, flist);
|
||||
|
||||
Group group(groupId_);
|
||||
|
||||
// cannot do this TODO
|
||||
attr->WriteFinalHDF5Attributes(fd_, &group);
|
||||
fd_->close();
|
||||
|
||||
} catch (const Exception &error) {
|
||||
error.printErrorStack();
|
||||
CloseFile();
|
||||
throw sls::RuntimeError(
|
||||
"Could not create/overwrite master HDF5 handles");
|
||||
}
|
||||
if (!silentMode) {
|
||||
LOG(logINFO) << "Updated Master File";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user