minor modifications for interpolation and mythe data structure

This commit is contained in:
2019-02-06 16:22:17 +01:00
parent 9e5ec6a57b
commit dcad6c80ce
17 changed files with 582 additions and 158 deletions

View File

@ -64,12 +64,9 @@ Listener::Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
Listener::~Listener() {
if (udpSocket){
delete udpSocket;
sem_post(&semaphore_socket);
sem_destroy(&semaphore_socket);
}
if (udpSocket) delete udpSocket;
sem_post(&semaphore_socket);
sem_destroy(&semaphore_socket);
if (carryOverPacket) delete [] carryOverPacket;
if (listeningPacket) delete [] listeningPacket;
ThreadObject::DestroyThread();
@ -560,14 +557,20 @@ uint32_t Listener::ListenToAnImage(char* buf) {
lastCaughtFrameIndex = fnum;
#ifdef VERBOSE
//#ifdef VERBOSE
//if (!index)
cprintf(GREEN,"Listening %d: currentfindex:%lu, fnum:%lu, pnum:%u numpackets:%u\n",
index,currentFrameIndex, fnum, pnum, numpackets);
#endif
//#endif
if (!measurementStartedFlag)
RecordFirstIndices(fnum);
if (pnum >= pperFrame ) {
cprintf(RED,"bad packet, throwing away. packets caught so far: %d\n", numpackets);
return 0; // bad packet
}
//future packet by looking at image number (all other detectors)
if (fnum != currentFrameIndex) {
//cprintf(RED,"setting carry over flag to true num:%llu nump:%u\n",fnum, numpackets );
@ -603,6 +606,7 @@ uint32_t Listener::ListenToAnImage(char* buf) {
memcpy(buf + fifohsize + (pnum * dsize) - 2, listeningPacket + hsize, dsize+2);
break;
case JUNGFRAUCTB:
if (pnum == (pperFrame-1))
memcpy(buf + fifohsize + (pnum * dsize), listeningPacket + hsize, corrected_dsize);
else