size change in receiver call back API now streamed, gui allows smaller packet size than expected to be caught and replaced the rest with 0xFF

This commit is contained in:
2018-03-21 17:08:38 +01:00
parent a1936cb884
commit a74e8f68f7
16 changed files with 83 additions and 54 deletions

View File

@ -35,8 +35,9 @@ bool DataProcessor::SilentMode(false);
DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr,
uint32_t* freq, uint32_t* timer,
void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*),
void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t,
uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t*, void*),
void *pDataReadycb) :
ThreadObject(NumberofDataProcessors),
@ -316,7 +317,7 @@ void DataProcessor::ThreadExecution() {
return;
}
ProcessAnImage(buffer + FIFO_HEADER_NUMBYTES);
ProcessAnImage(buffer);
//stream (if time/freq to stream) or free
if (*dataStreamEnable && SendToStreamer())
@ -348,7 +349,7 @@ void DataProcessor::StopProcessing(char* buf) {
/** buf includes only the standard header */
void DataProcessor::ProcessAnImage(char* buf) {
sls_detector_header* header = (sls_detector_header*) (buf);
sls_detector_header* header = (sls_detector_header*) (buf + FIFO_HEADER_NUMBYTES);
uint64_t fnum = header->frameNumber;
currentFrameIndex = fnum;
uint32_t nump = header->packetNumber;
@ -381,7 +382,7 @@ void DataProcessor::ProcessAnImage(char* buf) {
}
if (*gapPixelsEnable && (*dynamicRange!=4))
InsertGapPixels(buf + sizeof(sls_detector_header), *dynamicRange);
InsertGapPixels(buf + FIFO_HEADER_NUMBYTES + sizeof(sls_detector_header), *dynamicRange);
// x coord is 0 for detector in pos [0,0,0]
if (xcoordin1D) {
@ -409,14 +410,14 @@ void DataProcessor::ProcessAnImage(char* buf) {
header->roundRNumber,
header->detType,
header->version,
buf + sizeof(sls_detector_header),
generalData->imageSize,
buf + FIFO_HEADER_NUMBYTES + sizeof(sls_detector_header),
(uint32_t*)buf,
pRawDataReady);
}
if (file)
file->WriteToFile(buf, sizeof(sls_detector_header) + generalData->imageSize, fnum-firstMeasurementIndex, nump);
file->WriteToFile(buf + FIFO_HEADER_NUMBYTES, sizeof(sls_detector_header) + (uint32_t)(*((uint32_t*)buf)), fnum-firstMeasurementIndex, nump);