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,
|
static int CreateDataFile(int ind, bool owenable, string fname, bool frindexenable,
|
||||||
uint64_t fnum, uint64_t nDimx, uint32_t nDimy, uint32_t nDimz,
|
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,
|
double version, uint64_t maxchunkedimages,
|
||||||
DataSpace* dspace_para, DataSet* dset_para[])
|
DataSpace*& dspace_para, DataSet* dset_para[])
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Exception::dontPrint(); //to handle errors
|
Exception::dontPrint(); //to handle errors
|
||||||
|
@ -100,6 +100,8 @@ int HDF5File::CreateFile(uint64_t fnum) {
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&Mutex);
|
pthread_mutex_unlock(&Mutex);
|
||||||
|
if (dataspace == NULL)
|
||||||
|
cprintf(RED,"Got nothing!\n");
|
||||||
printf("%d HDF5 File: %s\n", index, currentFileName.c_str());
|
printf("%d HDF5 File: %s\n", index, currentFileName.c_str());
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -168,18 +170,22 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
|
|||||||
void HDF5File::EndofAcquisition(uint64_t numf) {
|
void HDF5File::EndofAcquisition(uint64_t numf) {
|
||||||
//not created before
|
//not created before
|
||||||
if (!virtualfd) {
|
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))
|
//only one file and one sub image
|
||||||
CreateVirtualFile(numf);
|
if (((numFilesinAcquisition == 1) && (numDetY*numDetX) == 1)) {
|
||||||
//link current file in master file
|
|
||||||
else {
|
|
||||||
//dataset name
|
//dataset name
|
||||||
ostringstream osfn;
|
ostringstream osfn;
|
||||||
osfn << "/data";
|
osfn << "/data";
|
||||||
if (*frameIndexEnable) osfn << "_f" << setfill('0') << setw(12) << 0;
|
if (*frameIndexEnable) osfn << "_f" << setfill('0') << setw(12) << 0;
|
||||||
string dsetname = osfn.str();
|
string dsetname = osfn.str();
|
||||||
|
pthread_mutex_lock(&Mutex);
|
||||||
HDF5FileStatic::LinkVirtualInMaster(masterFileName, currentFileName, dsetname);
|
HDF5FileStatic::LinkVirtualInMaster(masterFileName, currentFileName, dsetname);
|
||||||
|
pthread_mutex_unlock(&Mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//link current file in master file
|
||||||
|
else
|
||||||
|
CreateVirtualFile(numf);
|
||||||
}
|
}
|
||||||
numFilesinAcquisition = 0;
|
numFilesinAcquisition = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user