gui progress of receiver should be of frame index and not frames caught

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@690 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2013-11-14 12:35:36 +00:00
parent 15f8ba344b
commit 6faf3621d5
2 changed files with 12 additions and 6 deletions

View File

@ -262,12 +262,14 @@ void slsDetectorUtils::acquire(int delflag){
setFileName(fileIO::getFileName()); setFileName(fileIO::getFileName());
if(setReceiverOnline()==OFFLINE_FLAG){ if(setReceiverOnline()==OFFLINE_FLAG){
stopReceiver(); stopReceiver();
*stoppedFlag=1;
pthread_mutex_unlock(&mg); pthread_mutex_unlock(&mg);
break; break;
} }
//start receiver //start receiver
if((startReceiver() == FAIL) || (setReceiverOnline()==OFFLINE_FLAG)){ if(startReceiver() == FAIL) {
stopReceiver(); stopReceiver();
*stoppedFlag=1;
pthread_mutex_unlock(&mg); pthread_mutex_unlock(&mg);
break; break;
} }
@ -275,12 +277,12 @@ void slsDetectorUtils::acquire(int delflag){
} }
#ifdef VERBOSE #ifdef VERBOSE
cout << "Acquiring " << endl; cout << "Acquiring " << endl;
#endif #endif
startAndReadAll(); startAndReadAll();
#ifdef VERBOSE #ifdef VERBOSE
cout << "finished " << endl; cout << "finished " << endl;
cout << "returned! " << endl; cout << "returned! " << endl;
#endif #endif
@ -333,13 +335,14 @@ void slsDetectorUtils::acquire(int delflag){
pthread_mutex_unlock(&mg); pthread_mutex_unlock(&mg);
}else{ }else{
pthread_mutex_lock(&mg); pthread_mutex_lock(&mg);
cout<<"going to start transmit"<<endl;
if(startReceiverReadout() == TRANSMITTING){ if(startReceiverReadout() == TRANSMITTING){
while(getReceiverStatus() != RUN_FINISHED){ while(getReceiverStatus() != RUN_FINISHED){
pthread_mutex_unlock(&mg); pthread_mutex_unlock(&mg);
usleep(50000); usleep(50000);
pthread_mutex_lock(&mg); pthread_mutex_lock(&mg);
} }
} }cout<<"going to stop receiver"<<endl;
stopReceiver(); stopReceiver();
pthread_mutex_unlock(&mg); pthread_mutex_unlock(&mg);
} }

View File

@ -452,11 +452,14 @@ void* postProcessing::processData(int delflag) {
//get progress //get progress
pthread_mutex_lock(&mg); pthread_mutex_lock(&mg);
if(setReceiverOnline()==ONLINE_FLAG) if(setReceiverOnline()==ONLINE_FLAG)
prog=getFramesCaughtByReceiver();//caught=getReceiverCurrentFrameIndex(); prog=getReceiverCurrentFrameIndex();//getFramesCaughtByReceiver();//caught=getReceiverCurrentFrameIndex();
pthread_mutex_unlock(&mg); pthread_mutex_unlock(&mg);
if(setReceiverOnline()==OFFLINE_FLAG) if(setReceiverOnline()==OFFLINE_FLAG)
prog=prevCaught; prog=prevCaught;
setCurrentProgress(prog); if(prevCaught == -1)
setCurrentProgress(0);
else
setCurrentProgress(prog);
if (checkJoinThread()) break; if (checkJoinThread()) break;