mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
works with hdf5
This commit is contained in:
parent
cb6cbaeeec
commit
b98eee5b9a
@ -117,7 +117,9 @@ void HDF5MasterFile::CreateMasterFile(const std::string filePath,
|
|||||||
Group group5(group3.createGroup("detector"));
|
Group group5(group3.createGroup("detector"));
|
||||||
Group group6(group1.createGroup("sample"));
|
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);
|
attr->WriteMasterHDF5Attributes(fd_, &group5);
|
||||||
fd_->close();
|
fd_->close();
|
||||||
|
|
||||||
@ -137,15 +139,12 @@ void HDF5MasterFile::UpdateMasterFile(MasterAttributes *attr, bool silentMode) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Exception::dontPrint(); // to handle errors
|
Exception::dontPrint(); // to handle errors
|
||||||
|
|
||||||
FileAccPropList flist;
|
FileAccPropList flist;
|
||||||
flist.setFcloseDegree(H5F_CLOSE_STRONG);
|
flist.setFcloseDegree(H5F_CLOSE_STRONG);
|
||||||
fd_ = new H5File(fileName_.c_str(), H5F_ACC_RDWR,
|
fd_ = new H5File(fileName_.c_str(), H5F_ACC_RDWR,
|
||||||
FileCreatPropList::DEFAULT, flist);
|
FileCreatPropList::DEFAULT, flist);
|
||||||
|
|
||||||
Group group(groupId_);
|
Group group = fd_->openGroup(attrGroupName_.c_str());
|
||||||
|
|
||||||
// cannot do this TODO
|
|
||||||
attr->WriteFinalHDF5Attributes(fd_, &group);
|
attr->WriteFinalHDF5Attributes(fd_, &group);
|
||||||
fd_->close();
|
fd_->close();
|
||||||
|
|
||||||
|
@ -25,5 +25,5 @@ class HDF5MasterFile : private virtual slsDetectorDefs, public File {
|
|||||||
std::mutex *hdf5Lib_;
|
std::mutex *hdf5Lib_;
|
||||||
H5File *fd_{nullptr};
|
H5File *fd_{nullptr};
|
||||||
std::string fileName_;
|
std::string fileName_;
|
||||||
hid_t groupId_{0};
|
std::string attrGroupName_;
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user