mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 10:30:41 +02:00
write number of frames and period in file header
This commit is contained in:
parent
c364b28922
commit
45fc87240f
@ -243,6 +243,13 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
|
|||||||
*/
|
*/
|
||||||
void closeFile(int ithread = 0);
|
void closeFile(int ithread = 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Activate / Deactivate Receiver
|
||||||
|
* If deactivated, receiver will write dummy packets 0xFF
|
||||||
|
* (as it will receive nothing from detector)
|
||||||
|
*/
|
||||||
|
int setActivate(int enable = -1);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* Getters ***************************************************************
|
* Getters ***************************************************************
|
||||||
@ -601,7 +608,7 @@ private:
|
|||||||
/** If file created successfully for all Writer Threads */
|
/** If file created successfully for all Writer Threads */
|
||||||
bool fileCreateSuccess;
|
bool fileCreateSuccess;
|
||||||
|
|
||||||
const static int FILE_HEADER_SIZE = 400;
|
const static int FILE_HEADER_SIZE = 500;
|
||||||
|
|
||||||
char fileHeader[MAX_NUMBER_OF_WRITER_THREADS][FILE_HEADER_SIZE];
|
char fileHeader[MAX_NUMBER_OF_WRITER_THREADS][FILE_HEADER_SIZE];
|
||||||
|
|
||||||
|
@ -597,6 +597,10 @@ int UDPStandardImplementation::setAcquisitionPeriod(const uint64_t i){
|
|||||||
|
|
||||||
FILE_LOG(logINFO) << "Acquisition Period: " << (double)acquisitionPeriod/(1E9) << "s";
|
FILE_LOG(logINFO) << "Acquisition Period: " << (double)acquisitionPeriod/(1E9) << "s";
|
||||||
|
|
||||||
|
if(myDetectorType == EIGER)
|
||||||
|
for(int i=0; i<MAX_NUMBER_OF_WRITER_THREADS; i++)
|
||||||
|
updateFileHeader(i);
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -610,6 +614,10 @@ int UDPStandardImplementation::setNumberOfFrames(const uint64_t i){
|
|||||||
|
|
||||||
FILE_LOG(logINFO) << "Number of Frames:" << numberOfFrames;
|
FILE_LOG(logINFO) << "Number of Frames:" << numberOfFrames;
|
||||||
|
|
||||||
|
if(myDetectorType == EIGER)
|
||||||
|
for(int i=0; i<MAX_NUMBER_OF_WRITER_THREADS; i++)
|
||||||
|
updateFileHeader(i);
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1234,6 +1242,21 @@ void UDPStandardImplementation::closeFile(int ithread){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//eiger only
|
||||||
|
int UDPStandardImplementation::setActivate(int enable){
|
||||||
|
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
||||||
|
|
||||||
|
if(enable != -1){
|
||||||
|
activated = enable;
|
||||||
|
FILE_LOG(logINFO) << "Activation: " << stringEnable(activated);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0; i<MAX_NUMBER_OF_WRITER_THREADS; i++)
|
||||||
|
updateFileHeader(i);
|
||||||
|
|
||||||
|
return activated;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@ -3139,6 +3162,8 @@ void UDPStandardImplementation::updateFileHeader(int ithread){
|
|||||||
"Data\t\t: %d bytes\n"
|
"Data\t\t: %d bytes\n"
|
||||||
"x\t\t: %d pixels\n"
|
"x\t\t: %d pixels\n"
|
||||||
"y\t\t: %d pixels\n"
|
"y\t\t: %d pixels\n"
|
||||||
|
"Frames\t\t: %lld\n"
|
||||||
|
"Period (ns)\t: %lld\n"
|
||||||
"Timestamp\t: %s\n\n"
|
"Timestamp\t: %s\n\n"
|
||||||
|
|
||||||
//only for eiger right now
|
//only for eiger right now
|
||||||
@ -3158,9 +3183,11 @@ void UDPStandardImplementation::updateFileHeader(int ithread){
|
|||||||
onePacketSize,oneDataSize,
|
onePacketSize,oneDataSize,
|
||||||
//only for eiger right now
|
//only for eiger right now
|
||||||
EIGER_PIXELS_IN_ONE_ROW,EIGER_PIXELS_IN_ONE_COL,
|
EIGER_PIXELS_IN_ONE_ROW,EIGER_PIXELS_IN_ONE_COL,
|
||||||
|
(long long int)numberOfFrames,
|
||||||
|
(long long int)acquisitionPeriod,
|
||||||
ctime(&t));
|
ctime(&t));
|
||||||
if(strlen(fileHeader[ithread]) > FILE_HEADER_SIZE)
|
if(strlen(fileHeader[ithread]) > FILE_HEADER_SIZE)
|
||||||
cprintf(BG_RED,"File Header Size is too small for file header\n");
|
cprintf(BG_RED,"File Header Size %d is too small for fixed file header size %d\n",strlen(fileHeader[ithread]),FILE_HEADER_SIZE);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user