merge solved from developer, xcoord from detector if given

This commit is contained in:
Dhanya Maliakal
2017-10-23 17:21:45 +02:00
5 changed files with 23 additions and 21 deletions

View File

@ -52,7 +52,7 @@ DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* d
streamingTimerInMs(timer),
currentFreqCount(0),
tempBuffer(0),
xcoord(0),
xcoordin1D(0),
acquisitionStartedFlag(false),
measurementStartedFlag(false),
firstAcquisitionIndex(0),
@ -247,7 +247,7 @@ void DataProcessor::SetupFileWriter(bool fwe, int* nd, char* fname, char* fpath,
if (g)
generalData = g;
// fix xcoord as detector is not providing it right now
xcoord = ((NumberofDataProcessors > (*nunits)) ? index : ((*dindex) * (*nunits)) + index);
xcoordin1D = ((NumberofDataProcessors > (*nunits)) ? index : ((*dindex) * (*nunits)) + index);
if (file) {
@ -383,8 +383,15 @@ void DataProcessor::ProcessAnImage(char* buf) {
if (*gapPixelsEnable && (*dynamicRange!=4))
InsertGapPixels(buf + sizeof(sls_detector_header), *dynamicRange);
// fix x coord that is currently not provided by detector
header->xCoord = xcoord;
// x coord is 0 for detector in pos [0,0,0]
if (xcoordin1D) {
// do nothing as detector has correctly send them
if (header->xCoord || header->yCoord || header->zCoord)
;
// detector has send all 0's when there should have been a value greater than 0 in some dimension
else
header->xCoord = xcoordin1D;
}
if (file)
file->WriteToFile(buf, generalData->imageSize + sizeof(sls_detector_header), fnum-firstMeasurementIndex, nump);

View File

@ -60,16 +60,6 @@ Listener::Listener(detectorType dtype, Fifo*& f, runStatus* s, uint32_t* portno,
}
NumberofListeners++;
FILE_LOG (logDEBUG) << "Number of Listeners: " << NumberofListeners;
switch(myDetectorType){
case JUNGFRAU:
case EIGER:
standardheader = true;
break;
default:
standardheader = false;
break;
}
}
@ -345,6 +335,7 @@ uint32_t Listener::ListenToAnImage(char* buf) {
bool isHeaderEmpty = true;
sls_detector_header* old_header = 0;
sls_detector_header* new_header = 0;
bool standardheader = generalData->standardheader;
//reset to -1