halfway into new server

This commit is contained in:
Dhanya Maliakal 2015-09-03 12:00:37 +02:00
parent 41a4a9b611
commit 74366b3cfe
5 changed files with 105 additions and 247 deletions

View File

@ -483,25 +483,25 @@ protected:
//// Could be done more fine-grained... TODO //// Could be done more fine-grained... TODO
// private: // private:
protected: protected:
/** structure of an eiger image header*/ /** structure of an eiger packet*/
typedef struct typedef struct
{ {
unsigned char header_before1[5]; unsigned char subframenum[4];
unsigned char header_confirm[1]; unsigned char missingpacket[2];
unsigned char header_before2[14]; unsigned char portnum[1];
//unsigned char header_before[20]; unsigned char dynamicrange[1];
unsigned char fnum[4]; } eiger_packet_header_t;
unsigned char header_after[24];
} eiger_image_header;
/** structure of an eiger image header*/
typedef struct typedef struct
{ {
unsigned char num1[4]; unsigned char framenum[6];
unsigned char num2[2]; unsigned char packetnum[2];
unsigned char num3[1]; } eiger_packet_footer_t;
unsigned char num4[1];
} eiger_packet_header; eiger_packet_header_t* eiger_packet_header;
unsigned char* eiger_packet_data;
eiger_packet_footer_t* eiger_packet_footer;
/** max number of listening threads */ /** max number of listening threads */
const static int MAX_NUM_LISTENING_THREADS = EIGER_MAX_PORTS; const static int MAX_NUM_LISTENING_THREADS = EIGER_MAX_PORTS;
@ -626,9 +626,12 @@ protected:
/** buffer size. different from framesize as we wait for one packet instead of frame for eiger */ /** buffer size. different from framesize as we wait for one packet instead of frame for eiger */
int bufferSize; int bufferSize;
/** oen buffer size */ /** one buffer size */
int onePacketSize; int onePacketSize;
/** one buffer size */
int oneDataSize;
/** latest data */ /** latest data */
char* latestData; char* latestData;

View File

@ -485,8 +485,6 @@ private:
void handleDataCompression(int ithread, char* wbuffer[], char* data, int xmax, int ymax, int &nf); void handleDataCompression(int ithread, char* wbuffer[], char* data, int xmax, int ymax, int &nf);
public: public:

View File

