works with hdf5

This commit is contained in:
maliakal_d 2021-09-16 10:09:30 +02:00
parent cb6cbaeeec
commit b98eee5b9a
2 changed files with 5 additions and 6 deletions

View File

@ -117,7 +117,9 @@ void HDF5MasterFile::CreateMasterFile(const std::string filePath,
Group group5(group3.createGroup("detector"));
Group group6(group1.createGroup("sample"));
groupId_ = group5.getId();
// TODO find a way to get complete group link
attrGroupName_ = "/entry/instrument/detector";
attr->WriteMasterHDF5Attributes(fd_, &group5);
fd_->close();
@ -137,15 +139,12 @@ void HDF5MasterFile::UpdateMasterFile(MasterAttributes *attr, bool silentMode) {
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
Group group = fd_->openGroup(attrGroupName_.c_str());
attr->WriteFinalHDF5Attributes(fd_, &group);
fd_->close();

View File

@ -25,5 +25,5 @@ class HDF5MasterFile : private virtual slsDetectorDefs, public File {
std::mutex *hdf5Lib_;
H5File *fd_{nullptr};
std::string fileName_;
hid_t groupId_{0};
std::string attrGroupName_;
};