included mismatched indices error shouldnt return fail, but client should try to read again

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@375 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2012-12-13 08:33:22 +00:00
parent f74ea5191d
commit 9c6886d030
3 changed files with 18 additions and 15 deletions

View File

@ -391,15 +391,13 @@ void* postProcessing::processData(int delflag) {
bool newData=false;
char currentfName[MAX_STR_LENGTH];
int currentfIndex=0;
while(1){
while(1){cout<<"\t"<<flush;
if (checkJoinThread()) break;
usleep(200000);
pthread_mutex_lock(&mg);
caught=getCurrentFrameIndex();
pthread_mutex_unlock(&mg);
incrementProgress(caught-prevCaught);
if(caught-prevCaught) newData=true;
else newData=false;
@ -414,6 +412,8 @@ void* postProcessing::processData(int delflag) {
cout<<"****Detector returned NULL***"<<endl;
return 0;
}
if(currentfIndex>=0){
fdata=decodeData(receiverData);
delete [] receiverData;
if(fdata){
@ -425,6 +425,10 @@ void* postProcessing::processData(int delflag) {
}
}
}
else{
cout<<"****Detector returned mismatched indeices***"<<endl;
}
}
}
}

View File

@ -328,7 +328,7 @@ int slsReceiverFunctionList::startWriting(){
//start writing
sfilefd = fopen((const char *) (actualfilename), "w");
cout << "Saving to " << actualfilename << ". Ready! " << endl;
cout << "Ready! " << endl << "Saving to " << actualfilename << endl;
while(listening_thread_running){

View File

@ -679,7 +679,6 @@ int slsReceiverFuncs::read_frame(){
//got atleast first frame, read buffer
if(ret==OK){
ret=FAIL;
while(count<20){
//get frame
raw=slsReceiverList->readFrame(fName);
@ -696,7 +695,6 @@ int slsReceiverFuncs::read_frame(){
if(index%2){
memcpy(retval,((char*) origVal)+2, onedatasize);
memcpy((((char*)retval)+onedatasize), ((char*) origVal)+8+onedatasize, onedatasize);
ret=OK;
break;
}
@ -705,7 +703,6 @@ int slsReceiverFuncs::read_frame(){
memcpy((((char*)retval)+onedatasize),((char*) origVal)+2, onedatasize);
memcpy(retval, ((char*) origVal)+8+onedatasize, onedatasize);
index=index2;
ret=OK;
break;
}
@ -718,6 +715,8 @@ int slsReceiverFuncs::read_frame(){
if(count==20){
cout << "same type: index:" << index << "\tindex2:" << index2 << endl;
/**send garbage with -1 index to try again*/
memcpy(retval,((char*) origVal)+2, onedatasize);
memcpy((((char*)retval)+onedatasize), ((char*) origVal)+8+onedatasize, onedatasize);
}
arg=((index - startIndex)/2)-1;