diff --git a/slsDetectorSoftware/slsReceiver/receiver_defs.h b/slsDetectorSoftware/slsReceiver/receiver_defs.h index a2cc1aaf6..6472966cd 100755 --- a/slsDetectorSoftware/slsReceiver/receiver_defs.h +++ b/slsDetectorSoftware/slsReceiver/receiver_defs.h @@ -7,6 +7,11 @@ #define GOODBYE -200 +#define DO_NOTHING 0 +#define CREATE_FILES 1 +#define DO_EVERYTHING 2 + + //all max frames defined in sls_detector_defs.h. 20000 gotthard, 100000 for short gotthard, 1000 for moench #define FIFO_SIZE 25000 diff --git a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp index b40a4484b..4b1894663 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp +++ b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp @@ -448,11 +448,13 @@ int slsReceiverFunctionList::startWriting(){ //by default, we read/write everything - cbAction=2; + cbAction = DO_EVERYTHING; //acquisition start call back returns enable write if (startAcquisitionCallBack) cbAction=startAcquisitionCallBack(filePath,fileName,fileIndex,bufferSize,pStartAcquisition); - if(enableFileWrite==0 || cbAction==0) + if(cbAction < DO_EVERYTHING) + cout << endl << "Note: Call back activated. Data saving must be taken care of by user in call back." << endl; + else if(enableFileWrite==0) cout << endl << "Note: Data will not be saved" << endl; @@ -466,7 +468,7 @@ int slsReceiverFunctionList::startWriting(){ if(frameIndexNeeded==-1) sprintf(savefilename, "%s/%s_%d.raw", filePath,fileName,fileIndex); else sprintf(savefilename, "%s/%s_f%012d_%d.raw", filePath,fileName,framesCaught,fileIndex); - if(enableFileWrite || cbAction>0){ + if(enableFileWrite && cbAction > DO_NOTHING){ //sync file and close fd if(sfilefd) { msync(address,memsize, MS_ASYNC); @@ -516,31 +518,28 @@ int slsReceiverFunctionList::startWriting(){ //currframenum = (int)(*((int*)wbuf)); //cout<<"**************curreframenm:"<=2) memcpy(latestData,wbuf,bufferSize); strcpy(guiFileName,savefilename); guiDataReady=1;