mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 08:39:21 +01:00
slsReceiver, fixed virtual hdf5 last row random values bug
This commit is contained in:
@@ -265,9 +265,9 @@ void DataProcessor::CloseFiles() {
|
||||
file->CloseAllFiles();
|
||||
}
|
||||
|
||||
void DataProcessor::EndofAcquisition(uint64_t numf) {
|
||||
void DataProcessor::EndofAcquisition(bool anyPacketsCaught, uint64_t numf) {
|
||||
if (file && file->GetFileType() == HDF5) {
|
||||
file->EndofAcquisition(numf);
|
||||
file->EndofAcquisition(anyPacketsCaught, numf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -187,11 +187,11 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
|
||||
}
|
||||
|
||||
|
||||
void HDF5File::EndofAcquisition(uint64_t numf) {
|
||||
void HDF5File::EndofAcquisition(bool anyPacketsCaught, uint64_t numf) {
|
||||
//not created before
|
||||
if (!virtualfd) {
|
||||
if (!virtualfd && anyPacketsCaught) {
|
||||
|
||||
//only one file and one sub image
|
||||
//only one file and one sub image (link current file in master)
|
||||
if (((numFilesinAcquisition == 1) && (numDetY*numDetX) == 1)) {
|
||||
//dataset name
|
||||
ostringstream osfn;
|
||||
@@ -203,7 +203,7 @@ void HDF5File::EndofAcquisition(uint64_t numf) {
|
||||
pthread_mutex_unlock(&Mutex);
|
||||
}
|
||||
|
||||
//link current file in master file
|
||||
//create virutal file
|
||||
else
|
||||
CreateVirtualFile(numf);
|
||||
}
|
||||
@@ -213,7 +213,6 @@ void HDF5File::EndofAcquisition(uint64_t numf) {
|
||||
|
||||
int HDF5File::CreateVirtualFile(uint64_t numf) {
|
||||
if (master && (*detIndex==0)) {
|
||||
|
||||
pthread_mutex_lock(&Mutex);
|
||||
int ret = HDF5FileStatic::CreateVirtualDataFile(
|
||||
virtualfd, masterFileName,
|
||||
|
||||
@@ -516,8 +516,8 @@ void UDPStandardImplementation::stopReceiver(){
|
||||
if((*it)->GetMeasurementStartedFlag())
|
||||
anycaught = true;
|
||||
}
|
||||
if (anycaught)
|
||||
dataProcessor[0]->EndofAcquisition(maxIndexCaught); //to create virtual file
|
||||
//to create virtual file & set files/acquisition to 0 (only hdf5 at the moment)
|
||||
dataProcessor[0]->EndofAcquisition(anycaught, maxIndexCaught);
|
||||
}
|
||||
|
||||
//wait for the processes (DataStreamer) to be done
|
||||
@@ -622,14 +622,15 @@ void UDPStandardImplementation::shutDownUDPSockets() {
|
||||
|
||||
void UDPStandardImplementation::closeFiles() {
|
||||
uint64_t maxIndexCaught = 0;
|
||||
bool anycaught = false;
|
||||
for (vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it) {
|
||||
(*it)->CloseFiles();
|
||||
uint64_t temp = 0;
|
||||
temp = max(maxIndexCaught, (*it)->GetProcessedMeasurementIndex());
|
||||
maxIndexCaught = temp;
|
||||
maxIndexCaught = max(maxIndexCaught, (*it)->GetProcessedMeasurementIndex());
|
||||
if((*it)->GetMeasurementStartedFlag())
|
||||
anycaught = true;
|
||||
}
|
||||
if (maxIndexCaught)
|
||||
dataProcessor[0]->EndofAcquisition(maxIndexCaught);
|
||||
//to create virtual file & set files/acquisition to 0 (only hdf5 at the moment)
|
||||
dataProcessor[0]->EndofAcquisition(anycaught, maxIndexCaught);
|
||||
}
|
||||
|
||||
int UDPStandardImplementation::setUDPSocketBufferSize(const uint32_t s) {
|
||||
|
||||
Reference in New Issue
Block a user