receiver master file includes quad, gap pixels enable, version updated for binary and hdf5

This commit is contained in:
2019-08-14 20:33:40 +02:00
parent 633c646239
commit 4d99ce8c52
11 changed files with 103 additions and 123 deletions

View File

@ -114,9 +114,7 @@ int BinaryFile::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_
}
int BinaryFile::CreateMasterFile(bool en, uint32_t size,
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t sp,
uint64_t ap) {
int BinaryFile::CreateMasterFile(masterAttributes& attr) {
//beginning of every acquisition
numFramesInFile = 0;
numActualPacketsInFile = 0;
@ -127,10 +125,9 @@ int BinaryFile::CreateMasterFile(bool en, uint32_t size,
if(!(*silentMode)) {
FILE_LOG(logINFO) << "Master File: " << masterFileName;
}
attr.version = BINARY_WRITER_VERSION;
return BinaryFileStatic::CreateMasterDataFile(masterfd, masterFileName,
*overWriteEnable,
*dynamicRange, en, size, nx, ny, *numImages, *maxFramesPerFile,
at, st, sp, ap, BINARY_WRITER_VERSION);
*overWriteEnable, attr);
}
return OK;
}

View File

@ -249,14 +249,11 @@ void DataProcessor::SetupFileWriter(bool fwe, int* nd, uint32_t* maxf,
}
// only the first file
int DataProcessor::CreateNewFile(bool en, uint64_t nf, uint64_t at, uint64_t st,
uint64_t sp, uint64_t ap) {
int DataProcessor::CreateNewFile(masterAttributes& attr) {
if (file == NULL)
return FAIL;
file->CloseAllFiles();
if (file->CreateMasterFile(en, generalData->imageSize,
generalData->nPixelsX, generalData->nPixelsY,
at, st, sp, ap) == FAIL)
if (file->CreateMasterFile(attr) == FAIL)
return FAIL;
if (file->CreateFile(currentFrameIndex) == FAIL)
return FAIL;

View File

@ -243,9 +243,7 @@ int HDF5File::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t
}
int HDF5File::CreateMasterFile(bool en, uint32_t size,
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t sp,
uint64_t ap) {
int HDF5File::CreateMasterFile(masterAttributes& attr) {
//beginning of every acquisition
numFramesInFile = 0;
@ -260,11 +258,9 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
FILE_LOG(logINFO) << "Master File: " << masterFileName;
}
pthread_mutex_lock(&Mutex);
attr.version = HDF5_WRITER_VERSION;
int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName,
*overWriteEnable,
*dynamicRange, en, size, nx, ny, *numImages, *maxFramesPerFile,
at, st, sp, ap,
HDF5_WRITER_VERSION);
*overWriteEnable, attr);
pthread_mutex_unlock(&Mutex);
return ret;
}

View File

@ -876,9 +876,23 @@ int UDPStandardImplementation::CreateUDPSockets() {
int UDPStandardImplementation::SetupWriter() {
bool error = false;
masterAttributes attr;
attr.detectorType = myDetectorType;
attr.dynamicRange = dynamicRange;
attr.tenGiga = tengigaEnable;
attr.imageSize = generalData->imageSize;
attr.nPixelsX = generalData->nPixelsX;
attr.nPixelsY = generalData->nPixelsY;
attr.maxFramesPerFile = framesPerFile;
attr.totalFrames = numberOfFrames;
attr.exptimeNs = acquisitionTime;
attr.subExptimeNs = subExpTime;
attr.subPeriodNs = subPeriod;
attr.periodNs = acquisitionPeriod;
attr.gapPixelsEnable = gapPixelsEnable;
attr.quadEnable = quadEnable;
for (unsigned int i = 0; i < dataProcessor.size(); ++i)
if (dataProcessor[i]->CreateNewFile(tengigaEnable,
numberOfFrames, acquisitionTime, subExpTime, subPeriod, acquisitionPeriod) == FAIL) {
if (dataProcessor[i]->CreateNewFile(attr) == FAIL) {
error = true;
break;
}