@ -1561,97 +1561,6 @@ int UDPBaseImplementation::startWriting(){ FILE_LOG(logDEBUG) << __AT__ << " sta
while((1<<ithread)&writerthreads_mask){ while((1<<ithread)&writerthreads_mask){
#ifdef VERYDEBUG
cout << ithread << " ***waiting to pop out of writing fifo" << endl;
#endif
//pop
for(i=0;i<numListeningThreads;++i){
fifo[i]->pop(wbuf[i]);
numpackets = (uint16_t)(*((uint16_t*)wbuf[i]));
#ifdef VERYDEBUG
cout << ithread << " numpackets:" << dec << numpackets << endl;
#endif
}
#ifdef VERYDEBUG
cout << ithread << " numpackets:" << dec << numpackets << endl;
cout << ithread << " *** writer popped from fifo " << (void*) wbuf[0]<< endl;
cout << ithread << " *** writer popped from fifo " << (void*) wbuf[1]<< endl;
#endif
//last dummy packet
if(numpackets == 0xFFFF){
stopWriting(ithread,wbuf);
continue;
}
//for progress
if(myDetectorType == EIGER){
tempframenum = htonl(*(unsigned int*)((eiger_image_header *)((char*)(wbuf[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->fnum);
tempframenum += (startFrameIndex-1); //eiger frame numbers start at 1, so need to -1
}else if ((myDetectorType == GOTTHARD) && (shortFrame == -1))
tempframenum = (((((uint32_t)(*((uint32_t*)(wbuf[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))))+1)& (frameIndexMask)) >> frameIndexOffset);
else
tempframenum = ((((uint32_t)(*((uint32_t*)(wbuf[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))))& (frameIndexMask)) >> frameIndexOffset);
if(numWriterThreads == 1)
currframenum = tempframenum;
else{
pthread_mutex_lock(&progress_mutex);
if(tempframenum > currframenum)
currframenum = tempframenum;
pthread_mutex_unlock(&progress_mutex);
}
//#ifdef VERYDEBUG
if(myDetectorType == EIGER)
cout << endl <<ithread << " tempframenum:" << hex << tempframenum << " curframenum:" << currframenum << endl;
//#endif
//without datacompression: write datacall back, or write data, free fifo
if(!dataCompression){
if (cbAction < DO_EVERYTHING){
for(i=0;i<numListeningThreads;++i)
rawDataReadyCallBack(currframenum, wbuf[i], numpackets * onePacketSize, sfilefd, guiData,pRawDataReady);
}else if (numpackets > 0){
for(i=0;i<numListeningThreads;++i)
writeToFile_withoutCompression(wbuf[i], numpackets,currframenum);
}
if(myDetectorType == EIGER) {
copyFrameToGui(wbuf,currframenum);
for(i=0;i<numListeningThreads;++i){
while(!fifoFree[i]->push(wbuf[i]));
#ifdef VERYDEBUG
cout << ithread << ":" << i+j << " fifo freed:" << (void*)wbuf[i] << endl;
#endif
}
}
else{
//copy to gui
copyFrameToGui(NULL,-1,wbuf[0]+HEADER_SIZE_NUM_TOT_PACKETS);
#ifdef VERYVERBOSE
cout << ithread << " finished copying" << endl;
#endif
while(!fifoFree[0]->push(wbuf[0]));
#ifdef VERYVERBOSE
cout<<"buf freed:"<<(void*)wbuf[0]<<endl;
#endif
}
}
//data compression
else
handleDataCompression(ithread,wbuf,d, xmax, ymax, nf);

View File

@ -23,7 +23,7 @@
#include <string.h> #include <string.h>
#include <iostream> #include <iostream>
#include <stdint.h>
using namespace std; using namespace std;
@ -39,7 +39,6 @@ UDPStandardImplementation::UDPStandardImplementation()
//guiFrameNumber(0), //guiFrameNumber(0),
//tengigaEnable(0) //tengigaEnable(0)
{ {
thread_started = 0; thread_started = 0;
eth = NULL; eth = NULL;
latestData = NULL; latestData = NULL;
@ -141,6 +140,7 @@ void UDPStandardImplementation::initializeMembers(){
frameSize = 0; frameSize = 0;
bufferSize = 0; bufferSize = 0;
onePacketSize = 0; onePacketSize = 0;
oneDataSize = 0;
guiDataReady = 0; guiDataReady = 0;
nFrameToGui = 0; nFrameToGui = 0;
fifosize = 0; fifosize = 0;
@ -200,6 +200,7 @@ void UDPStandardImplementation::initializeMembers(){
//strcpy(fileName,"run"); //strcpy(fileName,"run");
//status //status
pthread_mutex_lock(&status_mutex); pthread_mutex_lock(&status_mutex);
status = IDLE; status = IDLE;
@ -246,6 +247,7 @@ void UDPStandardImplementation::deleteMembers(){ FILE_LOG(logDEBUG) << __AT__ <
if(fifo[i]) {delete fifo[i]; fifo[i] = NULL;} if(fifo[i]) {delete fifo[i]; fifo[i] = NULL;}
if(fifoFree[i]) {delete fifoFree[i]; fifoFree[i] = NULL;} if(fifoFree[i]) {delete fifoFree[i]; fifoFree[i] = NULL;}
} }
} }
@ -323,6 +325,7 @@ int UDPStandardImplementation::setDetectorType(detectorType det){ FILE_LOG(logD
fifosize = EIGER_FIFO_SIZE; fifosize = EIGER_FIFO_SIZE;
packetsPerFrame = EIGER_ONE_GIGA_CONSTANT * dynamicRange * EIGER_MAX_PORTS; packetsPerFrame = EIGER_ONE_GIGA_CONSTANT * dynamicRange * EIGER_MAX_PORTS;
onePacketSize = EIGER_ONE_GIGA_ONE_PACKET_SIZE; onePacketSize = EIGER_ONE_GIGA_ONE_PACKET_SIZE;
oneDataSize = EIGER_ONE_GIGA_ONE_DATA_SIZE;
frameSize = onePacketSize * packetsPerFrame; frameSize = onePacketSize * packetsPerFrame;
bufferSize = (frameSize/EIGER_MAX_PORTS) + EIGER_HEADER_LENGTH;//everything one port gets (img header plus packets) bufferSize = (frameSize/EIGER_MAX_PORTS) + EIGER_HEADER_LENGTH;//everything one port gets (img header plus packets)
maxPacketsPerFile = EIGER_MAX_FRAMES_PER_FILE * packetsPerFrame; maxPacketsPerFile = EIGER_MAX_FRAMES_PER_FILE * packetsPerFrame;
@ -337,6 +340,8 @@ int UDPStandardImplementation::setDetectorType(detectorType det){ FILE_LOG(logD
createListeningThreads(true); createListeningThreads(true);
numListeningThreads = MAX_NUM_LISTENING_THREADS; numListeningThreads = MAX_NUM_LISTENING_THREADS;
} else if(myDetectorType == JUNGFRAUCTB || myDetectorType == JUNGFRAU ){ } else if(myDetectorType == JUNGFRAUCTB || myDetectorType == JUNGFRAU ){
fifosize = JCTB_FIFO_SIZE; fifosize = JCTB_FIFO_SIZE;
packetsPerFrame = JCTB_PACKETS_PER_FRAME; packetsPerFrame = JCTB_PACKETS_PER_FRAME;
@ -1004,13 +1009,6 @@ cout << "copyframe" << endl;
for(int j=0;j<packetsPerFrame;++j) for(int j=0;j<packetsPerFrame;++j)
memcpy((((char*)latestData)+j * onePacketSize) ,startbuf[j],onePacketSize); memcpy((((char*)latestData)+j * onePacketSize) ,startbuf[j],onePacketSize);
/*
for(int j=25;j<27;++j)
for(int i=1000;i<1010;i=i+2)
//cout<<"startbuf:"<<dec<<i<<hex<<":\t0x"<<htonl((uint32_t)(*((uint32_t*)(startbuf[1] + HEADER_SIZE_NUM_TOT_PACKETS+ EIGER_HEADER_LENGTH+8+ i))))<<endl;
cout<<"startbuf:"<<dec<<i<<hex<<":\t0x"<<((uint16_t)(*((uint16_t*)(startbuf[1] + 2+ 48+ j*1040+8+ i))))<<endl;
*/
guiFrameNumber = fnum; guiFrameNumber = fnum;
}else//other detectors }else//other detectors
memcpy(latestData,buf,bufferSize); memcpy(latestData,buf,bufferSize);
@ -1767,15 +1765,8 @@ int UDPStandardImplementation::startListening(){
if(rc == EIGER_HEADER_LENGTH && myDetectorType == EIGER) { if(rc == EIGER_HEADER_LENGTH && myDetectorType == EIGER) {
while(rc == EIGER_HEADER_LENGTH){ while(rc == EIGER_HEADER_LENGTH){
rc = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS, maxBufferSize); rc = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS, maxBufferSize);
/*cprintf(MAGENTA,"%d got a header*****************************\n",ithread); }
cprintf(MAGENTA,"tempframenum[%d]:%d\n",ithread,(htonl(*(uint32_t*)(((eiger_image_header *)((char*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->fnum))));
*/}
} }
/* if(rc == 1040){
cprintf(CYAN,"tempframenum[%d]:%d\n",ithread,((*(uint32_t*)(((eiger_packet_header *)((char*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->num1))));
cprintf(CYAN,"packetnum[%d]:%d\n",ithread,((*(uint8_t*)(((eiger_packet_header *)((char*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->num4))));
cprintf(CYAN,"add[%d]:0x%x\n",ithread,(void*)(buffer[ithread]));
}*/
expected = maxBufferSize; expected = maxBufferSize;
#ifdef SOCKET_DEBUG #ifdef SOCKET_DEBUG
}else{ }else{
@ -1908,9 +1899,6 @@ int UDPStandardImplementation::startListening(){
cprintf(BLUE,"%d listener going to push fifo: 0x%x\n", ithread,(void*)(buffer[ithread])); cprintf(BLUE,"%d listener going to push fifo: 0x%x\n", ithread,(void*)(buffer[ithread]));
#endif #endif
while(!fifo[ithread]->push(buffer[ithread])); while(!fifo[ithread]->push(buffer[ithread]));
/*cprintf(YELLOW,"tempframenum[%d]:%d\n",ithread,((*(uint32_t*)(((eiger_packet_header *)((char*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->num1))));
cprintf(YELLOW,"packetnum[%d]:%d\n",ithread,((*(uint8_t*)(((eiger_packet_header *)((char*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->num4))));
cprintf(YELLOW,"add[%d]:0x%x\n",ithread,(void*)(buffer[ithread]));*/
#ifdef FIFO_DEBUG #ifdef FIFO_DEBUG
cprintf(BLUE, "%d listener pushed into fifo %x\n",ithread, (void*)(buffer[ithread])); cprintf(BLUE, "%d listener pushed into fifo %x\n",ithread, (void*)(buffer[ithread]));
#endif #endif
@ -2019,15 +2007,24 @@ int UDPStandardImplementation::startWriting(){
//blank frame //blank frame
if(myDetectorType == EIGER){ if(myDetectorType == EIGER){
for(i=0;i<packetsPerFrame;++i){ for(i=0;i<packetsPerFrame;++i){
if(blankframe[i]){delete [] blankframe[i]; blankframe[i] = 0;} if(blankframe[i]){delete [] blankframe[i]; blankframe[i] = 0;}
blankframe[i] = new char[onePacketSize];
(*(uint8_t*)(((eiger_packet_header *)((char*)(blankframe[i])))->num3)) = 0xFF;
for(j=0;j<(onePacketSize-16);++j) //blank frame for each packet
(*((uint8_t*)((char*)(blankframe[i])+8+j))) = 0xFF; blankframe[i] = new char[onePacketSize];
if ((*(uint8_t*)(((eiger_packet_header *)((char*)(blankframe[i])))->num3)) != 0xFF){ eiger_packet_header = (eiger_packet_header_t*) blankframe[i];
cprintf(RED,"blank frame not detected at %d: 0x%x\n",i,(*(uint8_t*)(((eiger_packet_header *)((char*)(blankframe[i])))->num3)) ); //set missing packet to 0xff
*( (uint16_t*) eiger_packet_header->missingpacket) = 0xFF;
//set each value inside blank frame to 0xff
for(j=0;j<(oneDataSize);++j){
eiger_packet_data = blankframe[i] + sizeof(eiger_packet_header_t) + j;
*(eiger_packet_data) = 0xFF;
}
//verify
if (*( (uint16_t*) eiger_packet_header->missingpacket) != 0xFF){
cprintf(RED,"blank frame not detected at %d: 0x%x\n",i,*( (uint16_t*) eiger_packet_header->missingpacket) );
exit(-1); exit(-1);
} }
#ifdef FIFO_DEBUG #ifdef FIFO_DEBUG
@ -2084,8 +2081,8 @@ int UDPStandardImplementation::startWriting(){
}else{ }else{
endofacquisition = false; endofacquisition = false;
if(numpackets[i] == 1040){ if(numpackets[i] == 1040){
cprintf(BLUE,"tempframenum[%d]:%d\n",i,((*(uint32_t*)(((eiger_packet_header *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->num1)))); cprintf(BLUE,"tempframenum[%d]:%d\n",i,((*(uint32_t*)(((eiger_packet_1g *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->framenum))));
cprintf(BLUE,"packetnum[%d]:%d\n",i,((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->num4)))); cprintf(BLUE,"packetnum[%d]:%d\n",i,((*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->packetnum))));
}else if(numpackets[i] == EIGER_HEADER_LENGTH){ }else if(numpackets[i] == EIGER_HEADER_LENGTH){
cprintf(BG_RED, "got header in writer, weirdd packetsize:%d\n",numpackets[i]); cprintf(BG_RED, "got header in writer, weirdd packetsize:%d\n",numpackets[i]);
exit(-1); exit(-1);
@ -2151,19 +2148,19 @@ int UDPStandardImplementation::startWriting(){
for(j=0;j<numberofmissingpackets[i];++j){ for(j=0;j<numberofmissingpackets[i];++j){
tempbuffer[tempoffset[i]] = blankframe[blankoffset]; tempbuffer[tempoffset[i]] = blankframe[blankoffset];
#ifdef VERYDEBUG #ifdef VERYDEBUG
if ((*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3))&0x2) if (*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket))
cprintf(RED,"1 fifo:%d missing packet added at pnum:%d\n",i,tempoffset[i]); cprintf(RED,"1 fifo:%d missing packet added at pnum:%d\n",i,tempoffset[i]);
else cprintf(RED, "1 fifo:%d Weird at pnum:%d\n",i,tempoffset[i]); else cprintf(RED, "1 fifo:%d Weird at pnum:%d\n",i,tempoffset[i]);
#endif #endif
if (!((*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3))&0x2)){ if ((*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket))!= 0xFF){
cprintf(BG_RED, "dummy blank mismatch num4 earlier2! i:%d pnum:%d fnum:%d num3:0x%x actual num3:0x%x\n", cprintf(BG_RED, "dummy blank mismatch num4 earlier2! i:%d pnum:%d fnum:%d missingpacket:0x%x actual missingpacket:0x%x\n",
i,tempoffset[i],tempframenum[i], i,tempoffset[i],tempframenum[i],
(*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3)), (*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket)),
(*(uint8_t*)(((eiger_packet_header *)((char*)(blankframe[blankoffset])))->num3))); (*(uint8_t*)(((eiger_packet_1g *)((char*)(blankframe[blankoffset])))->missingpacket)));
exit(-1); exit(-1);
}else }else
//#ifdef PADDING //#ifdef PADDING
cprintf(GREEN, "blank packet i:%d pnum:%d fnum:%d num3:0x%x\n",i,tempoffset[i],tempframenum[i],(*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3))); cprintf(GREEN, "blank packet i:%d pnum:%d fnum:%d missingpacket:0x%x\n",i,tempoffset[i],tempframenum[i],(*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket)));
//#endif //#endif
tempoffset[i]++; tempoffset[i]++;
blankoffset++; blankoffset++;
@ -2189,8 +2186,7 @@ int UDPStandardImplementation::startWriting(){
if(!fullframe[i]){ if(!fullframe[i]){
//update frame number //update frame number
//tempframenum[i] = (htonl(*(uint32_t*)(((eiger_packet_header *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->num1))); tempframenum[i] = ((*(uint32_t*)(((eiger_packet_1g *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->framenum)));
tempframenum[i] = ((*(uint32_t*)(((eiger_packet_header *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->num1)));
if(!tempframenum[i]) if(!tempframenum[i])
@ -2207,8 +2203,8 @@ int UDPStandardImplementation::startWriting(){
//#ifdef EIGER_DEBUG3 //#ifdef EIGER_DEBUG3
cprintf(RED,"fifo:%d packet from next frame %d, add missing packets to the right one %d\n",i,tempframenum[i],presentframenum ); cprintf(RED,"fifo:%d packet from next frame %d, add missing packets to the right one %d\n",i,tempframenum[i],presentframenum );
cprintf(RED,"current wrong frame:%d wrong frame packet number:%d\n", cprintf(RED,"current wrong frame:%d wrong frame packet number:%d\n",
((*(uint32_t*)(((eiger_packet_header *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->num1))), ((*(uint32_t*)(((eiger_packet_1g *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->framenum))),
((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->num4)))); ((*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->packetnum))));
//#endif //#endif
tempframenum[i] = presentframenum; tempframenum[i] = presentframenum;
//add missing packets //add missing packets
@ -2221,23 +2217,23 @@ int UDPStandardImplementation::startWriting(){
for(j=0;j<numberofmissingpackets[i];++j){ for(j=0;j<numberofmissingpackets[i];++j){
tempbuffer[tempoffset[i]] = blankframe[blankoffset]; tempbuffer[tempoffset[i]] = blankframe[blankoffset];
#ifdef VERYDEBUG #ifdef VERYDEBUG
if ((*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3))&0x2) if ((*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket))== 0xFF)
cprintf(RED,"5 fifo:%d missing packet added at pnum:%d\n",i,tempoffset[i]); cprintf(RED,"5 fifo:%d missing packet added at pnum:%d\n",i,tempoffset[i]);
else cprintf(RED, "5 fifo:%d WEird at pnum:%d\n",i,tempoffset[i]); else cprintf(RED, "5 fifo:%d WEird at pnum:%d\n",i,tempoffset[i]);
#endif #endif
if (!((*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3))&0x2)){ if ((*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket))!= 0xFF){
cprintf(BG_RED, "wrong blank mismatch num4 earlier2! " cprintf(BG_RED, "wrong blank mismatch num4 earlier2! "
"i:%d pnum:%d fnum:%d num3:0x%x actual num3:0x%x add:0x%x\n", "i:%d pnum:%d fnum:%d missingpacket:0x%x actual missingpacket:0x%x add:0x%x\n",
i,tempoffset[i],tempframenum[i], i,tempoffset[i],tempframenum[i],
(*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3)), (*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket)),
(*(uint8_t*)(((eiger_packet_header *)((char*)(blankframe[blankoffset])))->num3)), (*(uint8_t*)(((eiger_packet_1g *)((char*)(blankframe[blankoffset])))->missingpacket)),
(void*)(tempbuffer[tempoffset[i]])); (void*)(tempbuffer[tempoffset[i]]));
exit(-1); exit(-1);
}else }else
//#ifdef PADDING //#ifdef PADDING
cprintf(GREEN, "blank packet i:%d pnum:%d fnum:%d num3:0x%x add:0x%x\n", cprintf(GREEN, "blank packet i:%d pnum:%d fnum:%d missingpacket:0x%x add:0x%x\n",
i,tempoffset[i],tempframenum[i], i,tempoffset[i],tempframenum[i],
(*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3)), (*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket)),
(void*)(tempbuffer[tempoffset[i]])); (void*)(tempbuffer[tempoffset[i]]));
//#endif //#endif
tempoffset[i] ++; tempoffset[i] ++;
@ -2258,7 +2254,7 @@ int UDPStandardImplementation::startWriting(){
cprintf(GREEN,"**tempfraemnum of %d: %d\n",i,tempframenum[i]); cprintf(GREEN,"**tempfraemnum of %d: %d\n",i,tempframenum[i]);
//#endif //#endif
//update current packet //update current packet
currentpacketheader[i] = ((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->num4))); currentpacketheader[i] = ((*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->packetnum)));
#ifdef VERYVERBOSE #ifdef VERYVERBOSE
cprintf(GREEN,"**fifo:%d currentpacketheader: %d lastpacketheader %d tempoffset:%d\n",i,currentpacketheader[i],lastpacketheader[i], tempoffset[i]); cprintf(GREEN,"**fifo:%d currentpacketheader: %d lastpacketheader %d tempoffset:%d\n",i,currentpacketheader[i],lastpacketheader[i], tempoffset[i]);
#endif #endif
@ -2272,23 +2268,23 @@ int UDPStandardImplementation::startWriting(){
for(j=0;j<numberofmissingpackets[i];++j){ for(j=0;j<numberofmissingpackets[i];++j){
tempbuffer[tempoffset[i]] = blankframe[blankoffset]; tempbuffer[tempoffset[i]] = blankframe[blankoffset];
#ifdef VERYDEBUG #ifdef VERYDEBUG
if ((*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3))&0x2) if ((*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket)) ==0xFF)
cprintf(RED,"4 fifo:%d missing packet added at pnum:%d\n",i,tempoffset[i]); cprintf(RED,"4 fifo:%d missing packet added at pnum:%d\n",i,tempoffset[i]);
else cprintf(RED, "4 fifo:%d WEird at pnum:%d\n",i,tempoffset[i]); else cprintf(RED, "4 fifo:%d WEird at pnum:%d\n",i,tempoffset[i]);
#endif #endif
if (!((*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3))&0x2)){ if ((*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket))!= 0xFF){
cprintf(BG_RED, "correct blank mismatch num4 earlier2! " cprintf(BG_RED, "correct blank mismatch num4 earlier2! "
"i:%d pnum:%d fnum:%d num3:0x%x actual num3:0x%x add:0x%x\n", "i:%d pnum:%d fnum:%d missingpacket:0x%x actual missingpacket:0x%x add:0x%x\n",
i,tempoffset[i],tempframenum[i], i,tempoffset[i],tempframenum[i],
(*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3)), (*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket)),
(*(uint8_t*)(((eiger_packet_header *)((char*)(blankframe[blankoffset])))->num3)), (*(uint8_t*)(((eiger_packet_1g *)((char*)(blankframe[blankoffset])))->missingpacket)),
(void*)(tempbuffer[tempoffset[i]])); (void*)(tempbuffer[tempoffset[i]]));
exit(-1); exit(-1);
}else }else
//#ifdef PADDING //#ifdef PADDING
cprintf(GREEN, "blank packet i:%d pnum:%d fnum:%d num3:0x%x add:0x%x\n", cprintf(GREEN, "blank packet i:%d pnum:%d fnum:%d missingpacket:0x%x add:0x%x\n",
i,tempoffset[i],tempframenum[i], i,tempoffset[i],tempframenum[i],
(*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3)), (*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket)),
(void*)(tempbuffer[tempoffset[i]])); (void*)(tempbuffer[tempoffset[i]]));
//#endif //#endif
tempoffset[i] ++; tempoffset[i] ++;
@ -2299,23 +2295,23 @@ int UDPStandardImplementation::startWriting(){
if(currentpacketheader[i] != (tempoffset[i]-(i*packetsPerFrame/numListeningThreads))){ if(currentpacketheader[i] != (tempoffset[i]-(i*packetsPerFrame/numListeningThreads))){
cprintf(BG_RED, "correct pnum mismatch earlier! tempoffset[%d]:%d pnum:%d fnum:%d rfnum:%d\n", cprintf(BG_RED, "correct pnum mismatch earlier! tempoffset[%d]:%d pnum:%d fnum:%d rfnum:%d\n",
i,tempoffset[i],currentpacketheader[i], i,tempoffset[i],currentpacketheader[i],
tempframenum[i],(*(uint32_t*)(((eiger_packet_header *)((char*)(wbuf[i]+ HEADER_SIZE_NUM_TOT_PACKETS)))->num1))); tempframenum[i],(*(uint32_t*)(((eiger_packet_1g *)((char*)(wbuf[i]+ HEADER_SIZE_NUM_TOT_PACKETS)))->framenum)));
exit(-1); exit(-1);
} }
tempbuffer[tempoffset[i]] = wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS; tempbuffer[tempoffset[i]] = wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS;
#ifdef EIGER_DEBUG3 #ifdef EIGER_DEBUG3
cprintf(GREEN,"**fifo:%d currentpacketheader: %d tempoffset:%d\n",i,(*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num4)),tempoffset[i]); cprintf(GREEN,"**fifo:%d currentpacketheader: %d tempoffset:%d\n",i,(*(uint16_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->packetnum)),tempoffset[i]);
#endif #endif
if((*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num4)) != (tempoffset[i]-(i*packetsPerFrame/numListeningThreads))){ if((*(uint16_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->packetnum)) != (tempoffset[i]-(i*packetsPerFrame/numListeningThreads))){
cprintf(BG_RED, "pnum mismatch num4 earlier! i:%d pnum:%d fnum:%d add:0x%x\n", cprintf(BG_RED, "pnum mismatch num4 earlier! i:%d pnum:%d fnum:%d add:0x%x\n",
i,(*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num4)), i,(*(uint16_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->packetnum)),
tempframenum[i],(void*)(tempbuffer[tempoffset[i]])); tempframenum[i],(void*)(tempbuffer[tempoffset[i]]));
exit(-1); exit(-1);
} }
//#ifdef PADDING //#ifdef PADDING
cprintf(GREEN, "normal packet i:%d pnum:%d fnum:%d num3:0x%x add:0x%x\n", cprintf(GREEN, "normal packet i:%d pnum:%d fnum:%d missingpacket:0x%x add:0x%x\n",
i,tempoffset[i],tempframenum[i], i,tempoffset[i],tempframenum[i],
(*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[tempoffset[i]])))->num3)), (*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[tempoffset[i]])))->missingpacket)),
(void*)(tempbuffer[tempoffset[i]])); (void*)(tempbuffer[tempoffset[i]]));
//#endif //#endif
tempoffset[i] ++; tempoffset[i] ++;
@ -2359,7 +2355,7 @@ int UDPStandardImplementation::startWriting(){
cprintf(RED, "numMissingPackets:%d fnum:%d\n",numMissingPackets,currframenum); cprintf(RED, "numMissingPackets:%d fnum:%d\n",numMissingPackets,currframenum);
for (j=0;j<packetsPerFrame;++j) for (j=0;j<packetsPerFrame;++j)
if ((*(uint8_t*)(((eiger_packet_header *)((char*)(tempbuffer[j])))->num3))&0x2) if ((*(uint8_t*)(((eiger_packet_1g *)((char*)(tempbuffer[j])))->missingpacket))==0xFF)
cprintf(RED,"found the missing packet at pnum:%d\n",j); cprintf(RED,"found the missing packet at pnum:%d\n",j);
} }
//#endif //#endif
@ -2407,8 +2403,8 @@ int UDPStandardImplementation::startWriting(){
//#ifdef VERYDEBUG //#ifdef VERYDEBUG
for(int i=0;i<numListeningThreads;i++){ for(int i=0;i<numListeningThreads;i++){
cprintf(GREEN," end of loop popready[%d]:%d add:0x%x\n",i,popready[i],(void*)(wbuf[i])); cprintf(GREEN," end of loop popready[%d]:%d add:0x%x\n",i,popready[i],(void*)(wbuf[i]));
cprintf(GREEN,"tempframenum[%d]:%d\n",i,((*(uint32_t*)(((eiger_packet_header *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->num1)))); cprintf(GREEN,"tempframenum[%d]:%d\n",i,((*(uint32_t*)(((eiger_packet_1g *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->framenum))));
cprintf(GREEN,"packetnum[%d]:%d\n",i,((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->num4)))); cprintf(GREEN,"packetnum[%d]:%d\n",i,((*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuf[i] + HEADER_SIZE_NUM_TOT_PACKETS)))->packetnum))));
} }
//#endif //#endif
} }
@ -2735,53 +2731,7 @@ void UDPStandardImplementation::writeToFile_withoutCompression(char* buf[],int n
if((enableFileWrite) && (sfilefd)){ if((enableFileWrite) && (sfilefd)){
offset = HEADER_SIZE_NUM_TOT_PACKETS; offset = HEADER_SIZE_NUM_TOT_PACKETS;
if(myDetectorType == EIGER){
#ifdef WRITE_HEADERS
#ifdef VERY_DEBUG
if(myDetectorType == EIGER){
int k = 0;
if(dynamicRange != 32){
cprintf(RED, "\np1 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf[k])))->num1)));
cprintf(RED, "p1:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num3)));
cprintf(RED, "p0 num:%d - %d\n", k, (*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num4)));
k = 1;
cprintf(RED, "p2 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf[k])))->num1)));
cprintf(RED, "p2:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num3)));
cprintf(RED, "p1 num:%d - %d\n", k,(*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num4)));
k = 2;
cprintf(RED, "p3 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf[k])))->num1)));
cprintf(RED, "p3:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num3)));
cprintf(RED, "p2 num:%d - %d\n", k,(*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num4)));
}else{
k = 0;
cprintf(RED, "\np1 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf[k])))->num1)));
cprintf(RED, "p1:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num3)));
cprintf(RED, "p0 num:%d - %d\n", k, (*(uint16_t*)(((eiger_packet_header *)((char*)(buf[k])))->num2)));
k = 1;
cprintf(RED, "p2 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf[k])))->num1)));
cprintf(RED, "p2:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num3)));
cprintf(RED, "p1 num:%d - %d\n", k, (*(uint16_t*)(((eiger_packet_header *)((char*)(buf[k])))->num2)));
k = 2;
cprintf(RED, "p3 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf[k])))->num1)));
cprintf(RED, "p3:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num3)));
cprintf(RED, "p2 num:%d - %d\n", k, (*(uint16_t*)(((eiger_packet_header *)((char*)(buf[k])))->num2)));
k = 256;
cprintf(RED, "p257 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf[k])))->num1)));
cprintf(RED, "p257:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num3)));
cprintf(RED, "p256 num:%d - %d\n", k, (*(uint16_t*)(((eiger_packet_header *)((char*)(buf[k])))->num2)));
k = 512;
cprintf(RED, "p513 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf[k])))->num1)));
cprintf(RED, "p513:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num3)));
cprintf(RED, "p512 num:%d - %d\n", k, (*(uint16_t*)(((eiger_packet_header *)((char*)(buf[k])))->num2)));
k = 768;
cprintf(RED, "p769 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf[k])))->num1)));
cprintf(RED, "p769:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf[k])))->num3)));
cprintf(RED, "p768 num:%d - %d\n", k,(*(uint16_t*)(((eiger_packet_header *)((char*)(buf[k])))->num2)));
}
}
#endif
#endif
}
while(numpackets > 0){ while(numpackets > 0){
//for progress and packet loss calculation(new files) //for progress and packet loss calculation(new files)
@ -2913,29 +2863,29 @@ void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char*
//missing packet //missing packet
if ((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num3))&0x2){ if ((*(uint8_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->missingpacket))==0xFF){
missingpacket = 1; missingpacket = 1;
//add packet numbers //add packet numbers
(*(uint16_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num2)) = (i+1); (*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum)) = (i+1);
(*(uint32_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num1)) = currframenum+1; (*(uint32_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->framenum)) = currframenum+1;
}else{ }else{
missingpacket = 0; missingpacket = 0;
if((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num4)) != (i-(port*packetsPerFrame/numListeningThreads))){ if((*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum)) != (i-(port*packetsPerFrame/numListeningThreads))){
cprintf(BG_RED, "pnum mismatch num4! i:%d pnum:%d fnum:%d\n",i,(*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num4)),currframenum); cprintf(BG_RED, "pnum mismatch num4! i:%d pnum:%d fnum:%d\n",i,(*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum)),currframenum);
exit(-1); exit(-1);
} }
if(dynamicRange != 32){ /* if(dynamicRange != 32){*/
//move packet numbers to num2, and compensate for port1 starting pnum from 0 //move packet numbers to num2, and compensate for port1 starting pnum from 0
if(!port) if(!port)
(*(uint16_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num2)) = (*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum)) =
((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num4))+1); ((*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum))+1);
else else
(*(uint16_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num2)) = (*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum)) =
((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num4))+(packetsPerFrame/2) +1); ((*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum))+(packetsPerFrame/2) +1);
} /*}
//dr == 32 //dr == 32
else{ else{
if(i == 0) if(i == 0)
@ -2946,43 +2896,42 @@ void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char*
pnuminc = (packetsPerFrame/2); pnuminc = (packetsPerFrame/2);
else if(i == (3*packetsPerFrame/4)) else if(i == (3*packetsPerFrame/4))
pnuminc = (3*packetsPerFrame/4); pnuminc = (3*packetsPerFrame/4);
(*(uint16_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num2)) (*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum))
= ((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num4))+pnuminc+1); = ((*(uint8_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum,))+pnuminc+1);
} }*/
} }
if((*(uint16_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num2)) != (i+1)){ if((*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum)) != (i+1)){
cprintf(BG_RED, "pnum mismatch! i:%d pnum:%d fnum:%d\n",i,(*(uint16_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num2)),currframenum); cprintf(BG_RED, "pnum mismatch! i:%d pnum:%d fnum:%d\n",i,(*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum)),currframenum);
if ((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num3))&0x2) if ((*(uint8_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->missingpacket))==0xFF)
cprintf(BG_RED,"missing packet though\n"); cprintf(BG_RED,"missing packet though\n");
exit(-1); exit(-1);
} }
//overwriting port number and dynamic range //overwriting port number and dynamic range
(*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num3)) = (*(uint8_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->missingpacket)) =
((dynamicRange<<2)|(missingpacket<<1)|(port)); ((dynamicRange<<2)|(missingpacket<<1)|(port));
//frame number //frame number
//(*(uint32_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num1)) = currframenum; //(*(uint32_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->framenum)) = currframenum;
#ifdef VERYDEBUG #ifdef VERYDEBUG
if((i==0)||(i==1)){ if((i==0)||(i==1)){
cprintf(GREEN, "%d packet header:0x%016llx num3:0x%x\n",i, cprintf(GREEN, "%d packet header:0x%016llx missingpacket:0x%x\n",i,
((uint64_t)(*((uint64_t*)(wbuffer[i])))), ((uint64_t)(*((uint64_t*)(wbuffer[i])))),
(uint8_t)(*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num3))); (uint8_t)(*(uint8_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->missingpacket)));
cprintf(GREEN, "%d - 0x%x - %d - %d\n", i, cprintf(GREEN, "%d - 0x%x - %d\n", i,
(*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num3)), (*(uint8_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->missingpacket)),
(*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num4)), (*(uint16_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->packetnum)));
(*(uint16_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num2)));
} }
#endif #endif
/* /*
cprintf(GREEN,"at writing, fnum:%d, pnum:%d,num3:0x%x add:0x%x\n", cprintf(GREEN,"at writing, fnum:%d, pnum:%d,missingpacket:0x%x add:0x%x\n",
currframenum, i, (*(uint8_t*)(((eiger_packet_header *)((char*)(wbuffer[i])))->num3)), currframenum, i, (*(uint8_t*)(((eiger_packet_1g *)((char*)(wbuffer[i])))->missingpacket)),
(void*)(wbuffer[i])); (void*)(wbuffer[i]));
*/ */
@ -3148,9 +3097,11 @@ int UDPStandardImplementation::enableTenGiga(int enable){
if(!tengigaEnable){ if(!tengigaEnable){
packetsPerFrame = EIGER_ONE_GIGA_CONSTANT * dynamicRange * EIGER_MAX_PORTS; packetsPerFrame = EIGER_ONE_GIGA_CONSTANT * dynamicRange * EIGER_MAX_PORTS;
onePacketSize = EIGER_ONE_GIGA_ONE_PACKET_SIZE; onePacketSize = EIGER_ONE_GIGA_ONE_PACKET_SIZE;
oneDataSize = EIGER_ONE_GIGA_ONE_DATA_SIZE;
}else{ }else{
packetsPerFrame = EIGER_TEN_GIGA_CONSTANT * dynamicRange * EIGER_MAX_PORTS; packetsPerFrame = EIGER_TEN_GIGA_CONSTANT * dynamicRange * EIGER_MAX_PORTS;
onePacketSize = EIGER_TEN_GIGA_ONE_PACKET_SIZE; onePacketSize = EIGER_TEN_GIGA_ONE_PACKET_SIZE;
oneDataSize = EIGER_TEN_GIGA_ONE_DATA_SIZE;
} }
frameSize = onePacketSize * packetsPerFrame; frameSize = onePacketSize * packetsPerFrame;
bufferSize = (frameSize/EIGER_MAX_PORTS) + EIGER_HEADER_LENGTH;//everything one port gets (img header plus packets) bufferSize = (frameSize/EIGER_MAX_PORTS) + EIGER_HEADER_LENGTH;//everything one port gets (img header plus packets)
@ -3202,5 +3153,3 @@ int UDPStandardImplementation::enableTenGiga(int enable){
return tengigaEnable; return tengigaEnable;
} }

View File

@ -1570,7 +1570,6 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
char fName[MAX_STR_LENGTH]=""; char fName[MAX_STR_LENGTH]="";
int acquisitionIndex = -1; int acquisitionIndex = -1;
int frameIndex= -1; int frameIndex= -1;
int i;
uint32_t index=0; uint32_t index=0;
int frameSize = EIGER_ONE_GIGA_ONE_PACKET_SIZE * packetsPerFrame; int frameSize = EIGER_ONE_GIGA_ONE_PACKET_SIZE * packetsPerFrame;