now processing all files of a sequence

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@157 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
x04sa 2012-03-23 08:30:24 +00:00
parent e3ca421c3c
commit ca896b8b30

View File

@ -1759,6 +1759,9 @@ void* slsDetectorUtils::processData(int delflag) {
#ifdef VERBOSE #ifdef VERBOSE
// cout << "**************Current position index is " << currentPositionIndex << endl; // cout << "**************Current position index is " << currentPositionIndex << endl;
#endif #endif
if (*numberOfPositions>0 || delflag==0) {
if (currentPositionIndex<=1) { if (currentPositionIndex<=1) {
if (*binSize>0) if (*binSize>0)
bs=*binSize; bs=*binSize;
@ -1785,6 +1788,7 @@ void* slsDetectorUtils::processData(int delflag) {
#endif #endif
resetMerging(mergingBins, mergingCounts,mergingErrors, mergingMultiplicity, bs); resetMerging(mergingBins, mergingCounts,mergingErrors, mergingMultiplicity, bs);
} }
}
/* it would be better to create an ang0 with 0 encoder position and add to merging/write to file simply specifying that offset so that when it cycles writing the data or adding to merging it also calculates the angular position */ /* it would be better to create an ang0 with 0 encoder position and add to merging/write to file simply specifying that offset so that when it cycles writing the data or adding to merging it also calculates the angular position */
#ifdef VERBOSE #ifdef VERBOSE
@ -1792,8 +1796,8 @@ void* slsDetectorUtils::processData(int delflag) {
#endif #endif
ang=convertAngles(currentPosition); ang=convertAngles(currentPosition);
if (*correctionMask!=0) { // if (*correctionMask!=0) {
if (*numberOfPositions>1) { // if (*numberOfPositions>1) {
//uses static function?!?!?!? //uses static function?!?!?!?
//writeDataFile (fname+string(".dat"), getTotalNumberOfChannels(), ffcdata, ffcerr,ang); //writeDataFile (fname+string(".dat"), getTotalNumberOfChannels(), ffcdata, ffcerr,ang);
#ifdef VERBOSE #ifdef VERBOSE
@ -1801,11 +1805,12 @@ void* slsDetectorUtils::processData(int delflag) {
#endif #endif
writeDataFile (fname+string(".dat"), ffcdata, ffcerr,ang); writeDataFile (fname+string(".dat"), ffcdata, ffcerr,ang);
} // }
} // }
#ifdef VERBOSE #ifdef VERBOSE
// cout << "add to merging "<< currentPositionIndex << endl; // cout << "add to merging "<< currentPositionIndex << endl;
#endif #endif
if (*numberOfPositions>0 || delflag==0) {
addToMerging(ang, ffcdata, ffcerr, mergingBins, mergingCounts,mergingErrors, mergingMultiplicity, getTotalNumberOfChannels(), bs, *angDirection, *correctionMask, badChannelMask ); addToMerging(ang, ffcdata, ffcerr, mergingBins, mergingCounts,mergingErrors, mergingMultiplicity, getTotalNumberOfChannels(), bs, *angDirection, *correctionMask, badChannelMask );
#ifdef VERBOSE #ifdef VERBOSE
@ -1815,7 +1820,7 @@ void* slsDetectorUtils::processData(int delflag) {
pthread_mutex_lock(&mp); pthread_mutex_lock(&mp);
if (currentPositionIndex>=(*numberOfPositions) && posfinished==1 && queuesize==1) { if ((currentPositionIndex>=(*numberOfPositions) && posfinished==1 && queuesize==1)) {
// if ((currentPositionIndex>=(*numberOfPositions)) || (currentPositionIndex==0)) { // if ((currentPositionIndex>=(*numberOfPositions)) || (currentPositionIndex==0)) {
@ -1884,8 +1889,10 @@ void* slsDetectorUtils::processData(int delflag) {
// cout << mergingBins<< " " << mergingCounts<< " " << mergingErrors << " " << mergingMultiplicity << " " << endl; // cout << mergingBins<< " " << mergingCounts<< " " << mergingErrors << " " << mergingMultiplicity << " " << endl;
#endif #endif
}
} else { } else {
thisData=new detectorData(mergingCounts,mergingErrors,mergingBins,getCurrentProgress(),(fname+string(ext)).c_str(),np); thisData=new detectorData(mergingCounts,mergingErrors,mergingBins,getCurrentProgress(),(fname+string(ext)).c_str(),np);
finalDataQueue.push(thisData); finalDataQueue.push(thisData);
} }
pthread_mutex_lock(&mp); pthread_mutex_lock(&mp);