Solved bug on number of measurements

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@250 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi 2012-09-11 09:13:52 +00:00
parent 25edfba592
commit c6d383f770
4 changed files with 35 additions and 21 deletions

View File

@ -160,7 +160,7 @@ multiSlsDetector::multiSlsDetector(int id) : slsDetectorUtils(), shmId(-1)
/** sets angular conversion file to none */ /** sets angular conversion file to none */
strcpy(thisMultiDetector->angConvFile,"none"); strcpy(thisMultiDetector->angConvFile,"none");
/** set binsize*/ /** set binsize*/
thisMultiDetector->binSize=0; thisMultiDetector->binSize=0.001;
thisMultiDetector->stoppedFlag=0; thisMultiDetector->stoppedFlag=0;
thisMultiDetector->threadedProcessing=1; thisMultiDetector->threadedProcessing=1;

View File

@ -569,7 +569,7 @@ int slsDetector::initializeDetectorSize(detectorType type) {
/** sets angular conversion file to none */ /** sets angular conversion file to none */
strcpy(thisDetector->angConvFile,"none"); strcpy(thisDetector->angConvFile,"none");
/** set binsize*/ /** set binsize*/
thisDetector->binSize=0; thisDetector->binSize=0.001;
thisDetector->stoppedFlag=0; thisDetector->stoppedFlag=0;
thisDetector->threadedProcessing=1; thisDetector->threadedProcessing=1;

View File

@ -48,8 +48,6 @@ void slsDetectorUtils::acquire(int delflag){
progressIndex=0; progressIndex=0;
*stoppedFlag=0; *stoppedFlag=0;
int measurement = (int)setTimer(slsDetectorDefs::MEASUREMENTS_NUMBER,-1);
angCalLogClass *aclog=NULL; angCalLogClass *aclog=NULL;
enCalLogClass *eclog=NULL; enCalLogClass *eclog=NULL;
// int lastindex=startindex, nowindex=startindex; // int lastindex=startindex, nowindex=startindex;
@ -90,7 +88,20 @@ void slsDetectorUtils::acquire(int delflag){
posfinished=0; posfinished=0;
pthread_mutex_unlock(&mp); pthread_mutex_unlock(&mp);
for(int im=0;im<measurement;im++) { if (*threadedProcessing) {
startThread(delflag);
}
#ifdef VERBOSE
cout << " starting thread " << endl;
#endif
int nm=1;
if (timerValue[MEASUREMENTS_NUMBER]>0)
nm=timerValue[MEASUREMENTS_NUMBER];
for(int im=0;im<nm;im++) {
@ -100,12 +111,9 @@ void slsDetectorUtils::acquire(int delflag){
#ifdef VERBOSE #ifdef VERBOSE
cout << " starting thread " << endl; cout << " starting measurement "<< im << " of " << nm << endl;
#endif #endif
if (*threadedProcessing) {
startThread(delflag);
}
//cout << "data thread started " << endl; //cout << "data thread started " << endl;
int np=1; int np=1;
if (*numberOfPositions>0) if (*numberOfPositions>0)
@ -309,30 +317,36 @@ void slsDetectorUtils::acquire(int delflag){
*fileIndex=setLastIndex(); *fileIndex=setLastIndex();
if (*stoppedFlag==0) { if (*stoppedFlag==0) {
executeAction(stopScript); executeAction(stopScript);
} } else
break;
// loop measurements // loop measurements
// waiting for the data processing thread to finish! if (measurement_finished)
if (*threadedProcessing) { measurement_finished(im,*fileIndex,measFinished_p);
pthread_mutex_lock(&mp);
jointhread=1;
pthread_mutex_unlock(&mp);
pthread_join(dataProcessingThread, &status);
}
if (*stoppedFlag) { if (*stoppedFlag) {
break; break;
} }
if (measurement_finished)
measurement_finished(im,*fileIndex,measFinished_p);
}
}
// waiting for the data processing thread to finish!
if (*threadedProcessing) {
pthread_mutex_lock(&mp);
jointhread=1;
pthread_mutex_unlock(&mp);
pthread_join(dataProcessingThread, &status);
}
if (connectChannels) { if (connectChannels) {
if (disconnect_channels) if (disconnect_channels)
disconnect_channels(DCarg); disconnect_channels(DCarg);
} }
if (aclog) if (aclog)
delete aclog; delete aclog;