mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 01:00:02 +02:00
huge change in receiver in previous version, sortingand padding frames before movign into fifo; users small change in previous revision typecasting
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@676 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
eba9bcf9ac
commit
9e08196677
Binary file not shown.
@ -1,4 +1,3 @@
|
||||
|
||||
#include "slsDetectorUsers.h"
|
||||
#include "detectorData.h"
|
||||
#include "multiSlsDetector.h"
|
||||
|
@ -8,7 +8,7 @@ LIBS?= -L$(LIBDIR) -lSlsDetector
|
||||
|
||||
INCLUDES ?= -I ../MySocketTCP -I ../commonFiles -I -I ../slsDetectorAnalysis -I .
|
||||
SRC_CLNT = slsReceiver.cpp
|
||||
#../MySocketTCP/MySocketTCP.cpp slsReceiver_funcs.cpp UHRIXCallback.cpp slsReceiverFunctionList.cpp slsReceiverUsers.cpp
|
||||
#../MySocketTCP/MySocketTCP.cpp slsReceiver_funcs.cpp UHRIXCallback.cpp slsReceiverFunctionList.cpp slsReceiverUsers.cpp
|
||||
|
||||
DESTDIR ?= bin
|
||||
INSTMODE = 0777
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#define BUF_SIZE (16*1024*1024) //16mb
|
||||
|
||||
//all max frames defined in sls_detector_defs.h. 20000 gotthard, 100000 for short gotthard, 1000 for moench
|
||||
//all max frames defined in sls_detector_defs.h. 20000 gotthard, 100000 for short gotthard, 1000 for moench
|
||||
|
||||
|
||||
#define GOTTHARD_FIFO_SIZE 25000
|
||||
|
@ -644,7 +644,6 @@ int slsReceiverFunctionList::startWriting(){
|
||||
int sleepnumber=0;
|
||||
int frameFactor=0;
|
||||
int i;
|
||||
/*int i1,i2;*/
|
||||
|
||||
packetsInFile=0;
|
||||
framesCaught=0;
|
||||
@ -801,10 +800,6 @@ int slsReceiverFunctionList::startWriting(){
|
||||
strcpy(guiFileName,savefilename);
|
||||
pthread_mutex_lock(&dataReadyMutex);
|
||||
guiDataReady=1;
|
||||
/* i1 = ((((uint32_t)(*((uint32_t*)latestData))) & (frameIndexMask)) >> frameIndexOffset);
|
||||
i2 = ((((uint32_t)(*((uint32_t*)(latestData+oneBufferSize)))) & (frameIndexMask)) >> frameIndexOffset);
|
||||
if ( i1 == (i2+1))
|
||||
cout<<"222WEIRDDD:"<<i1<<":"<<i2<<endl;*/
|
||||
pthread_mutex_unlock(&dataReadyMutex);
|
||||
}else{
|
||||
pthread_mutex_lock(&dataReadyMutex);
|
||||
@ -883,7 +878,6 @@ int slsReceiverFunctionList::startWriting(){
|
||||
|
||||
|
||||
void slsReceiverFunctionList::readFrame(char* c,char** raw){
|
||||
int i1,i2;
|
||||
//point to gui data
|
||||
if (guiData == NULL)
|
||||
guiData = latestData;
|
||||
@ -896,10 +890,6 @@ void slsReceiverFunctionList::readFrame(char* c,char** raw){
|
||||
//data ready, set guidata to receive new data
|
||||
else{
|
||||
*raw = guiData;
|
||||
i1 = ((((uint32_t)(*((uint32_t*)guiData))) & (frameIndexMask)) >> frameIndexOffset);
|
||||
i2 = ((((uint32_t)(*((uint32_t*)(guiData+oneBufferSize)))) & (frameIndexMask)) >> frameIndexOffset);
|
||||
if ( i1 == (i2+1))
|
||||
cout<<"WEIRDDD:"<<i1<<":"<<i2<<endl;
|
||||
guiData = NULL;
|
||||
pthread_mutex_lock(&dataReadyMutex);
|
||||
guiDataReady = 0;
|
||||
|
@ -360,7 +360,7 @@ private:
|
||||
/** oen buffer size */
|
||||
int oneBufferSize;
|
||||
|
||||
/** semaphore to synchronize writer and guireader threads */
|
||||
/** semaphore to synchronize writer and guireader threads */
|
||||
sem_t smp;
|
||||
|
||||
/** guiDataReady mutex */
|
||||
|
@ -1116,7 +1116,7 @@ int slsReceiverFuncs::gotthard_read_frame(){
|
||||
pindex = (bindex & GOTTHARD_SHORT_PACKET_INDEX_MASK);
|
||||
index = ((bindex & GOTTHARD_SHORT_FRAME_INDEX_MASK) >> GOTTHARD_SHORT_FRAME_INDEX_OFFSET);
|
||||
#ifdef VERBOSE
|
||||
cout<<"index:"<<hex<<index<<endl;
|
||||
cout << "index:" << hex << index << endl;
|
||||
#endif
|
||||
}else{
|
||||
bindex = (uint32_t)(*((uint32_t*)raw));
|
||||
@ -1126,8 +1126,8 @@ int slsReceiverFuncs::gotthard_read_frame(){
|
||||
pindex2 =(bindex2 & GOTTHARD_PACKET_INDEX_MASK);
|
||||
index2 =((bindex2 & GOTTHARD_FRAME_INDEX_MASK) >> GOTTHARD_FRAME_INDEX_OFFSET);
|
||||
#ifdef VERBOSE
|
||||
cout<<"index1:"<<hex<<index<<endl;
|
||||
cout<<"index2:"<<hex<<index<<endl;
|
||||
cout << "index1:" << hex << index << endl;
|
||||
cout << "index2:" << hex << index << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ public:
|
||||
/** Short frame */
|
||||
int shortFrame;
|
||||
|
||||
/** Packets per frame */
|
||||
/** Packets per frame */
|
||||
int packetsPerFrame;
|
||||
|
||||
static int file_des;
|
||||
|
Loading…
x
Reference in New Issue
Block a user