adding conf gain member to sls detector and change a bit in setSettings to read this back

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@60 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2011-11-22 17:55:17 +00:00
parent 7de31bbe93
commit 9f85175dce
4 changed files with 50 additions and 40 deletions

View File

@ -240,29 +240,30 @@ enum analogTestMode {
detector dacs indexes
*/
enum dacIndex {
THRESHOLD, /**< comparator threshold level */
THRESHOLD, /**< comparator threshold level */
CALIBRATION_PULSE, /**< calibration input pulse height */
TRIMBIT_SIZE, /**< voltage to determine the trimbits LSB */
PREAMP, /**< preamp feedback */
SHAPER1, /**< shaper1 feedback */
SHAPER2, /**< shaper2 feedback */
TEMPERATURE_ADC, /**< temperature sensor (adc) */
TRIMBIT_SIZE, /**< voltage to determine the trimbits LSB */
PREAMP, /**< preamp feedback */
SHAPER1, /**< shaper1 feedback */
SHAPER2, /**< shaper2 feedback */
TEMPERATURE_ADC, /**< temperature sensor (adc) */
TEMPERATURE_FPGA, /**< temperature sensor (fpga) */
HUMIDITY, /**< humidity sensor (adc) */
DETECTOR_BIAS, /**< detector bias */
VA_POT, /**< power supply va */
VDD_POT, /**< chiptest board power supply vdd */
VSH_POT, /**< chiptest board power supply vsh */
VIO_POT, /**< chiptest board power supply va */
HV_POT, /**< Gotthard, chiptest board high voltage */
G_VREF_DS, /**< gotthard */
G_VCASCN_PB, /**< gotthard */
G_VCASCP_PB, /**< gotthard */
G_VOUT_CM, /**< gotthard */
G_VCASC_OUT, /**< gotthard */
G_VIN_CM, /**< gotthard */
G_VREF_COMP, /**< gotthard */
G_IB_TESTC /**< gotthard */
HUMIDITY, /**< humidity sensor (adc) */
DETECTOR_BIAS,/**< detector bias */
VA_POT, /**< power supply va */
VDD_POT, /**< chiptest board power supply vdd */
VSH_POT, /**< chiptest board power supply vsh */
VIO_POT, /**< chiptest board power supply va */
HV_POT, /**< gotthard, chiptest board high voltage */
G_VREF_DS, /**< gotthard */
G_VCASCN_PB, /**< gotthard */
G_VCASCP_PB, /**< gotthard */
G_VOUT_CM, /**< gotthard */
G_VCASC_OUT, /**< gotthard */
G_VIN_CM, /**< gotthard */
G_VREF_COMP, /**< gotthard */
G_IB_TESTC, /**< gotthard */
G_CONF_GAIN /**< gotthard gain for the dacs */
};
/**

View File

@ -402,7 +402,7 @@ int gotthardDetector::retrieveDetectorSetup(string fname1, int level){
idac++;
}
//---------------config---------------
//---------------gain---------------
getline(infile,str);
iline++;
#ifdef VERBOSE
@ -413,7 +413,7 @@ int gotthardDetector::retrieveDetectorSetup(string fname1, int level){
#ifdef VERBOSE
std::cout<< sargname << " is " << ival << std::endl;
#endif
int configval = ival;//myMod->dacs[idac]=ival;
thisDetector->confGain = ival;
//---------------mac address----------
getline(infile,str);

View File

@ -2567,7 +2567,7 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
detectorSettings slsDetector::setSettings( detectorSettings isettings, int imod){
detectorSettings slsDetector::setSettings( detectorSettings isettings, int imod){
#ifdef VERBOSE
std::cout<< "slsDetector setSettings "<< std::endl;
#endif
@ -2578,7 +2578,7 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
detectorSettings minsettings, maxsettings;
switch(thisDetector->myDetectorType){
case GOTTHARD:
case GOTTHARD:
minsettings = HIGHGAIN;
maxsettings = GAIN3;
break;
@ -2638,13 +2638,11 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
#ifdef VERBOSE
std::cout<< thisDetector->settingsDir<<endl<< thisDetector->calDir <<endl;
#endif
break;
break;
default:
ostfn << thisDetector->settingsDir << ssettings <<"/noise.sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im) << setbase(10);
oscfn << thisDetector->calDir << ssettings << "/calibration.sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im) << setbase(10);
}
//oscfn << thisDetector->calDir << ssettings << "/calibration.sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im) << setbase(10);
settingsfname=ostfn.str();
#ifdef VERBOSE
cout << "the settings name is "<<settingsfname << endl;
@ -2678,19 +2676,24 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
setModule(*myMod);
}
}
//all mods set gain here
setDAC(thisDetector->confGain,G_CONF_GAIN);
}
}
deleteModule(myMod);
/*
if (thisDetector->correctionMask&(1<<RATE_CORRECTION)) {
int isett=getSettings(imod);
float t[]=defaultTDead;
if (isett>-1 && isett<3) {
thisDetector->tDead=t[isett];
switch(thisDetector->myDetectorType){
case GOTTHARD:
break;
default:
if (thisDetector->correctionMask&(1<<RATE_CORRECTION)) {
int isett=getSettings(imod);
float t[]=defaultTDead;
if (isett>-1 && isett<3) {
thisDetector->tDead=t[isett];
}
}
}
*/
return getSettings(imod);
};

View File

@ -149,10 +149,6 @@ typedef struct sharedSlsDetector {
/** is the hostname (or IP address) of the detector. needs to be set before startin the communication */
char hostname[MAX_STR_LENGTH];
/** is the ip address of the client for gotthard to send data to **/
char clientIPAddress[MAX_STR_LENGTH];
/** is the mac address of the client for gotthard to send data to **/
char clientMacAddress[MAX_STR_LENGTH];
/** is the port used for control functions normally it should not be changed*/
int controlPort;
@ -303,6 +299,16 @@ typedef struct sharedSlsDetector {
/** memory offsets for the channel register arrays */
int chanoff;
/*extra gotthard members*/
/** is the ip address of the client for gotthard; read from settings file **/
char clientIPAddress[MAX_STR_LENGTH];
/** is the mac address of the client for gotthard; read from settings file **/
char clientMacAddress[MAX_STR_LENGTH];
/** gain for gotthard read from settings file**/
int confGain;
} sharedSlsDetector;