fixed 32 progress problem, and increased debugging

This commit is contained in:
Dhanya Maliakal
2015-06-30 17:20:23 +02:00
parent f29f9b701d
commit a3a2db1f73
7 changed files with 32 additions and 13 deletions

View File

@ -9,8 +9,6 @@
#include "slsDetectorFunctionList.h"
#include "gitInfoEiger.h"
/*#include "EigerHighLevelFunctions.c"
#include "EigerBackEndFunctions.c"*/
#include "FebControl.h"
#include "Beb.h"
@ -61,6 +59,9 @@ int top = 0;
int master = 0;
#define TEN_GIGA_BUFFER_SIZE 4112
#define ONE_GIGA_BUFFER_SIZE 1040
int initDetector(){
int imod,i,n;
n = getNModBoard(1);
@ -792,7 +793,10 @@ int configureMAC(int ipad, long long int macad, long long int detectormacadd, in
int calculateDataBytes(){
return setDynamicRange(-1)*16*1040;
if(send_to_ten_gig)
return setDynamicRange(-1)*16*TEN_GIGA_BUFFER_SIZE;
else
return setDynamicRange(-1)*16*ONE_GIGA_BUFFER_SIZE;
}

View File

@ -2134,7 +2134,7 @@ dacs_t slsDetector::setDAC(dacs_t val, dacIndex index, int mV, int imod){
std::cout<< "Dac set to "<< retval[0] << " dac units (" << retval[1] << "mV)" << std::endl;
#endif
if (ret==FAIL) {
std::cout<< "Set dac failed " << std::endl;
std::cout<< "Set dac " << index << " of module " << imod << " to " << val << " failed." << std::endl;
}
if(mV)
return retval[1];
@ -4200,10 +4200,10 @@ int slsDetector::setDynamicRange(int n){
thisDetector->dynamicRange=retval;
//#ifdef VERBOSE
#ifdef VERBOSE
std::cout<< "Dynamic range set to "<< thisDetector->dynamicRange << std::endl;
std::cout<< "Data bytes "<< thisDetector->dataBytes << std::endl;
//#endif
#endif
}
@ -4211,11 +4211,11 @@ int slsDetector::setDynamicRange(int n){
if(ret != FAIL){
if(setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG){
#ifdef VERBOSE
std::cout << "Sending/Getting dynamic range to/from receiver " << retval << std::endl;
std::cout << "Sending/Getting dynamic range to/from receiver " << n << std::endl;
#endif
if (connectData() == OK)
ret=thisReceiver->sendInt(fnum2,retval1,retval);
if((retval1 != retval)|| (ret==FAIL)){
ret=thisReceiver->sendInt(fnum2,retval1,n);
if ((ret==FAIL) || (retval1 != retval)){
ret = FAIL;
cout << "ERROR:Dynamic range in receiver set incorrectly to " << retval1 << " instead of " << retval << endl;
setErrorMask((getErrorMask())|(RECEIVER_DYNAMIC_RANGE));

View File

@ -53,6 +53,11 @@ void slsDetectorUtils::acquire(int delflag){
int multiframe = nc*nf;
//
if(setDynamicRange() == 32) subframe = 1;
else subframe = 0;
// setTotalProgress();
//moved these 2 here for measurement change
progressIndex=0;

View File

@ -501,6 +501,8 @@ void* postProcessing::processData(int delflag) {
int currentFrameIndex = -1;
bool newData = false;
int nthframe = setReadReceiverFrequency(0);
#ifdef VERBOSE
std::cout << "receiver read freq:" << nthframe << std::endl;
#endif
@ -531,8 +533,14 @@ void* postProcessing::processData(int delflag) {
pthread_mutex_unlock(&mg);
//updating progress
if(currentAcquisitionIndex != -1)
setCurrentProgress(currentAcquisitionIndex+1);
if(currentAcquisitionIndex != -1){
if(subframe){
pthread_mutex_lock(&mg);
setCurrentProgress(getFramesCaughtByReceiver());
pthread_mutex_unlock(&mg);
}else
setCurrentProgress(currentAcquisitionIndex+1);
}
#ifdef VERY_VERY_DEBUG
cout << "currentAcquisitionIndex:" << currentAcquisitionIndex << endl;
#endif

View File

@ -302,6 +302,8 @@ s
/** set when detector finishes acquiring */
int acquiringDone;
/**sub frame*/
int subframe;
/**

View File

@ -85,7 +85,7 @@ int decode_function(int file_des) {
fnum=255;
ret=(*flist[fnum])(file_des);
if (ret==FAIL)
printf( "Error executing the function = %d \n",fnum);
cprintf( RED, "Error executing the function = %d \n",fnum);
return ret;
}
@ -2603,7 +2603,7 @@ int set_dynamic_range(int file_des) {
ret=FORCE_UPDATE;
#ifdef SLS_DETECTOR_FUNCTION_LIST
dataBytes=calculateDataBytes();
if (dr>=0) dataBytes=calculateDataBytes();
#endif
//ret could be swapped during sendData