mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00
made the eiger like the jungfrau ignoring packets
This commit is contained in:
parent
55408118b1
commit
af8c750b5a
@ -416,6 +416,24 @@ private:
|
||||
*/
|
||||
int prepareAndListenBuffer(int ithread, int cSize, char* temp);
|
||||
|
||||
/**
|
||||
* Called by startListening
|
||||
* Creates the packets
|
||||
* @param ithread listening thread index
|
||||
* @return the number of bytes actually received
|
||||
*/
|
||||
int prepareAndListenBufferDeactivated(int ithread);
|
||||
|
||||
|
||||
/**
|
||||
* Called by startListening
|
||||
* Listens to each packet and copies only complete frames
|
||||
* until all receiver or shutdownUDPsocket called by client
|
||||
* @param ithread listening thread index
|
||||
* @return the number of bytes copied to buffer
|
||||
*/
|
||||
int prepareAndListenBufferCompleteFrames(int ithread);
|
||||
|
||||
/**
|
||||
* Called by startListening
|
||||
* Its called for the first packet of a scan or acquistion
|
||||
@ -478,14 +496,13 @@ private:
|
||||
void handleWithoutDataCompression(int ithread, char* wbuffer,uint32_t npackets);
|
||||
|
||||
/**
|
||||
* Called by processWritingBuffer for jungfrau
|
||||
* writes to dummy file, doesnt need to read packet numbers
|
||||
* Called by startWriting for jungfrau and eiger
|
||||
* writes complete frames to file
|
||||
* Copies data for gui display and frees addresses popped from FIFOs
|
||||
* @param ithread writing thread index
|
||||
* @param wbuffer writing buffer popped out from FIFO
|
||||
* @param npackets number of packets
|
||||
*/
|
||||
void handleWithoutMissingPackets(int ithread, char* wbuffer,uint32_t npackets);
|
||||
void handleCompleteFramesOnly(int ithread, char* wbuffer);
|
||||
|
||||
/**
|
||||
* Calle by handleWithoutDataCompression
|
||||
@ -540,9 +557,10 @@ private:
|
||||
* @param framenumber reference to the frame number
|
||||
* @param packetnumber reference to the packet number
|
||||
* @param subframenumber reference to the subframe number
|
||||
* @oaram bunchid reference to the bunch id
|
||||
* @return OK or FAIL
|
||||
*/
|
||||
int getFrameandPacketNumber(int ithread, char* wbuffer, uint64_t &framenumber, uint32_t &packetnumber, uint32_t &subframenumber);
|
||||
int getFrameandPacketNumber(int ithread, char* wbuffer, uint64_t &framenumber, uint32_t &packetnumber, uint32_t &subframenumber, uint64_t &bunchid);
|
||||
|
||||
/**
|
||||
* Find offset upto this frame number and write it to file
|
||||
@ -593,6 +611,9 @@ private:
|
||||
/** Footer offset from start of Packet*/
|
||||
int footerOffset;
|
||||
|
||||
/** variable to exclude missing packet */
|
||||
bool excludeMissingPackets;
|
||||
|
||||
|
||||
//***File parameters***
|
||||
#ifdef MYROOT1
|
||||
@ -611,15 +632,17 @@ private:
|
||||
|
||||
/** Maximum Frames Per File **/
|
||||
uint64_t maxFramesPerFile;
|
||||
const static int progressFrequency = 10;
|
||||
|
||||
/** If file created successfully for all Writer Threads */
|
||||
bool fileCreateSuccess;
|
||||
|
||||
/** File header */
|
||||
const static unsigned int FILE_HEADER_SIZE = 500;
|
||||
|
||||
char fileHeader[MAX_NUMBER_OF_WRITER_THREADS][FILE_HEADER_SIZE];
|
||||
|
||||
|
||||
/** File Descriptor */
|
||||
FILE *sfilefd[MAX_NUMBER_OF_WRITER_THREADS];
|
||||
|
||||
|
||||
//***acquisition indices/count parameters***
|
||||
@ -640,9 +663,19 @@ private:
|
||||
|
||||
/** Previous Frame number from last check to calculate loss */
|
||||
int64_t frameNumberInPreviousCheck[MAX_NUMBER_OF_WRITER_THREADS];
|
||||
|
||||
/** total packet count from last check */
|
||||
int64_t totalWritingPacketCountFromLastCheck[MAX_NUMBER_OF_WRITER_THREADS];
|
||||
|
||||
/** Pckets currently in current file, starts new file when it reaches max */
|
||||
int64_t lastFrameNumberInFile[MAX_NUMBER_OF_WRITER_THREADS];
|
||||
|
||||
/** packets in current file */
|
||||
uint64_t totalPacketsInFile[MAX_NUMBER_OF_WRITER_THREADS];
|
||||
|
||||
/**Total packet count written by each writing thread */
|
||||
uint64_t totalWritingPacketCount[MAX_NUMBER_OF_LISTENING_THREADS];
|
||||
|
||||
|
||||
/* Acquisition started */
|
||||
bool acqStarted;
|
||||
@ -656,14 +689,7 @@ private:
|
||||
/** Total packet Count ignored by listening threads */
|
||||
int totalIgnoredPacketCount[MAX_NUMBER_OF_LISTENING_THREADS];
|
||||
|
||||
/** Pckets currently in current file, starts new file when it reaches max */
|
||||
int64_t lastFrameNumberInFile[MAX_NUMBER_OF_WRITER_THREADS];
|
||||
|
||||
/** packets in current file */
|
||||
uint64_t totalPacketsInFile[MAX_NUMBER_OF_WRITER_THREADS];
|
||||
|
||||
/**Total packet count written by each writing thread */
|
||||
uint64_t totalWritingPacketCount[MAX_NUMBER_OF_LISTENING_THREADS];
|
||||
|
||||
|
||||
|
||||
@ -684,9 +710,6 @@ private:
|
||||
/** UDP Sockets - Detector to Receiver */
|
||||
genericSocket* udpSocket[MAX_NUMBER_OF_LISTENING_THREADS];
|
||||
|
||||
/** File Descriptor */
|
||||
FILE *sfilefd[MAX_NUMBER_OF_WRITER_THREADS];
|
||||
|
||||
/** Number of Jobs Per Buffer */
|
||||
int numberofJobsPerBuffer;
|
||||
|
||||
@ -696,9 +719,6 @@ private:
|
||||
/** fifo buffer header size */
|
||||
uint32_t fifoBufferHeaderSize;
|
||||
|
||||
/** Missing Packet */
|
||||
int missingPacketinFile;
|
||||
|
||||
/** Dummy Packet identifier value */
|
||||
const static uint32_t dummyPacketValue = 0xFFFFFFFF;
|
||||
|
||||
@ -790,16 +810,6 @@ private:
|
||||
bool killAllWritingThreads;
|
||||
|
||||
|
||||
//***deactivated parameters***
|
||||
uint64_t deactivated_framenumber[MAX_NUMBER_OF_LISTENING_THREADS];
|
||||
uint32_t deactivated_packetnumber[MAX_NUMBER_OF_LISTENING_THREADS];
|
||||
|
||||
//***deactivated parameters***
|
||||
uint64_t deactivatedFrameNumber[MAX_NUMBER_OF_LISTENING_THREADS];
|
||||
int deactivatedFrameIncrement;
|
||||
|
||||
|
||||
|
||||
//***filter parameters***
|
||||
/** Common Mode Subtraction Enable FIXME: Always false, only moench uses, Ask Anna */
|
||||
bool commonModeSubtractionEnable;
|
||||
|
@ -632,7 +632,13 @@ enum communicationProtocol{
|
||||
else{
|
||||
//normal
|
||||
nsending=packet_size;
|
||||
nsent = recvfrom(socketDescriptor,(char*)buf+total_sent,nsending, 0, (struct sockaddr *) &clientAddress, &clientAddress_length);
|
||||
while(1){
|
||||
nsent = recvfrom(socketDescriptor,(char*)buf+total_sent,nsending, 0, (struct sockaddr *) &clientAddress, &clientAddress_length);
|
||||
if(nsent<=0 || nsent == packet_size)
|
||||
break;
|
||||
if(nsent != packet_size && nsent != header_packet_size)
|
||||
cprintf(RED,"Incomplete Packet size %d\n",nsent);
|
||||
}
|
||||
//nsent = 1040;
|
||||
total_sent+=nsent;
|
||||
}
|
||||
|
@ -56,6 +56,10 @@ typedef struct {
|
||||
#define HEADER_SIZE_NUM_TOT_PACKETS 4
|
||||
#define HEADER_SIZE_NUM_FRAMES 2
|
||||
#define HEADER_SIZE_NUM_PACKETS 1
|
||||
#define ALL_MASK_32 0xFFFFFFFF
|
||||
|
||||
#define FILE_FRAME_HEADER_LENGTH 16
|
||||
#define FILE_HEADER_BUNCHID_OFFSET 8
|
||||
|
||||
|
||||
//all max frames defined in sls_receiver_defs.h. 20000 gotthard, 100000 for short gotthard, 1000 for moench, eiger 20000
|
||||
@ -129,8 +133,6 @@ typedef struct {
|
||||
|
||||
|
||||
|
||||
#define JFRAU_FILE_FRAME_HEADER_LENGTH 16
|
||||
#define JFRAU_FILE_HEADER_BUNCHID_OFFSET 8
|
||||
#define JFRAU_FIFO_SIZE 2500 //cannot be less than max jobs per thread = 1000
|
||||
#define JFRAU_PACKETS_PER_FRAME 128
|
||||
#define JFRAU_HEADER_LENGTH 22
|
||||
@ -172,7 +174,6 @@ typedef struct {
|
||||
#define EIGER_MAX_PORTS 2
|
||||
#define EIGER_HEADER_PACKET_LENGTH 48
|
||||
|
||||
|
||||
#define EIGER_FIFO_SIZE 100
|
||||
/*#define EIGER_ALIGNED_FRAME_SIZE 65536*/
|
||||
#define EIGER_ONE_GIGA_CONSTANT 16
|
||||
|
@ -332,7 +332,7 @@ private:
|
||||
|
||||
protected:
|
||||
/** Socket */
|
||||
MySocketTCP* socket;
|
||||
MySocketTCP* mySock;
|
||||
};
|
||||
|
||||
|
||||
|
@ -98,7 +98,7 @@ char *UDPBaseImplementation::getDetectorHostname() const{
|
||||
if(!strlen(detHostname))
|
||||
return NULL;
|
||||
|
||||
char* output = new char[MAX_STR_LENGTH];
|
||||
char* output = new char[MAX_STR_LENGTH]();
|
||||
strcpy(output,detHostname);
|
||||
//freed by calling function
|
||||
return output;
|
||||
@ -113,7 +113,7 @@ char *UDPBaseImplementation::getFileName() const{
|
||||
if(!strlen(fileName))
|
||||
return NULL;
|
||||
|
||||
char* output = new char[MAX_STR_LENGTH];
|
||||
char* output = new char[MAX_STR_LENGTH]();
|
||||
strcpy(output,fileName);
|
||||
//freed by calling function
|
||||
return output;
|
||||
@ -126,7 +126,7 @@ char *UDPBaseImplementation::getFilePath() const{
|
||||
if(!strlen(filePath))
|
||||
return NULL;
|
||||
|
||||
char* output = new char[MAX_STR_LENGTH];
|
||||
char* output = new char[MAX_STR_LENGTH]();
|
||||
strcpy(output,filePath);
|
||||
//freed by calling function
|
||||
return output;
|
||||
@ -166,7 +166,7 @@ uint32_t UDPBaseImplementation::getUDPPortNumber2() const{ FILE_LOG(logDEBUG) <<
|
||||
char *UDPBaseImplementation::getEthernetInterface() const{
|
||||
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
||||
|
||||
char* output = new char[MAX_STR_LENGTH];
|
||||
char* output = new char[MAX_STR_LENGTH]();
|
||||
strcpy(output,eth);
|
||||
//freed by calling function
|
||||
return output;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user