diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer index 8f00a69d5..42c94e73b 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer differ diff --git a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c index dbf105891..16aec2987 100644 --- a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c @@ -355,7 +355,7 @@ void setDAC(enum detDacIndex ind, int val, int imod, int mV, int retval[]){ ret[1] = retval[mV]; setDAC(VCMP_RL,val,imod,mV,retval); ret[2] = retval[mV]; - setDAC(VCMP_RL,val,imod,mV,retval); + setDAC(VCMP_RR,val,imod,mV,retval); ret[3] = retval[mV]; if((ret[0]== ret[1])&& diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp index bd34ab5ba..8e4356795 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp @@ -330,14 +330,17 @@ void slsDetectorUtils::acquire(int delflag){ break; - + //offline if(setReceiverOnline()==OFFLINE_FLAG){ - pthread_mutex_lock(&mg); // wait until data processing thread has finished the data + pthread_mutex_lock(&mg); acquiringDone = 1; + pthread_mutex_unlock(&mg); if (*threadedProcessing) { sem_wait(&sem_queue); + pthread_mutex_lock(&mg); acquiringDone = 0; + pthread_mutex_unlock(&mg); } #ifdef VERBOSE @@ -354,8 +357,12 @@ void slsDetectorUtils::acquire(int delflag){ if((*correctionMask)&(1< 0){ #ifdef VERY_VERY_DEBUG - if(acquiringDone == 1) - cout << "acquiring seems to be done" << endl; + if(acquiringDone == 1) cout << "acquiring seems to be done" << endl; #endif - //so that it checks for last frame for some number of checks, then checks join thread - pthread_mutex_lock(&mg); - acquiringDone++; + + + //IF GUI, check for last frames (counter upto 5) + if(dataReady){ + pthread_mutex_lock(&mg); + acquiringDone++; + pthread_mutex_unlock(&mg); #ifdef VERY_VERY_DEBUG cout << "acquiringDone :" << acquiringDone << endl; -#endif - pthread_mutex_unlock(&mg); - //go through once more to get last nth frame data - if (acquiringDone >= 5){cout<<"acquiringdone:"<= 5)){ + if(!dataReady || (!nthframe) ||(!newData)){ +#ifdef VERY_VERY_DEBUG + cout << "gonna post for it to end" << endl; +#endif + sem_post(&sem_queue); +#ifdef VERY_VERY_DEBUG + cout << "Sem posted" << endl; +#endif + } } } //random reads and for nthframe, checks if there is no new data else if((!nthframe) ||(!newData)){ //cout <<"cecking now" << endl; - if (checkJoinThread()) + if (checkJoinThread()){ break; + } } @@ -568,23 +574,22 @@ void* postProcessing::processData(int delflag) { if(!newData){ if(caught > progress){ newData = true; - /* - // keeping acquiringdone at 1 to get more time to get data - if(acquiringDone > 0){cout<<"going to maintain acquiidne"<0 (= det acq over), reset to get more frames + if(dataReady && (acquiringDone > 0)){ pthread_mutex_lock(&mg); acquiringDone = 1; - //#ifdef VERY_VERY_DEBUG +#ifdef VERY_VERY_DEBUG cout << "Keeping acquiringDone at 1 " << endl; - //#endif +#endif pthread_mutex_unlock(&mg); - }*/ + } } -#ifdef VERY_VERY_DEBUG - cout << "currentAcquisitionIndex:" << currentAcquisitionIndex << " progress:" << progress << endl; -#endif } + + if(newData){ #ifdef VERY_VERY_DEBUG cout << "new data" << endl;