fixed dimensions, fixed rate corr bug, moved rate corr to server because config resets memory and ratecorr depends on client variables

This commit is contained in:
Dhanya Maliakal
2016-07-14 16:23:03 +02:00
parent 342d4f8c30
commit 4939e47305
19 changed files with 413 additions and 358 deletions

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
URL: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git/eigerDetectorServer
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
Repsitory UUID: 769ba51f2796ac8088f29a6cdb87955befbbdae2
Revision: 201
Repsitory UUID: f65bc993ef8b3548b52e677b3f42ae6229611d73
Revision: 203
Branch: developer
Last Changed Author: Dhanya_Maliakal
Last Changed Rev: 326
Last Changed Date: 2016-07-05 17:24:44 +0200
Last Changed Rev: 327
Last Changed Date: 2016-07-12 16:45:00 +0200

View File

@ -1,11 +1,11 @@
//#define SVNPATH ""
#define SVNURL "git@git.psi.ch:sls_detectors_software/sls_detector_software.git/eigerDetectorServer"
//#define SVNREPPATH ""
#define SVNREPUUID "769ba51f2796ac8088f29a6cdb87955befbbdae2"
//#define SVNREV 0x326
#define SVNREPUUID "f65bc993ef8b3548b52e677b3f42ae6229611d73"
//#define SVNREV 0x327
//#define SVNKIND ""
//#define SVNSCHED ""
#define SVNAUTH "Dhanya_Maliakal"
#define SVNREV 0x326
#define SVNDATE 0x20160705
#define SVNREV 0x327
#define SVNDATE 0x20160712
//

View File

@ -12,6 +12,8 @@
#include "FebControl.h"
#include "Beb.h"
int default_tau_from_file= -1;
#define BEB_NUM 34
enum detectorSettings thisSettings;
@ -535,16 +537,21 @@ int getRateCorrectionEnable(){
}
int getDefaultSettingsTau_in_nsec(){
switch(thisSettings){
case STANDARD: return STANDARD_TAU;
case HIGHGAIN: return HIGHGAIN_TAU;
case LOWGAIN: return LOWGAIN_TAU;
default: return -1;
}
return default_tau_from_file;
}
int64_t getCurrentTau(){
if(!getRateCorrectionEnable())
return 0;
else
return Feb_Control_Get_RateTable_Tau_in_nsec();
}
int setModule(sls_detector_module myMod, int* gain, int* offset,int* delay, int64_t tau_ns){
void setDefaultSettingsTau_in_nsec(int t){
default_tau_from_file = t;
}
int setModule(sls_detector_module myMod, int* gain, int* offset,int* delay){
int retval[2];
int i;
@ -555,32 +562,6 @@ int setModule(sls_detector_module myMod, int* gain, int* offset,int* delay, int6
//set the settings variable
setSettings( (enum detectorSettings)myMod.reg,-1);
//rate correction (ignore -2: from load settings)
if(tau_ns > -2){
//set settings, with no tau in calib file
if(tau_ns == -1){
tau_ns = getDefaultSettingsTau_in_nsec();
//incorrect settings
if(tau_ns < 0)
return -1;
}
//set the tau for all
int64_t rate_retval = setRateCorrection(tau_ns); //tau_ns will not be -1 here
if(tau_ns != rate_retval){
if(rate_retval == -1)
return -2;
else
return -3;
}
//set settings, with no tau in calib file :
//only setting tau, rate correction should be off
//(in previous "error" returns, its switched off anyway)
if(tau_ns == -1)
setRateCorrection(0);
}else cprintf(RED,"rate not changed\n");
//set the gains and offset variables locally
for(i=0;i<NGAIN;i++){
if(gain[i]>=0){
@ -629,7 +610,7 @@ int setModule(sls_detector_module myMod, int* gain, int* offset,int* delay, int6
return FAIL;
}
return 0;
return thisSettings;
}
@ -728,6 +709,9 @@ enum detectorSettings setSettings(enum detectorSettings sett, int imod){
return thisSettings;
}
enum detectorSettings getSettings(){
return thisSettings;
}
int startReceiver(int d){
printf("Going to prepare for acquisition with counter_bit:%d\n",Feb_Control_Get_Counter_Bit());

View File

@ -40,12 +40,5 @@
enum detDacIndex{SVP,VTR,VRF,VRS,SVN,VTGSTV,VCMP_LL,VCMP_LR,CAL,VCMP_RL,RXB_RB,RXB_LB,VCMP_RR,VCP,VCN,VIS,VTHRESHOLD};
enum defaultTauValues{
HIGHGAIN_TAU=410,
STANDARD_TAU=290,
LOWGAIN_TAU=180};
#endif /* SLSDETECTORSERVER_DEFS_H_ */