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 "slsDetectorFunctionList.h"
#include "gitInfoEiger.h" #include "gitInfoEiger.h"
/*#include "EigerHighLevelFunctions.c"
#include "EigerBackEndFunctions.c"*/
#include "FebControl.h" #include "FebControl.h"
#include "Beb.h" #include "Beb.h"
@ -61,6 +59,9 @@ int top = 0;
int master = 0; int master = 0;
#define TEN_GIGA_BUFFER_SIZE 4112
#define ONE_GIGA_BUFFER_SIZE 1040
int initDetector(){ int initDetector(){
int imod,i,n; int imod,i,n;
n = getNModBoard(1); n = getNModBoard(1);
@ -792,7 +793,10 @@ int configureMAC(int ipad, long long int macad, long long int detectormacadd, in
int calculateDataBytes(){ 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; std::cout<< "Dac set to "<< retval[0] << " dac units (" << retval[1] << "mV)" << std::endl;
#endif #endif
if (ret==FAIL) { 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) if(mV)
return retval[1]; return retval[1];
@ -4200,10 +4200,10 @@ int slsDetector::setDynamicRange(int n){
thisDetector->dynamicRange=retval; thisDetector->dynamicRange=retval;
//#ifdef VERBOSE #ifdef VERBOSE
std::cout<< "Dynamic range set to "<< thisDetector->dynamicRange << std::endl; std::cout<< "Dynamic range set to "<< thisDetector->dynamicRange << std::endl;
std::cout<< "Data bytes "<< thisDetector->dataBytes << 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(ret != FAIL){
if(setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG){ if(setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG){
#ifdef VERBOSE #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 #endif
if (connectData() == OK) if (connectData() == OK)
ret=thisReceiver->sendInt(fnum2,retval1,retval); ret=thisReceiver->sendInt(fnum2,retval1,n);
if((retval1 != retval)|| (ret==FAIL)){ if ((ret==FAIL) || (retval1 != retval)){
ret = FAIL; ret = FAIL;
cout << "ERROR:Dynamic range in receiver set incorrectly to " << retval1 << " instead of " << retval << endl; cout << "ERROR:Dynamic range in receiver set incorrectly to " << retval1 << " instead of " << retval << endl;
setErrorMask((getErrorMask())|(RECEIVER_DYNAMIC_RANGE)); setErrorMask((getErrorMask())|(RECEIVER_DYNAMIC_RANGE));

View File

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

View File

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

View File

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

View File

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