mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 16:20:03 +02:00
merge solved from developer, xcoord from detector if given
This commit is contained in:
commit
ce7386e230
@ -343,8 +343,9 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
||||
/** temporary buffer for processing */
|
||||
char* tempBuffer;
|
||||
|
||||
/** 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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -79,6 +79,9 @@ public:
|
||||
/** Streaming (for ROI - mainly short Gotthard) - Image size (in bytes) */
|
||||
uint32_t imageSizeComplete;
|
||||
|
||||
/** if standard header implemented in firmware */
|
||||
bool standardheader;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -104,7 +107,8 @@ public:
|
||||
headerPacketSize(0),
|
||||
nPixelsXComplete(0),
|
||||
nPixelsYComplete(0),
|
||||
imageSizeComplete(0)
|
||||
imageSizeComplete(0),
|
||||
standardheader(false)
|
||||
{};
|
||||
|
||||
/** Destructor */
|
||||
@ -207,6 +211,7 @@ public:
|
||||
FILE_LOG(logDEBUG) << "Complete Pixels X: " << nPixelsXComplete;
|
||||
FILE_LOG(logDEBUG) << "Complete Pixels Y: " << nPixelsYComplete;
|
||||
FILE_LOG(logDEBUG) << "Complete Image Size: " << imageSizeComplete;
|
||||
FILE_LOG(logDEBUG) << "Standard Header: " << standardheader;
|
||||
};
|
||||
};
|
||||
|
||||
@ -484,7 +489,7 @@ class JungfrauData : public GeneralData {
|
||||
maxFramesPerFile = JFRAU_MAX_FRAMES_PER_FILE;
|
||||
fifoBufferHeaderSize= FIFO_HEADER_NUMBYTES + sizeof(slsReceiverDefs::sls_detector_header);
|
||||
defaultFifoDepth = 2500;
|
||||
|
||||
standardheader = true;
|
||||
};
|
||||
|
||||
};
|
||||
@ -509,6 +514,7 @@ class EigerData : public GeneralData {
|
||||
defaultFifoDepth = 100;
|
||||
threadsPerReceiver = 2;
|
||||
headerPacketSize = 40;
|
||||
standardheader = true;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -290,9 +290,6 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
||||
/** Listening buffer for one packet - might be removed when we can peek and eiger fnum is in header */
|
||||
char* listeningPacket;
|
||||
|
||||
/** if the standard header is implemented in firmware */
|
||||
bool standardheader;
|
||||
|
||||
/** if the udp socket is connected */
|
||||
bool udpSocketAlive;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user