mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 15:27:13 +02:00
removed copies
This commit is contained in:
@ -35,10 +35,6 @@ void BinaryFile::PrintMembers() {
|
||||
printf("Number of Frames in File: %d\n",numFramesInFile);
|
||||
}
|
||||
|
||||
FILE* BinaryFile::GetFileHandle() {
|
||||
return filefd;
|
||||
}
|
||||
|
||||
slsReceiverDefs::fileFormat BinaryFile::GetFileType() {
|
||||
return BINARY;
|
||||
}
|
||||
|
@ -32,9 +32,8 @@ pthread_mutex_t DataProcessor::Mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
|
||||
DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool* fwenable, bool* dsEnable,
|
||||
int* cbaction,
|
||||
void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
|
||||
char*, uint32_t, FILE*, void*),
|
||||
char*, uint32_t, void*),
|
||||
void *pDataReadycb) :
|
||||
|
||||
ThreadObject(NumberofDataProcessors),
|
||||
@ -51,7 +50,6 @@ DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool* fwenable, bool*
|
||||
file(0),
|
||||
fileFormatType(ftype),
|
||||
fileWriteEnable(fwenable),
|
||||
callbackAction(cbaction),
|
||||
rawDataReadyCallBack(dataReadycb),
|
||||
pRawDataReady(pDataReadycb)
|
||||
{
|
||||
@ -314,32 +312,28 @@ void DataProcessor::ProcessAnImage(char* buf) {
|
||||
RecordFirstIndices(fnum);
|
||||
}
|
||||
|
||||
if (*callbackAction == DO_EVERYTHING) {
|
||||
if (*fileWriteEnable)
|
||||
file->WriteToFile(buf, generalData->fifoBufferSize + sizeof(sls_detector_header), fnum-firstMeasurementIndex);
|
||||
} else {
|
||||
/*
|
||||
if (rawDataReadyCallBack)
|
||||
rawDataReadyCallBack(
|
||||
header->frameNumber,
|
||||
header->expLength,
|
||||
header->packetNumber,
|
||||
header->bunchId,
|
||||
header->timestamp,
|
||||
header->modId,
|
||||
header->xCoord,
|
||||
header->yCoord,
|
||||
header->zCoord,
|
||||
header->debug,
|
||||
header->roundRNumber,
|
||||
header->detType,
|
||||
header->version,
|
||||
buf + sizeof(sls_detector_header),
|
||||
generalData->imageSize,
|
||||
file->GetFileHandle(), pRawDataReady);
|
||||
*/
|
||||
file->GetBinaryFileHandle();
|
||||
//GetHDF5FileHandle
|
||||
}
|
||||
|
||||
if (*fileWriteEnable)
|
||||
file->WriteToFile(buf, generalData->fifoBufferSize + sizeof(sls_detector_header), fnum-firstMeasurementIndex);
|
||||
|
||||
if (rawDataReadyCallBack)
|
||||
rawDataReadyCallBack(
|
||||
header->frameNumber,
|
||||
header->expLength,
|
||||
header->packetNumber,
|
||||
header->bunchId,
|
||||
header->timestamp,
|
||||
header->modId,
|
||||
header->xCoord,
|
||||
header->yCoord,
|
||||
header->zCoord,
|
||||
header->debug,
|
||||
header->roundRNumber,
|
||||
header->detType,
|
||||
header->version,
|
||||
buf + sizeof(sls_detector_header),
|
||||
generalData->imageSize,
|
||||
pRawDataReady);
|
||||
|
||||
}
|
||||
|
||||
|
@ -66,10 +66,6 @@ void HDF5File::PrintMembers() {
|
||||
}
|
||||
|
||||
|
||||
H5File* HDF5File::GetHDF5FileHandle() {
|
||||
return filefd;
|
||||
}
|
||||
|
||||
void HDF5File::SetNumberofPixels(uint32_t nx, uint32_t ny) {
|
||||
nPixelsX = nx;
|
||||
nPixelsY = ny;
|
||||
|
@ -53,7 +53,6 @@ void UDPStandardImplementation::InitializeMembers() {
|
||||
//*** receiver parameters ***
|
||||
numThreads = 1;
|
||||
numberofJobs = 1;
|
||||
callbackAction = DO_EVERYTHING;
|
||||
|
||||
//*** mutex ***
|
||||
pthread_mutex_init(&statusMutex,NULL);
|
||||
@ -373,7 +372,7 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) {
|
||||
for ( int i=0; i < numThreads; ++i ) {
|
||||
listener.push_back(new Listener(fifo[i], &status, &udpPortNum[i], eth, &activated, &numberOfFrames, &dynamicRange));
|
||||
dataProcessor.push_back(new DataProcessor(fifo[i], &fileFormatType, &fileWriteEnable, &dataStreamEnable,
|
||||
&callbackAction, rawDataReadyCallBack,pRawDataReady));
|
||||
rawDataReadyCallBack,pRawDataReady));
|
||||
if (Listener::GetErrorMask() || DataProcessor::GetErrorMask()) {
|
||||
FILE_LOG (logERROR) << "Error: Could not creates listener/dataprocessor threads (index:" << i << ")";
|
||||
for (vector<Listener*>::const_iterator it = listener.begin(); it != listener.end(); ++it)
|
||||
@ -442,28 +441,22 @@ int UDPStandardImplementation::startReceiver(char *c) {
|
||||
}
|
||||
|
||||
//callbacks
|
||||
callbackAction = DO_EVERYTHING;
|
||||
if (startAcquisitionCallBack) {
|
||||
callbackAction=startAcquisitionCallBack(filePath, fileName, fileIndex,
|
||||
startAcquisitionCallBack(filePath, fileName, fileIndex,
|
||||
(generalData->fifoBufferSize) * numberofJobs + (generalData->fifoBufferHeaderSize), pStartAcquisition);
|
||||
if (callbackAction == DO_NOTHING) {
|
||||
if (acquisitionFinishedCallBack == NULL || rawDataReadyCallBack == NULL) {
|
||||
FILE_LOG(logERROR) << "Callback action 0: All the call backs must be registered";
|
||||
return FAIL;
|
||||
}
|
||||
cout << "Start Acquisition, Acquisition Finished and Data Write has been defined externally" << endl;
|
||||
}
|
||||
if (rawDataReadyCallBack != NULL)
|
||||
cout << "Data Write has been defined externally" << endl;
|
||||
}
|
||||
|
||||
//processor->writer
|
||||
if (fileWriteEnable) {
|
||||
if (callbackAction == DO_EVERYTHING && SetupWriter() == FAIL) {
|
||||
if (SetupWriter() == FAIL) {
|
||||
strcpy(c,"Could not create file.");
|
||||
FILE_LOG(logERROR) << c;
|
||||
return FAIL;
|
||||
}
|
||||
} else
|
||||
cout << " Data will not be saved" << endl;
|
||||
cout << "File Write Disabled" << endl;
|
||||
|
||||
cout << "Ready ..." << endl;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user