From 1f138abac18a8ab9802bf817bd15acee899ca902 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Mon, 23 Oct 2017 12:21:41 +0200 Subject: [PATCH] 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) --- slsReceiverSoftware/include/DataProcessor.h | 4 ++-- slsReceiverSoftware/src/DataProcessor.cpp | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/slsReceiverSoftware/include/DataProcessor.h b/slsReceiverSoftware/include/DataProcessor.h index da8938df5..41ebe03d6 100644 --- a/slsReceiverSoftware/include/DataProcessor.h +++ b/slsReceiverSoftware/include/DataProcessor.h @@ -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; diff --git a/slsReceiverSoftware/src/DataProcessor.cpp b/slsReceiverSoftware/src/DataProcessor.cpp index 42e40a84b..fc3567c42 100644 --- a/slsReceiverSoftware/src/DataProcessor.cpp +++ b/slsReceiverSoftware/src/DataProcessor.cpp @@ -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);