mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
moench great stuff
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@541 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -148,9 +148,12 @@ int slsReceiverFunctionList::getFrameIndex(){
|
||||
int slsReceiverFunctionList::getAcquisitionIndex(){
|
||||
if(startAcquisitionIndex==-1)
|
||||
acquisitionIndex=0;
|
||||
else
|
||||
else{
|
||||
if(myDetectorType == MOENCH)
|
||||
acquisitionIndex=(currframenum - startAcquisitionIndex);
|
||||
else
|
||||
acquisitionIndex=(currframenum - startAcquisitionIndex)/packetsPerFrame;
|
||||
|
||||
}
|
||||
return acquisitionIndex;
|
||||
}
|
||||
|
||||
@ -357,11 +360,12 @@ int slsReceiverFunctionList::startListening(){
|
||||
//start for each scan
|
||||
if(startFrameIndex==-1){
|
||||
if(!frameIndexOffset)
|
||||
startFrameIndex = (int)(*((int*)buffer));
|
||||
startFrameIndex = ((int)(*((int*)buffer)))- packetsPerFrame;
|
||||
else
|
||||
startFrameIndex = (((int)(*((int*)buffer))) & (frameIndexMask)) >> frameIndexOffset;
|
||||
startFrameIndex = ((((int)(*((int*)buffer))) & (frameIndexMask)) >> frameIndexOffset)-1;
|
||||
|
||||
startFrameIndex -= packetsPerFrame;
|
||||
//startFrameIndex -= packetsPerFrame;
|
||||
// startFrameIndex -=1;
|
||||
//cout<<"startFrameIndex:"<<startFrameIndex<<endl;
|
||||
prevframenum=startFrameIndex;
|
||||
}
|
||||
@ -511,7 +515,7 @@ int slsReceiverFunctionList::startWriting(){
|
||||
else
|
||||
currframenum = (((int)(*((int*)wbuf))) & (frameIndexMask)) >> frameIndexOffset;
|
||||
//currframenum = (int)(*((int*)wbuf));
|
||||
//cout<<"**************curreframenm:"<<currframenum<<endl;
|
||||
cout<<"**************curreframenm:"<<currframenum<<endl;
|
||||
|
||||
//write data
|
||||
if(enableFileWrite){
|
||||
|
@ -1008,7 +1008,7 @@ int slsReceiverFuncs::moench_read_frame(){
|
||||
offset = 4;
|
||||
int packetOffset = 0;
|
||||
int thisFrameNumber = (index & (MOENCH_FRAME_INDEX_MASK)) >> MOENCH_FRAME_INDEX_OFFSET;
|
||||
cout<<"this frame number:"<<thisFrameNumber<<endl;
|
||||
//cout<<"this frame number:"<<thisFrameNumber<<endl;
|
||||
int packetIndex,x,y;
|
||||
int iPacket = 0;
|
||||
offset = 4;
|
||||
@ -1017,13 +1017,13 @@ int slsReceiverFuncs::moench_read_frame(){
|
||||
while (iPacket < numPackets){printf("iPacketr:%d\n",iPacket);
|
||||
//read packet index
|
||||
cout << endl;
|
||||
cout <<"buffer:"<<hex<<(*((int*)(((char*)origVal)+packetOffset)))<<endl;
|
||||
//cout <<"buffer:"<<hex<<(*((int*)(((char*)origVal)+packetOffset)))<<endl;
|
||||
packetIndex = (*((int*)(((char*)origVal)+packetOffset))) & MOENCH_PACKET_INDEX_MASK;
|
||||
|
||||
packetIndex--;
|
||||
if(packetIndex ==-1) packetIndex = 39;
|
||||
cout<<"packet index:"<<hex<<packetIndex<<endl<<dec;
|
||||
cout << "buffer size: " << bufferSize << " packetOffset: " << packetOffset << endl;
|
||||
//cout<<"packet index:"<<hex<<packetIndex<<endl<<dec;
|
||||
// cout << "buffer size: " << bufferSize << " packetOffset: " << packetOffset << endl;
|
||||
//if its valid
|
||||
if ((packetIndex < 40) && (packetIndex >= 0)){
|
||||
// if(packetIndex == 1){
|
||||
@ -1061,9 +1061,9 @@ int slsReceiverFuncs::moench_read_frame(){
|
||||
iPacket++;
|
||||
packetOffset = packetOffset + offset + onePacketSize;
|
||||
}*/
|
||||
cout<<"found or exited"<<endl;
|
||||
//cout<<"found or exited"<<endl;
|
||||
}
|
||||
cout<<"exited loop"<<endl;
|
||||
cout<<"******************* exited loop"<<endl;
|
||||
}
|
||||
//********************************************************
|
||||
|
||||
|
Reference in New Issue
Block a user