From 60f7fc9f84b37c7d308aa0d932ebda5029fb650a Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Fri, 26 Apr 2013 15:43:09 +0000 Subject: [PATCH] moench receiver with packet index for each frame git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@534 951219d9-93cf-4727-9268-0efd64621fa3 --- .../moenchDetectorServer/server_funcs.c | 2 ++ .../slsReceiver/slsReceiverFunctionList.h | 3 --- .../slsReceiver/slsReceiver_funcs.cpp | 13 +++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/slsDetectorSoftware/moenchDetectorServer/server_funcs.c b/slsDetectorSoftware/moenchDetectorServer/server_funcs.c index 010c71071..dcccc44b2 100755 --- a/slsDetectorSoftware/moenchDetectorServer/server_funcs.c +++ b/slsDetectorSoftware/moenchDetectorServer/server_funcs.c @@ -73,6 +73,8 @@ int init_detector(int b, int checkType) { printf("***Assuming this to be a MOENCH detector***\n"); } withGotthard = 1; + } else if(b){ + printf("***This is a MOENCH detector with %d chips per module***\n",NCHIP); } if (b) { diff --git a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.h b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.h index 44dc82fee..62b195ef0 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.h +++ b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.h @@ -198,9 +198,6 @@ public: */ void registerWriteReceiverDataCallback(int( *userCallback)(char*, int, FILE*, void*), void *pArg) {writeReceiverData = userCallback; pwriteReceiverDataArg = pArg;}; - int getFrameIndex(int index){return index & MOENCH_FRAME_INDEX_MASK} - - int get private: diff --git a/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp b/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp index 9c1e9754b..afe4a5c8d 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp +++ b/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp @@ -1005,7 +1005,8 @@ int slsReceiverFuncs::moench_read_frame(){ int numPackets = MOENCH_PACKETS_PER_FRAME; //40 int onePacketSize = MOENCH_DATA_BYTES / MOENCH_PACKETS_PER_FRAME; //1280*40 / 40 = 1280 int partsPerFrame = onePacketSize / MOENCH_BYTES_PER_ADC; // 1280 / 80 = 16 - int origvalHeader = origVal; + offset = 4; + int packetOffset = 0; int thisFrameNumber = (index & (MOENCH_FRAME_INDEX_MASK)) >> MOENCH_FRAME_INDEX_OFFSET; cout<<"this frame number:"<= 0)){ x = packetIndex / 10; @@ -1037,18 +1038,18 @@ int slsReceiverFuncs::moench_read_frame(){ //increment offset+=6; - origvalHeader = origvalHeader + offset + onePacketSize; iPacket++; + packetOffset = packetOffset + offset + onePacketSize; - cout <<" checking next frame number:"<<(((*origvalHeader) & (MOENCH_FRAME_INDEX_MASK)) >> MOENCH_FRAME_INDEX_OFFSET)<> MOENCH_FRAME_INDEX_OFFSET)<> MOENCH_FRAME_INDEX_OFFSET) != thisFrameNumber){cout<<"did not match"<> MOENCH_FRAME_INDEX_OFFSET) != thisFrameNumber){cout<<"did not match"<= numPackets) break; //increment offset+=6; - origvalHeader = origvalHeader + offset + onePacketSize; iPacket++; + packetOffset = packetOffset + offset + onePacketSize; } cout<<"found or exited"<