mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
settings for jungfrau
This commit is contained in:
@ -364,6 +364,11 @@ enum detectorSettings{
|
|||||||
MEDIUMGAIN, /**< medium gain settings */
|
MEDIUMGAIN, /**< medium gain settings */
|
||||||
VERYHIGHGAIN, /**< very high gain settings */
|
VERYHIGHGAIN, /**< very high gain settings */
|
||||||
LOWNOISE, /**< low noise settings */
|
LOWNOISE, /**< low noise settings */
|
||||||
|
DYNAMICHG0, /**< dynamic high gain 0 */
|
||||||
|
FIXGAIN1, /**< fix gain 1 */
|
||||||
|
FIXGAIN2, /**< fix gain 2 */
|
||||||
|
FORCESWITCHG1, /**< force switch gain 1 */
|
||||||
|
FORCESWITCHG2, /**< force switch gain 2 */
|
||||||
UNDEFINED, /**< undefined or custom settings */
|
UNDEFINED, /**< undefined or custom settings */
|
||||||
UNINITIALIZED /**< uninitialiazed (status at startup) */
|
UNINITIALIZED /**< uninitialiazed (status at startup) */
|
||||||
};
|
};
|
||||||
|
@ -1576,37 +1576,19 @@ int initHighVoltage(int val, int imod){
|
|||||||
|
|
||||||
int initConfGain(int isettings,int val,int imod){
|
int initConfGain(int isettings,int val,int imod){
|
||||||
int retval;
|
int retval;
|
||||||
u_int32_t addr=GAIN_REG;
|
u_int32_t addr=CONFGAIN_REG;
|
||||||
|
|
||||||
if(val!=-1){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
printf("Setting Gain of module:%d with val:%d\n",imod,val);
|
|
||||||
#endif
|
|
||||||
bus_w(addr,((val<<GAIN_OFFSET)|(bus_r(addr)&~GAIN_MASK)));
|
|
||||||
}
|
|
||||||
retval=(bus_r(addr)&GAIN_MASK);
|
|
||||||
#ifdef VERBOSE
|
|
||||||
printf("Value read from Gain reg is %d\n",retval);
|
|
||||||
#endif
|
|
||||||
if((val!=-1)&&(retval!=val))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if(isettings!=-1){
|
if(isettings!=-1){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Writing Settings of module:%d with val:%d\n",imod,isettings);
|
printf("Setting Gain of module:%d with val:%d\n",imod,val);
|
||||||
#endif
|
#endif
|
||||||
bus_w(addr,((isettings<<SETTINGS_OFFSET)|(bus_r(addr)&~SETTINGS_MASK)));
|
bus_w(addr,val);
|
||||||
}
|
}
|
||||||
retval=((bus_r(addr)&SETTINGS_MASK)>>SETTINGS_OFFSET);
|
retval=(bus_r(addr));
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Settings read from reg is %d\n",retval);
|
printf("Value read from Gain reg is %d\n",retval);
|
||||||
#endif
|
#endif
|
||||||
if((isettings!=-1)&&(retval!=isettings)){
|
return retval;
|
||||||
printf("\n\nSettings r\n\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -847,38 +847,51 @@ int setSettings(int i, int imod) {
|
|||||||
else
|
else
|
||||||
printf("\ninside set settings wit settings=%d...\n",i);
|
printf("\ninside set settings wit settings=%d...\n",i);
|
||||||
#endif
|
#endif
|
||||||
int confgain[] = CONF_GAIN;
|
int isett=-1,val=-1,retval=-1;
|
||||||
int isett=-2,retval;
|
enum conf_gain {
|
||||||
|
dynamic = 0x0f00, //dynamic
|
||||||
|
dynamichighgain0 = 0x0f01, //dynamichighgain0
|
||||||
|
fixgain1 = 0x0f02, //fixgain1
|
||||||
|
fixgain2 = 0x0f06, //fixgain2
|
||||||
|
forceswitchgain1 = 0x1f00, //forceswitchgain1
|
||||||
|
forceswitchgain2 = 0x3f00 //forceswitchgain2
|
||||||
|
};
|
||||||
|
|
||||||
//reading settings
|
//determine conf value to write
|
||||||
if(i==GET_SETTINGS){
|
if(i!=GET_SETTINGS){
|
||||||
retval=initConfGainByModule(i,i,imod);
|
switch(i){
|
||||||
if(retval==i)
|
case DYNAMICGAIN: val = dynamic;break;
|
||||||
isett=UNDEFINED;
|
case DYNAMICHG0: val = dynamichighgain0;break;
|
||||||
}
|
case FIXGAIN1: val = fixgain1;break;
|
||||||
//writing settings
|
case FIXGAIN2: val = fixgain2;break;
|
||||||
else{
|
case FORCESWITCHG1: val = forceswitchgain1;break;
|
||||||
retval=initConfGainByModule(i,confgain[i],imod);
|
case FORCESWITCHG2: val = forceswitchgain2;break;
|
||||||
if(retval!=i)
|
default:
|
||||||
isett=UNDEFINED;
|
printf("Error: This settings is not defined for this detector %d\n",i);
|
||||||
}
|
return GET_SETTINGS;
|
||||||
//if error while read/writing
|
}
|
||||||
if(isett==UNDEFINED)
|
}
|
||||||
printf("Error:Weird Value read back from the Gain/Settings Reg\n");
|
|
||||||
else{
|
retval=initConfGainByModule(i,val,imod);
|
||||||
//validating the settings read back
|
|
||||||
if((retval>=HIGHGAIN)&&(retval<=VERYHIGHGAIN))
|
switch(retval){
|
||||||
isett=retval;
|
case dynamic: isett=DYNAMICGAIN; break;
|
||||||
else{
|
case dynamichighgain0: isett=DYNAMICHG0; break;
|
||||||
isett=UNDEFINED;
|
case fixgain1: isett=FIXGAIN1; break;
|
||||||
printf("Error:Wrong Settings Read out:%d\n",retval);
|
case fixgain2: isett=FIXGAIN2; break;
|
||||||
}
|
case forceswitchgain1: isett=FORCESWITCHG1; break;
|
||||||
}
|
case forceswitchgain2: isett=FORCESWITCHG2; break;
|
||||||
thisSettings=isett;
|
default:
|
||||||
|
isett=UNDEFINED;
|
||||||
|
printf("Error:Wrong settings read out from Gain Reg 0x%x\n",retval);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
thisSettings=isett;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("detector settings are %d\n",thisSettings);
|
printf("detector settings are %d\n",thisSettings);
|
||||||
#endif
|
#endif
|
||||||
return thisSettings;
|
return thisSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1530,7 +1543,8 @@ int initModulebyNumber(sls_detector_module myMod) {
|
|||||||
int imod;
|
int imod;
|
||||||
// int obe;
|
// int obe;
|
||||||
// int ow;
|
// int ow;
|
||||||
int v[NDAC];
|
/* int v[NDAC];*/
|
||||||
|
int retval =-1, idac;
|
||||||
|
|
||||||
|
|
||||||
nchip=myMod.nchip;
|
nchip=myMod.nchip;
|
||||||
@ -1559,7 +1573,7 @@ int initModulebyNumber(sls_detector_module myMod) {
|
|||||||
v[idac]=(myMod.dacs)[idac];
|
v[idac]=(myMod.dacs)[idac];
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
v[VDAC0]=(myMod.dacs)[0];
|
v[VDAC0]=(myMod.dacs)[0];
|
||||||
v[VDAC1]=(myMod.dacs)[1];
|
v[VDAC1]=(myMod.dacs)[1];
|
||||||
v[VDAC2]=(myMod.dacs)[2];
|
v[VDAC2]=(myMod.dacs)[2];
|
||||||
@ -1580,11 +1594,19 @@ int initModulebyNumber(sls_detector_module myMod) {
|
|||||||
printf("vdac6=%d\n",v[VDAC6]);
|
printf("vdac6=%d\n",v[VDAC6]);
|
||||||
printf("vdac7=%d\n",v[VDAC7]);
|
printf("vdac7=%d\n",v[VDAC7]);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
// initDACs(v,imod);
|
// initDACs(v,imod);
|
||||||
// initMCBregisters(myMod.reg,imod);
|
// initMCBregisters(myMod.reg,imod);
|
||||||
|
|
||||||
|
for (idac=0; idac<NDAC; idac++){
|
||||||
|
retval = setDac(idac,(myMod.dacs)[idac]);
|
||||||
|
if(retval ==(myMod.dacs)[idac])
|
||||||
|
printf("Setting dac % to %d\n",idac,retval);
|
||||||
|
else
|
||||||
|
printf("Error: Could not set dac %d, wrote %d but read %d\n",idac,(myMod.dacs)[idac],retval);
|
||||||
|
}
|
||||||
|
|
||||||
if (detectorModules) {
|
if (detectorModules) {
|
||||||
for (im=modmi; im<modma; im++) {
|
for (im=modmi; im<modma; im++) {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@ -1597,7 +1619,7 @@ int initModulebyNumber(sls_detector_module myMod) {
|
|||||||
//setting the conf gain and the settings register
|
//setting the conf gain and the settings register
|
||||||
setSettings(myMod.reg,imod);
|
setSettings(myMod.reg,imod);
|
||||||
|
|
||||||
return myMod.reg;
|
return thisSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
#define RGSH1VALS {300,200,400}
|
#define RGSH1VALS {300,200,400}
|
||||||
#define RGSH2VALS {260,300,260}
|
#define RGSH2VALS {260,300,260}
|
||||||
|
|
||||||
//high,dynamic,low,medium,very high
|
|
||||||
#define CONF_GAIN {0,0, 0, 1, 6, 2, 1}//dynamic gain confgain yet to be figured out-probably 8 or 16
|
|
||||||
|
|
||||||
|
|
||||||
#define DEFAULTGAIN {11.66,9.32,14.99}
|
#define DEFAULTGAIN {11.66,9.32,14.99}
|
||||||
#define DEFAULTOFFSET {817.5,828.6,804.2}
|
#define DEFAULTOFFSET {817.5,828.6,804.2}
|
||||||
|
@ -19,7 +19,20 @@
|
|||||||
#define FPGA_INIT_PAT 0x60008
|
#define FPGA_INIT_PAT 0x60008
|
||||||
#define FPGA_INIT_ADDR 0xb0000000
|
#define FPGA_INIT_ADDR 0xb0000000
|
||||||
|
|
||||||
|
#ifdef JUNGFRAU_DHANYA
|
||||||
|
#define POWER_ON_REG 0x5e<<11
|
||||||
|
#define ADCREG1 0x08
|
||||||
|
#define ADCREG2 0x14
|
||||||
|
#define ADCREG3 0x4
|
||||||
|
#define ADCREG4 0x5
|
||||||
|
#define ADCREG_VREFS 0x18
|
||||||
|
#define ADC_INVERSION_REG 0x43<<11
|
||||||
|
#define ADC_PIPELINE_REG 0x42<<11
|
||||||
|
#define DBIT_PIPELINE_REG 0x59<<11
|
||||||
|
#define MEM_MACHINE_FIFOS_REG 0x4f<<11
|
||||||
|
#define CONFGAIN_REG 0x5d<<11 /** was actually GAIN_REG which seems to be set to 0 later in this file*/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* constant FPGAVersionReg_c : integer:= 0; */
|
/* constant FPGAVersionReg_c : integer:= 0; */
|
||||||
|
@ -139,7 +139,7 @@ int init_detector(int b, int checkType) {
|
|||||||
// setSettings(GET_SETTINGS,-1);
|
// setSettings(GET_SETTINGS,-1);
|
||||||
|
|
||||||
initDac(0); initDac(8); //initializes the two dacs
|
initDac(0); initDac(8); //initializes the two dacs
|
||||||
|
|
||||||
//Initialization
|
//Initialization
|
||||||
setFrames(-1);
|
setFrames(-1);
|
||||||
setTrains(-1);
|
setTrains(-1);
|
||||||
@ -160,6 +160,70 @@ int init_detector(int b, int checkType) {
|
|||||||
// getDynamicRange();
|
// getDynamicRange();
|
||||||
setROI(-1,NULL,&retvalsize,&ret);
|
setROI(-1,NULL,&retvalsize,&ret);
|
||||||
allocateRAM();
|
allocateRAM();
|
||||||
|
|
||||||
|
#ifdef JUNGFRAU_DHANYA
|
||||||
|
if(myDetectorType==JUNGFRAU){
|
||||||
|
//set dacs
|
||||||
|
int retval = -1;
|
||||||
|
int dacvalues[14][2]={
|
||||||
|
{0, 1250}, //vout_cm
|
||||||
|
{10, 1053}, //vin_com
|
||||||
|
{1, 600}, //vb_sda
|
||||||
|
{11, 1000}, //vb_colbuf
|
||||||
|
{2, 3000}, //vb_test_cur
|
||||||
|
{3, 830}, //vcascp_pixbuf
|
||||||
|
{4, 1630}, //vcascn_pixbuf
|
||||||
|
{12, 750}, //vb_pixbuf
|
||||||
|
{6, 480}, //vref_ds
|
||||||
|
{5, 1000}, //vb_ds
|
||||||
|
{7, 400}, //vref_comp
|
||||||
|
{13, 1220}, //vb_comp
|
||||||
|
{8, 1500}, //vref_prech
|
||||||
|
{9, 3000}, //vdd_prot
|
||||||
|
};
|
||||||
|
for(i=0;i<14;++i){
|
||||||
|
retval=setDac(dacvalues[i][0], dacvalues[i][1]);
|
||||||
|
if(retval!=dacvalues[i][1])
|
||||||
|
printf("Error: Setting dac %d failed, wrote %d, read %d\n",dacvalues[i][0],dacvalues[i][1],retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
//power on the chips
|
||||||
|
bus_w(POWER_ON_REG,0x1);
|
||||||
|
|
||||||
|
//reset adc
|
||||||
|
writeADC(ADCREG1,0x3); writeADC(ADCREG1,0x0);
|
||||||
|
writeADC(ADCREG2,0x40);
|
||||||
|
writeADC(ADCREG3,0xf);
|
||||||
|
writeADC(ADCREG4,0x3f);
|
||||||
|
//vrefs - configurable?
|
||||||
|
writeADC(ADCREG_VREFS,0x2);
|
||||||
|
|
||||||
|
|
||||||
|
//set ADCINVERSionreg (by trial and error)
|
||||||
|
bus_w(ADC_INVERSION_REG,0x453b2a9c);
|
||||||
|
|
||||||
|
//set adc_pipeline
|
||||||
|
bus_w(ADC_PIPELINE_REG,0x20);
|
||||||
|
|
||||||
|
//set dbit_pipeline
|
||||||
|
bus_w(DBIT_PIPELINE_REG,0x100e);
|
||||||
|
usleep(1000000);//1s
|
||||||
|
|
||||||
|
//reset mem machine fifos fifos
|
||||||
|
bus_w(MEM_MACHINE_FIFOS_REG,0x4000);
|
||||||
|
bus_w(MEM_MACHINE_FIFOS_REG,0x0);
|
||||||
|
|
||||||
|
//reset run control
|
||||||
|
bus_w(MEM_MACHINE_FIFOS_REG,0x0400);
|
||||||
|
bus_w(MEM_MACHINE_FIFOS_REG,0x0);
|
||||||
|
|
||||||
|
//set default setting
|
||||||
|
setSettings(DYNAMICGAIN,-1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -955,7 +1019,7 @@ int read_register(int file_des) {
|
|||||||
|
|
||||||
int set_dac(int file_des) {
|
int set_dac(int file_des) {
|
||||||
//default:all mods
|
//default:all mods
|
||||||
int retval, retval1;
|
int retval, retval1;
|
||||||
int ret=OK;
|
int ret=OK;
|
||||||
int arg[3];
|
int arg[3];
|
||||||
enum dacIndex ind;
|
enum dacIndex ind;
|
||||||
@ -989,8 +1053,8 @@ int set_dac(int file_des) {
|
|||||||
if (imod<0)
|
if (imod<0)
|
||||||
imod=ALLMOD;
|
imod=ALLMOD;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef MCB_FUNCS
|
#ifdef MCB_FUNCS
|
||||||
|
|
||||||
@ -999,66 +1063,67 @@ int set_dac(int file_des) {
|
|||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
sprintf(mess,"Detector locked by %s\n",lastClientIP);
|
sprintf(mess,"Detector locked by %s\n",lastClientIP);
|
||||||
} else{
|
} else{
|
||||||
|
|
||||||
if (ind<16) {
|
|
||||||
|
|
||||||
if (mV) {
|
if (ind<16) {
|
||||||
if (val>2500)
|
|
||||||
val=-1;
|
|
||||||
printf("%d mV is ",val);
|
|
||||||
if (val>0)
|
|
||||||
val=4095*val/2500;
|
|
||||||
printf("%d DACu\n", val);
|
|
||||||
} else if (val>4095)
|
|
||||||
val=-1;
|
|
||||||
|
|
||||||
|
|
||||||
retval=setDac(ind,val);
|
|
||||||
/* if(idac==HIGH_VOLTAGE) */
|
|
||||||
/* retval=initHighVoltageByModule(val,imod); */
|
|
||||||
/* else */
|
|
||||||
/* retval=initDACbyIndexDACU(idac,val,imod); */
|
|
||||||
}
|
|
||||||
else if (ind==ADC_VPP) {
|
|
||||||
printf("Setting ADC VPP to %d\n",val);
|
|
||||||
if (val>4 || val<0)
|
|
||||||
printf("Cannot set ADC VPP to %d\n",val);
|
|
||||||
else {
|
|
||||||
writeADC(0x18,val);
|
|
||||||
adcvpp=val;
|
|
||||||
}
|
|
||||||
retval=adcvpp;;
|
|
||||||
|
|
||||||
}
|
if (mV) {
|
||||||
|
if (val>2500)
|
||||||
|
val=-1;
|
||||||
|
printf("%d mV is ",val);
|
||||||
|
if (val>0)
|
||||||
|
val=4095*val/2500;
|
||||||
|
printf("%d DACu\n", val);
|
||||||
|
} else if (val>4095)
|
||||||
|
val=-1;
|
||||||
|
|
||||||
|
|
||||||
|
retval=setDac(ind,val);
|
||||||
|
/* if(idac==HIGH_VOLTAGE) */
|
||||||
|
/* retval=initHighVoltageByModule(val,imod); */
|
||||||
|
/* else */
|
||||||
|
/* retval=initDACbyIndexDACU(idac,val,imod); */
|
||||||
|
}
|
||||||
|
else if (ind==ADC_VPP) {
|
||||||
|
printf("Setting ADC VPP to %d\n",val);
|
||||||
|
if (val>4 || val<0)
|
||||||
|
printf("Cannot set ADC VPP to %d\n",val);
|
||||||
|
else {
|
||||||
|
writeADC(0x18,val);
|
||||||
|
adcvpp=val;
|
||||||
|
}
|
||||||
|
retval=adcvpp;;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ret==OK){
|
if(ret==OK){
|
||||||
/* ret=FAIL; */
|
/* ret=FAIL; */
|
||||||
/* if(idac==HIGH_VOLTAGE){ */
|
/* if(idac==HIGH_VOLTAGE){ */
|
||||||
/* if(retval==-2) */
|
/* if(retval==-2) */
|
||||||
/* strcpy(mess,"Invalid Voltage.Valid values are 0,90,110,120,150,180,200"); */
|
/* strcpy(mess,"Invalid Voltage.Valid values are 0,90,110,120,150,180,200"); */
|
||||||
/* else if(retval==-3) */
|
/* else if(retval==-3) */
|
||||||
/* strcpy(mess,"Weird value read back or it has not been set yet\n"); */
|
/* strcpy(mess,"Weird value read back or it has not been set yet\n"); */
|
||||||
/* else */
|
/* else */
|
||||||
/* ret=OK; */
|
/* ret=OK; */
|
||||||
/* }//since v r saving only msb */
|
/* }//since v r saving only msb */
|
||||||
/* else if ((retval-val)<=3 || val==-1) */
|
/* else if ((retval-val)<=3 || val==-1) */
|
||||||
/* ret=OK; */
|
/* ret=OK; */
|
||||||
if (ind<16) {
|
if (ind<16) {
|
||||||
if (mV) {
|
if (mV) {
|
||||||
|
|
||||||
printf("%d DACu is ",retval);
|
printf("%d DACu is ",retval);
|
||||||
retval1=2500*retval/16535;
|
retval1=2500*retval/16535;
|
||||||
printf("%d mV \n",retval1);
|
printf("%d mV \n",retval1);
|
||||||
} else
|
} else
|
||||||
retval1=retval;
|
retval1=retval;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("DAC set to %d V\n", retval);
|
printf("DAC set to %d V\n", retval);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
if(ret==FAIL)
|
if(ret==FAIL)
|
||||||
printf("Setting dac %d of module %d: wrote %d but read %d\n", ind, imod, val, retval);
|
printf("Setting dac %d of module %d: wrote %d but read %d\n", ind, imod, val, retval);
|
||||||
else{
|
else{
|
||||||
@ -1433,8 +1498,8 @@ int set_module(int file_des) {
|
|||||||
sls_detector_module myModule;
|
sls_detector_module myModule;
|
||||||
int *myChip=malloc(NCHIP*sizeof(int));
|
int *myChip=malloc(NCHIP*sizeof(int));
|
||||||
int *myChan=malloc(NCHIP*NCHAN*sizeof(int));
|
int *myChan=malloc(NCHIP*NCHAN*sizeof(int));
|
||||||
int *myDac=malloc(NDAC*sizeof(int));/**dhanya*/
|
int *myDac=malloc(NDAC*sizeof(int));
|
||||||
int *myAdc=malloc(NADC*sizeof(int));/**dhanya*/
|
int *myAdc=malloc(NADC*sizeof(int));
|
||||||
int retval, n;
|
int retval, n;
|
||||||
int ret=OK;
|
int ret=OK;
|
||||||
int dr;// ow;
|
int dr;// ow;
|
||||||
@ -1503,6 +1568,8 @@ int set_module(int file_des) {
|
|||||||
} else {
|
} else {
|
||||||
#ifdef MCB_FUNCS
|
#ifdef MCB_FUNCS
|
||||||
retval=initModulebyNumber(myModule);
|
retval=initModulebyNumber(myModule);
|
||||||
|
if(retval != myModule.reg)
|
||||||
|
ret = FAIL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3128,6 +3128,7 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
|||||||
case DYNAMICGAIN:
|
case DYNAMICGAIN:
|
||||||
if ((thisDetector->myDetectorType == GOTTHARD) ||
|
if ((thisDetector->myDetectorType == GOTTHARD) ||
|
||||||
(thisDetector->myDetectorType == PROPIX) ||
|
(thisDetector->myDetectorType == PROPIX) ||
|
||||||
|
(thisDetector->myDetectorType == JUNGFRAU) ||
|
||||||
(thisDetector->myDetectorType == MOENCH)) {
|
(thisDetector->myDetectorType == MOENCH)) {
|
||||||
ssettings="/dynamicgain";
|
ssettings="/dynamicgain";
|
||||||
thisDetector->currentSettings=DYNAMICGAIN;
|
thisDetector->currentSettings=DYNAMICGAIN;
|
||||||
@ -3160,6 +3161,36 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
|||||||
break;
|
break;
|
||||||
case LOWNOISE:
|
case LOWNOISE:
|
||||||
break;
|
break;
|
||||||
|
case DYNAMICHG0:
|
||||||
|
if (thisDetector->myDetectorType == JUNGFRAU) {
|
||||||
|
ssettings="/dynamichg0";
|
||||||
|
thisDetector->currentSettings=DYNAMICHG0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FIXGAIN1:
|
||||||
|
if (thisDetector->myDetectorType == JUNGFRAU) {
|
||||||
|
ssettings="/fixgain1";
|
||||||
|
thisDetector->currentSettings=FIXGAIN1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FIXGAIN2:
|
||||||
|
if (thisDetector->myDetectorType == JUNGFRAU) {
|
||||||
|
ssettings="/fixgain2";
|
||||||
|
thisDetector->currentSettings=FIXGAIN2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FORCESWITCHG1:
|
||||||
|
if (thisDetector->myDetectorType == JUNGFRAU) {
|
||||||
|
ssettings="/forceswitchg1";
|
||||||
|
thisDetector->currentSettings=FORCESWITCHG1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FORCESWITCHG2:
|
||||||
|
if (thisDetector->myDetectorType == JUNGFRAU) {
|
||||||
|
ssettings="/forceswitchg2";
|
||||||
|
thisDetector->currentSettings=FORCESWITCHG2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3194,6 +3225,7 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
|||||||
case MOENCH:
|
case MOENCH:
|
||||||
case GOTTHARD:
|
case GOTTHARD:
|
||||||
case PROPIX:
|
case PROPIX:
|
||||||
|
case JUNGFRAU:
|
||||||
case JUNGFRAUCTB:
|
case JUNGFRAUCTB:
|
||||||
//settings is saved in myMod.reg
|
//settings is saved in myMod.reg
|
||||||
myMod->reg=thisDetector->currentSettings;
|
myMod->reg=thisDetector->currentSettings;
|
||||||
@ -3221,6 +3253,7 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
|||||||
case MOENCH:
|
case MOENCH:
|
||||||
case GOTTHARD:
|
case GOTTHARD:
|
||||||
case PROPIX:
|
case PROPIX:
|
||||||
|
case JUNGFRAU:
|
||||||
case JUNGFRAUCTB:
|
case JUNGFRAUCTB:
|
||||||
ostfn_default << thisDetector->settingsDir << ssettings << ssettings << ".settings";
|
ostfn_default << thisDetector->settingsDir << ssettings << ssettings << ".settings";
|
||||||
break;
|
break;
|
||||||
|
@ -638,37 +638,51 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
|
|||||||
return GET_EXTERNAL_SIGNAL_FLAG ;};
|
return GET_EXTERNAL_SIGNAL_FLAG ;};
|
||||||
|
|
||||||
/** returns detector settings string from index
|
/** returns detector settings string from index
|
||||||
\param s can be STANDARD, FAST, HIGHGAIN, DYNAMICGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN, GET_SETTINGS
|
\param s can be STANDARD, FAST, HIGHGAIN, DYNAMICGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN, LOWNOISE,
|
||||||
\returns standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain, undefined
|
DYNAMICHG0, FIXGAIN1, FIXGAIN2, FORCESWITCHG1, FORCESWITCHG2, GET_SETTINGS
|
||||||
|
\returns standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain, lownoise,
|
||||||
|
dynamichg0, fixgain1, fixgain2, forceswitchg1, forceswitchg2, undefined
|
||||||
*/
|
*/
|
||||||
static string getDetectorSettings(detectorSettings s){\
|
static string getDetectorSettings(detectorSettings s){\
|
||||||
switch(s) {\
|
switch(s) { \
|
||||||
case STANDARD: return string("standard");\
|
case STANDARD: return string("standard"); \
|
||||||
case FAST: return string("fast");\
|
case FAST: return string("fast"); \
|
||||||
case HIGHGAIN: return string("highgain");\
|
case HIGHGAIN: return string("highgain"); \
|
||||||
case DYNAMICGAIN: return string("dynamicgain"); \
|
case DYNAMICGAIN: return string("dynamicgain"); \
|
||||||
case LOWGAIN: return string("lowgain"); \
|
case LOWGAIN: return string("lowgain"); \
|
||||||
case MEDIUMGAIN: return string("mediumgain"); \
|
case MEDIUMGAIN: return string("mediumgain"); \
|
||||||
case VERYHIGHGAIN: return string("veryhighgain"); \
|
case VERYHIGHGAIN: return string("veryhighgain"); \
|
||||||
case LOWNOISE: return string("lownoise"); \
|
case LOWNOISE: return string("lownoise"); \
|
||||||
default: return string("undefined"); \
|
case DYNAMICHG0: return string("dynamichg0"); \
|
||||||
|
case FIXGAIN1: return string("fixgain1"); \
|
||||||
|
case FIXGAIN2: return string("fixgain2"); \
|
||||||
|
case FORCESWITCHG1: return string("forceswitchg1");\
|
||||||
|
case FORCESWITCHG2: return string("forceswitchg2");\
|
||||||
|
default: return string("undefined"); \
|
||||||
}};
|
}};
|
||||||
|
|
||||||
/** returns detector settings string from index
|
/** returns detector settings string from index
|
||||||
\param s can be standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain, undefined
|
\param s can be standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain, lownoise,
|
||||||
\returns setting index STANDARD, FAST, HIGHGAIN, DYNAMICGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN, GET_SETTINGS
|
dynamichg0, fixgain1, fixgain2, forceswitchg1, forceswitchg2, undefined
|
||||||
|
\returns setting index STANDARD, FAST, HIGHGAIN, DYNAMICGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN,LOWNOISE,
|
||||||
|
DYNAMICHG0, FIXGAIN1, FIXGAIN2, FORCESWITCHG1, FORCESWITCHG2, GET_SETTINGS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static detectorSettings getDetectorSettings(string s){ \
|
static detectorSettings getDetectorSettings(string s){ \
|
||||||
if (s=="standard") return STANDARD; \
|
if (s=="standard") return STANDARD; \
|
||||||
if (s=="fast") return FAST; \
|
if (s=="fast") return FAST; \
|
||||||
if (s=="highgain") return HIGHGAIN; \
|
if (s=="highgain") return HIGHGAIN; \
|
||||||
if (s=="dynamicgain") return DYNAMICGAIN; \
|
if (s=="dynamicgain") return DYNAMICGAIN; \
|
||||||
if (s=="lowgain") return LOWGAIN; \
|
if (s=="lowgain") return LOWGAIN; \
|
||||||
if (s=="mediumgain") return MEDIUMGAIN; \
|
if (s=="mediumgain") return MEDIUMGAIN; \
|
||||||
if (s=="veryhighgain") return VERYHIGHGAIN; \
|
if (s=="veryhighgain") return VERYHIGHGAIN; \
|
||||||
if (s=="lownoise") return LOWNOISE; \
|
if (s=="lownoise") return LOWNOISE; \
|
||||||
return GET_SETTINGS; \
|
if (s=="dynamichg0") return DYNAMICHG0; \
|
||||||
|
if (s=="fixgain1") return FIXGAIN1; \
|
||||||
|
if (s=="fixgain2") return FIXGAIN2; \
|
||||||
|
if (s=="forceswitchg2") return FORCESWITCHG1; \
|
||||||
|
if (s=="lownoise") return FORCESWITCHG2; \
|
||||||
|
return GET_SETTINGS; \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -215,6 +215,24 @@ slsDetectorDefs::sls_detector_module* energyConversion::readSettingsFile(string
|
|||||||
break;
|
break;
|
||||||
case EIGER:
|
case EIGER:
|
||||||
break;
|
break;
|
||||||
|
case JUNGFRAU:
|
||||||
|
names[id++]="VDAC0";
|
||||||
|
names[id++]="VDAC1";
|
||||||
|
names[id++]="VDAC2";
|
||||||
|
names[id++]="VDAC3";
|
||||||
|
names[id++]="VDAC4";
|
||||||
|
names[id++]="VDAC5";
|
||||||
|
names[id++]="VDAC6";
|
||||||
|
names[id++]="VDAC7";
|
||||||
|
names[id++]="VDAC8";
|
||||||
|
names[id++]="VDAC9";
|
||||||
|
names[id++]="VDAC10";
|
||||||
|
names[id++]="VDAC11";
|
||||||
|
names[id++]="VDAC12";
|
||||||
|
names[id++]="VDAC13";
|
||||||
|
names[id++]="VDAC14";
|
||||||
|
names[id++]="VDAC15";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
cout << "Unknown detector type - unknown format for settings file" << endl;
|
cout << "Unknown detector type - unknown format for settings file" << endl;
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -359,6 +377,7 @@ slsDetectorDefs::sls_detector_module* energyConversion::readSettingsFile(string
|
|||||||
case MOENCH:
|
case MOENCH:
|
||||||
case GOTTHARD:
|
case GOTTHARD:
|
||||||
case PROPIX:
|
case PROPIX:
|
||||||
|
case JUNGFRAU:
|
||||||
//---------------dacs---------------
|
//---------------dacs---------------
|
||||||
infile.open(myfname.c_str(), ios_base::in);
|
infile.open(myfname.c_str(), ios_base::in);
|
||||||
if (infile.is_open()) {
|
if (infile.is_open()) {
|
||||||
@ -458,6 +477,24 @@ int energyConversion::writeSettingsFile(string fname, detectorType myDetectorTyp
|
|||||||
break;
|
break;
|
||||||
case EIGER:
|
case EIGER:
|
||||||
break;
|
break;
|
||||||
|
case JUNGFRAU:
|
||||||
|
names[id++]="VDAC0";
|
||||||
|
names[id++]="VDAC1";
|
||||||
|
names[id++]="VDAC2";
|
||||||
|
names[id++]="VDAC3";
|
||||||
|
names[id++]="VDAC4";
|
||||||
|
names[id++]="VDAC5";
|
||||||
|
names[id++]="VDAC6";
|
||||||
|
names[id++]="VDAC7";
|
||||||
|
names[id++]="VDAC8";
|
||||||
|
names[id++]="VDAC9";
|
||||||
|
names[id++]="VDAC10";
|
||||||
|
names[id++]="VDAC11";
|
||||||
|
names[id++]="VDAC12";
|
||||||
|
names[id++]="VDAC13";
|
||||||
|
names[id++]="VDAC14";
|
||||||
|
names[id++]="VDAC15";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
cout << "Unknown detector type - unknown format for settings file" << endl;
|
cout << "Unknown detector type - unknown format for settings file" << endl;
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
Reference in New Issue
Block a user