frames in file added for master file in receiver, binary done, hdf5 not done

This commit is contained in:
2021-09-15 17:10:01 +02:00
parent 732270f437
commit cb6cbaeeec
9 changed files with 154 additions and 21 deletions

View File

@ -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";
}
}