mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
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:
parent
f74ea5191d
commit
9c6886d030
@ -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,16 +412,22 @@ void* postProcessing::processData(int delflag) {
|
||||
cout<<"****Detector returned NULL***"<<endl;
|
||||
return 0;
|
||||
}
|
||||
fdata=decodeData(receiverData);
|
||||
delete [] receiverData;
|
||||
if(fdata){
|
||||
if (dataReady) {
|
||||
thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),currentfName,getTotalNumberOfChannels());
|
||||
dataReady(thisData, currentfIndex, pCallbackArg);
|
||||
delete thisData;
|
||||
fdata=NULL;
|
||||
|
||||
if(currentfIndex>=0){
|
||||
fdata=decodeData(receiverData);
|
||||
delete [] receiverData;
|
||||
if(fdata){
|
||||
if (dataReady) {
|
||||
thisData=new detectorData(fdata,NULL,NULL,getCurrentProgress(),currentfName,getTotalNumberOfChannels());
|
||||
dataReady(thisData, currentfIndex, pCallbackArg);
|
||||
delete thisData;
|
||||
fdata=NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
cout<<"****Detector returned mismatched indeices***"<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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){
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user