fix in receiver as x, y and z are properly integrated with detector server for eiger and jungfrau, and handling previous versions of detector where x y and z were all 0 (hardcoding them in 1 d)

This commit is contained in:
Dhanya Maliakal 2017-10-23 12:21:41 +02:00
parent 210bcb081d
commit 1f138abac1
2 changed files with 13 additions and 7 deletions

View File

@ -319,8 +319,8 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
/** timer beginning stamp for random streaming */
struct timespec timerBegin;
/** x coord hardcoded, as detector does not send them yet **/
uint16_t xcoord;
/** x coord hardcoded ad 1D, if detector does not send them yet **/
uint16_t xcoordin1D;

View File

@ -49,7 +49,7 @@ DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* d
streamingFrequency(freq),
streamingTimerInMs(timer),
currentFreqCount(0),
xcoord(0),
xcoordin1D(0),
acquisitionStartedFlag(false),
measurementStartedFlag(false),
firstAcquisitionIndex(0),
@ -235,7 +235,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) {
@ -369,9 +369,15 @@ void DataProcessor::ProcessAnImage(char* buf) {
}
// x coord for those not having standard header
if (!generalData->standardheader)
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);