diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer index ef98c4c4d..48451f357 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 efc8267ae..04f4edde8 100644 --- a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c @@ -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; } diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index 0d824f938..966e77312 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -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)); diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp index 8acfbb8e1..f98a68bee 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp @@ -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; diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp index 9a2bd6f0b..73e7a3e7c 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.cpp @@ -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 diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h index 1472af732..effa175e7 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h @@ -302,6 +302,8 @@ s /** set when detector finishes acquiring */ int acquiringDone; + /**sub frame*/ + int subframe; /** diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c index ad749c248..81df1d4f6 100755 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c @@ -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