mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
fixed the gain and offset default values uploaded for eiger
This commit is contained in:
parent
5057fd4eef
commit
25dbaa4e09
Binary file not shown.
@ -54,7 +54,7 @@ int dst_requested[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
|||||||
//char Module_dac_names[16][10]= {"SvP","Vtr","Vrf","Vrs","SvN","Vtgstv","Vcmp_ll","Vcmp_lr","cal","Vcmp_rl","rxb_rb","rxb_lb","Vcmp_rr","Vcp","Vcn","Vis"};;
|
//char Module_dac_names[16][10]= {"SvP","Vtr","Vrf","Vrs","SvN","Vtgstv","Vcmp_ll","Vcmp_lr","cal","Vcmp_rl","rxb_rb","rxb_lb","Vcmp_rr","Vcp","Vcn","Vis"};;
|
||||||
|
|
||||||
int default_dac_values[16] = {0,2480,3300,1400,4000,2556,1000,1000,4000,1000,1000,1000,1000,200,2000,1550};
|
int default_dac_values[16] = {0,2480,3300,1400,4000,2556,1000,1000,4000,1000,1000,1000,1000,200,2000,1550};
|
||||||
int default_gain_values[3] = {-314800,-314800,-314800};
|
int default_gain_values[3] = {314800,314800,314800};
|
||||||
int default_offset_values[3] = {3714000,3714000,3714000};
|
int default_offset_values[3] = {3714000,3714000,3714000};
|
||||||
|
|
||||||
|
|
||||||
@ -398,11 +398,18 @@ int setModule(sls_detector_module myMod, int* gain, int* offset){
|
|||||||
setSettings( (enum detectorSettings)myMod.reg,-1);
|
setSettings( (enum detectorSettings)myMod.reg,-1);
|
||||||
|
|
||||||
//set the gains and offset variables locally
|
//set the gains and offset variables locally
|
||||||
for(i=0;i<NGAIN;i++)
|
for(i=0;i<NGAIN;i++){
|
||||||
detectorGain[i] = gain[i];
|
if(gain[i]>=0){
|
||||||
for(i=0;i<NOFFSET;i++)
|
detectorGain[i] = gain[i];
|
||||||
detectorOffset[i] = offset[i];
|
printf("gain[%d]:%d\n",i,detectorGain[i]);
|
||||||
|
}else cprintf(RED,"gain not set\n");
|
||||||
|
}
|
||||||
|
for(i=0;i<NOFFSET;i++){
|
||||||
|
if(offset[i]>=0){
|
||||||
|
detectorOffset[i] = offset[i];
|
||||||
|
printf("offset[%d]:%d\n",i,detectorOffset[i]);
|
||||||
|
}else cprintf(RED,"offset not set\n");
|
||||||
|
}
|
||||||
//copy module locally
|
//copy module locally
|
||||||
if (detectorModules)
|
if (detectorModules)
|
||||||
copyModule(detectorModules,&myMod);
|
copyModule(detectorModules,&myMod);
|
||||||
@ -432,7 +439,6 @@ int setModule(sls_detector_module myMod, int* gain, int* offset){
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("set gainval[0]:%d\n",detectorGain[0]);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3059,10 +3059,6 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
|||||||
|
|
||||||
int ret=0;
|
int ret=0;
|
||||||
|
|
||||||
if(thisDetector->nGain)
|
|
||||||
gainval = new int[thisDetector->nGain];
|
|
||||||
if(thisDetector->nOffset)
|
|
||||||
offsetval = new int[thisDetector->nOffset];
|
|
||||||
|
|
||||||
switch (isettings) {
|
switch (isettings) {
|
||||||
case STANDARD:
|
case STANDARD:
|
||||||
@ -5986,7 +5982,17 @@ int slsDetector::writeSettingsFile(string fname, int imod){
|
|||||||
int slsDetector::loadSettingsFile(string fname, int imod) {
|
int slsDetector::loadSettingsFile(string fname, int imod) {
|
||||||
|
|
||||||
sls_detector_module *myMod=NULL;
|
sls_detector_module *myMod=NULL;
|
||||||
int* g=0; int* o=0;
|
int* gainval=0; int* offsetval=0;
|
||||||
|
if(thisDetector->nGain){
|
||||||
|
gainval=new int[thisDetector->nGain];
|
||||||
|
for(int i=0;i<thisDetector->nGain;i++)
|
||||||
|
gainval[i] = -1;
|
||||||
|
}
|
||||||
|
if(thisDetector->nOffset){
|
||||||
|
offsetval=new int[thisDetector->nOffset];
|
||||||
|
for(int i=0;i<thisDetector->nOffset;i++)
|
||||||
|
offsetval[i] = -1;
|
||||||
|
}
|
||||||
string fn=fname;
|
string fn=fname;
|
||||||
fn=fname;
|
fn=fname;
|
||||||
int mmin=0, mmax=setNumberOfModules();
|
int mmin=0, mmax=setNumberOfModules();
|
||||||
@ -6012,8 +6018,10 @@ int slsDetector::loadSettingsFile(string fname, int imod) {
|
|||||||
//settings is saved in myMod.reg for all except mythen
|
//settings is saved in myMod.reg for all except mythen
|
||||||
if(thisDetector->myDetectorType!=MYTHEN)
|
if(thisDetector->myDetectorType!=MYTHEN)
|
||||||
myMod->reg=thisDetector->currentSettings;
|
myMod->reg=thisDetector->currentSettings;
|
||||||
setModule(*myMod,g,o);
|
setModule(*myMod,gainval,offsetval);
|
||||||
deleteModule(myMod);
|
deleteModule(myMod);
|
||||||
|
if(gainval) delete[] gainval;
|
||||||
|
if(offsetval) delete[] offsetval;
|
||||||
} else
|
} else
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
@ -6090,19 +6098,20 @@ int slsDetector::loadCalibrationFile(string fname, int imod) {
|
|||||||
sls_detector_module *myMod=NULL;
|
sls_detector_module *myMod=NULL;
|
||||||
string fn=fname;
|
string fn=fname;
|
||||||
|
|
||||||
int* gainval=0, *offsetval=0;
|
int* gainval=0; int* offsetval=0;
|
||||||
if(thisDetector->nGain)
|
if(thisDetector->nGain){
|
||||||
gainval=new int[thisDetector->nGain];
|
gainval=new int[thisDetector->nGain];
|
||||||
if(thisDetector->nOffset)
|
for(int i=0;i<thisDetector->nGain;i++)
|
||||||
|
gainval[i] = -1;
|
||||||
|
}
|
||||||
|
if(thisDetector->nOffset){
|
||||||
offsetval=new int[thisDetector->nOffset];
|
offsetval=new int[thisDetector->nOffset];
|
||||||
|
for(int i=0;i<thisDetector->nOffset;i++)
|
||||||
|
offsetval[i] = -1;
|
||||||
|
}
|
||||||
|
|
||||||
fn=fname;
|
fn=fname;
|
||||||
|
|
||||||
if(thisDetector->nGain)
|
|
||||||
gainval = new int[thisDetector->nGain];
|
|
||||||
if(thisDetector->nOffset)
|
|
||||||
offsetval = new int[thisDetector->nOffset];
|
|
||||||
|
|
||||||
|
|
||||||
int mmin=0, mmax=setNumberOfModules();
|
int mmin=0, mmax=setNumberOfModules();
|
||||||
if (imod>=0) {
|
if (imod>=0) {
|
||||||
@ -6135,7 +6144,7 @@ int slsDetector::loadCalibrationFile(string fname, int imod) {
|
|||||||
|
|
||||||
deleteModule(myMod);
|
deleteModule(myMod);
|
||||||
if(gainval) delete[]gainval;
|
if(gainval) delete[]gainval;
|
||||||
if(offsetval) delete offsetval;
|
if(offsetval) delete[] offsetval;
|
||||||
} else
|
} else
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user