mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-19 00:07:13 +02:00
merge from developer (without the additional json header implementations)
This commit is contained in:
@ -344,10 +344,12 @@ void DataProcessor::ProcessAnImage(char* buf) {
|
||||
*dynamicRange);
|
||||
|
||||
|
||||
// deactivated and padding enabled
|
||||
if ((!(*activated) && *deactivatedPaddingEnable) ||
|
||||
// frame padding
|
||||
(*framePadding && nump < generalData->packetsPerFrame))
|
||||
// frame padding
|
||||
if (*activated && *framePadding && nump < generalData->packetsPerFrame)
|
||||
PadMissingPackets(buf);
|
||||
|
||||
// deactivated and padding enabled
|
||||
else if (!(*activated) && *deactivatedPaddingEnable)
|
||||
PadMissingPackets(buf);
|
||||
|
||||
// normal call back
|
||||
|
@ -54,7 +54,8 @@ Listener::Listener(int ind, detectorType dtype, Fifo* f, runStatus* s,
|
||||
listeningPacket(nullptr),
|
||||
udpSocketAlive(0),
|
||||
numPacketsStatistic(0),
|
||||
numFramesStatistic(0)
|
||||
numFramesStatistic(0),
|
||||
oddStartingPacket(true)
|
||||
{
|
||||
if(ThreadObject::CreateThread() == FAIL)
|
||||
throw std::exception();
|
||||
@ -428,7 +429,7 @@ uint32_t Listener::ListenToAnImage(char* buf) {
|
||||
// -------------------old header -----------------------------------------------------------------------------
|
||||
else {
|
||||
generalData->GetHeaderInfo(index, carryOverPacket + esize,
|
||||
*dynamicRange, fnum, pnum, snum, bid);
|
||||
*dynamicRange, oddStartingPacket, fnum, pnum, snum, bid);
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
if (fnum != currentFrameIndex) {
|
||||
@ -544,8 +545,13 @@ uint32_t Listener::ListenToAnImage(char* buf) {
|
||||
}
|
||||
// -------------------old header -----------------------------------------------------------------------------
|
||||
else {
|
||||
// set first packet to be odd or even (check required when switching from roi to no roi)
|
||||
if (myDetectorType == GOTTHARD && !measurementStartedFlag) {
|
||||
oddStartingPacket = generalData->SetOddStartingPacket(index, listeningPacket + esize);
|
||||
}
|
||||
|
||||
generalData->GetHeaderInfo(index, listeningPacket + esize,
|
||||
*dynamicRange, fnum, pnum, snum, bid);
|
||||
*dynamicRange, oddStartingPacket, fnum, pnum, snum, bid);
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -565,6 +571,13 @@ uint32_t Listener::ListenToAnImage(char* buf) {
|
||||
if (!measurementStartedFlag)
|
||||
RecordFirstIndices(fnum);
|
||||
|
||||
if (pnum >= pperFrame ) {
|
||||
FILE_LOG(logERROR, ("Bad packet %d (fnum:%lld), throwing away. "
|
||||
"Packets caught so far: %d\n",
|
||||
pnum, (long long int)fnum, numpackets));
|
||||
return 0; // bad packet
|
||||
}
|
||||
|
||||
//future packet by looking at image number (all other detectors)
|
||||
if (fnum != currentFrameIndex) {
|
||||
carryOverFlag = true;
|
||||
|
Reference in New Issue
Block a user