mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00
hdf5 basic works
This commit is contained in:
parent
f53770a2fc
commit
b7291dffb9
@ -355,9 +355,9 @@ public:
|
||||
*/
|
||||
static int CreateDataFile(int ind, bool owenable, string fname, bool frindexenable,
|
||||
uint64_t fnum, uint64_t nDimx, uint32_t nDimy, uint32_t nDimz,
|
||||
DataType dtype, H5File*& fd, DataSpace* dspace, DataSet* dset,
|
||||
DataType dtype, H5File*& fd, DataSpace*& dspace, DataSet*& dset,
|
||||
double version, uint64_t maxchunkedimages,
|
||||
DataSpace* dspace_para, DataSet* dset_para[])
|
||||
DataSpace*& dspace_para, DataSet* dset_para[])
|
||||
{
|
||||
try {
|
||||
Exception::dontPrint(); //to handle errors
|
||||
|
@ -100,6 +100,8 @@ int HDF5File::CreateFile(uint64_t fnum) {
|
||||
return FAIL;
|
||||
}
|
||||
pthread_mutex_unlock(&Mutex);
|
||||
if (dataspace == NULL)
|
||||
cprintf(RED,"Got nothing!\n");
|
||||
printf("%d HDF5 File: %s\n", index, currentFileName.c_str());
|
||||
return OK;
|
||||
}
|
||||
@ -168,18 +170,22 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
|
||||
void HDF5File::EndofAcquisition(uint64_t numf) {
|
||||
//not created before
|
||||
if (!virtualfd) {
|
||||
//create virtual file only if more than 1 file or more than 1 detector(more than 1 file)
|
||||
if (((numFilesinAcquisition > 1) ||(numDetY*numDetX) > 1))
|
||||
CreateVirtualFile(numf);
|
||||
//link current file in master file
|
||||
else {
|
||||
|
||||
//only one file and one sub image
|
||||
if (((numFilesinAcquisition == 1) && (numDetY*numDetX) == 1)) {
|
||||
//dataset name
|
||||
ostringstream osfn;
|
||||
osfn << "/data";
|
||||
if (*frameIndexEnable) osfn << "_f" << setfill('0') << setw(12) << 0;
|
||||
string dsetname = osfn.str();
|
||||
pthread_mutex_lock(&Mutex);
|
||||
HDF5FileStatic::LinkVirtualInMaster(masterFileName, currentFileName, dsetname);
|
||||
pthread_mutex_unlock(&Mutex);
|
||||
}
|
||||
|
||||
//link current file in master file
|
||||
else
|
||||
CreateVirtualFile(numf);
|
||||
}
|
||||
numFilesinAcquisition = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user