fixed the undefined state of gui when acquisition stopped

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@545 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2013-05-07 14:20:01 +00:00
parent f29358992d
commit 1eae11a87a
10 changed files with 100 additions and 65 deletions

View File

@ -5862,6 +5862,7 @@ int slsDetector::setFileIndex(int i) {
int retval=-1;
int arg = i;
if(thisDetector->receiverOnlineFlag==OFFLINE_FLAG){
if(i>=0)
fileIO::setFileIndex(i);
@ -6340,3 +6341,10 @@ int slsDetector::setReadReceiverFrequency(int i){
}
return retval;
}
void slsDetector::waitForReceiverReadToFinish(){
if(dataSocket)
while(dataSocket->getsocketDescriptor() >= 0)
usleep(1000);
}

View File

@ -1600,6 +1600,11 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
*/
int setReadReceiverFrequency(int i=-1);
/**
* Waits for receiver read to finish after stopping acquisition
*/
void waitForReceiverReadToFinish();
protected:

View File

@ -318,9 +318,9 @@ void slsDetectorUtils::acquire(int delflag){
closeDataFile();
}
}else{
while(stopReceiver()!=OK);
}
}else
stopReceiver();
pthread_mutex_unlock(&mg);

View File

@ -680,6 +680,12 @@ virtual ROI* getROI(int &n)=0;
virtual int setReadReceiverFrequency(int i=-1)=0;
/**
* Waits for receiver read to finish after stopping acquisition
*/
virtual void waitForReceiverReadToFinish()=0;
protected: