from the merge of 2.3

This commit is contained in:
Dhanya Maliakal 2017-03-24 12:22:49 +01:00
parent bb52676f50
commit 2bb8fa596a
3 changed files with 38 additions and 47 deletions

View File

@ -129,16 +129,32 @@ class BinaryFileStatic {
time_t t = time(0);
char message[MAX_STR_LENGTH];
sprintf(message,
"Version\t\t: %.1f\n"
"Dynamic Range\t: %d\n"
"Ten Giga\t: %d\n"
"Image Size\t: %d bytes\n"
"x\t\t: %d pixels\n"
"y\t\t: %d pixels\n"
"Total Frames\t: %lld\n"
"Exptime (ns)\t: %lld\n"
"Period (ns)\t: %lld\n"
"Timestamp\t: %s\n\n",
"Version : %.1f\n"
"Dynamic Range : %d\n"
"Ten Giga : %d\n"
"Image Size : %d bytes\n"
"x : %d pixels\n"
"y : %d pixels\n"
"Total Frames : %lld\n"
"Exptime (ns) : %lld\n"
"Period (ns) : %lld\n"
"Timestamp : %s\n\n"
"#Frame Header\n"
"Frame Number : 8 bytes\n"
"Exposure Length : 4 bytes\n"
"Packet Number : 4 bytes\n"
"Bunch ID : 8 bytes\n"
"Timestamp : 8 bytes\n"
"Module Id : 2 bytes\n"
"X Coordinate : 2 bytes\n"
"Y Coordinate : 2 bytes\n"
"Z Coordinate : 2 bytes\n"
"Debug : 4 bytes\n"
"Round Robin Number : 2 bytes\n"
"Detector Type : 1 byte\n"
"Header Version : 1 byte\n"
,
version,
dr,
tenE,

View File

@ -236,12 +236,6 @@ private:
*/
void StartRunning();
/**
* Verifies if the callbacks are registered for the callback variable
* @returns OK or FAIL
*/
int VerifyCallBackAction();
//*** Class Members ***

View File

@ -427,33 +427,6 @@ void UDPStandardImplementation::resetAcquisitionCount() {
}
int UDPStandardImplementation::VerifyCallBackAction() {
/** file path and file index not required?? or need to include detector index? do they need the datasize? its given for write data anyway */
callbackAction=startAcquisitionCallBack(filePath, fileName, fileIndex,
(generalData->fifoBufferSize) * numberofJobs + (generalData->fifoBufferHeaderSize), pStartAcquisition);
switch(callbackAction) {
case 0:
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;
break;
case 1:
if (rawDataReadyCallBack == NULL) {
FILE_LOG(logERROR) << "Callback action 1: RawDataReady call backs must be registered";
return FAIL;
}
cout << "Data Write defined externally" << endl;
break;
case 2:break;
default:
cprintf(RED,"Error: Unknown call back action.\n");
return FAIL;
}
return OK;
}
int UDPStandardImplementation::startReceiver(char *c) {
cout << endl << endl;
@ -470,13 +443,21 @@ int UDPStandardImplementation::startReceiver(char *c) {
//callbacks
callbackAction = DO_EVERYTHING;
if (startAcquisitionCallBack)
if (VerifyCallBackAction() == FAIL)
return FAIL;
if (startAcquisitionCallBack) {
callbackAction=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;
}
}
//processor->writer
if (fileWriteEnable) {
if (callbackAction > DO_NOTHING && SetupWriter() == FAIL) {
if (callbackAction == DO_EVERYTHING && SetupWriter() == FAIL) {
strcpy(c,"Could not create file.");
FILE_LOG(logERROR) << c;
return FAIL;