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 detector dacs indexes
*/ */
enum dacIndex { enum dacIndex {
THRESHOLD, /**< comparator threshold level */ THRESHOLD, /**< comparator threshold level */
CALIBRATION_PULSE, /**< calibration input pulse height */ CALIBRATION_PULSE, /**< calibration input pulse height */
TRIMBIT_SIZE, /**< voltage to determine the trimbits LSB */ TRIMBIT_SIZE, /**< voltage to determine the trimbits LSB */
PREAMP, /**< preamp feedback */ PREAMP, /**< preamp feedback */
SHAPER1, /**< shaper1 feedback */ SHAPER1, /**< shaper1 feedback */
SHAPER2, /**< shaper2 feedback */ SHAPER2, /**< shaper2 feedback */
TEMPERATURE_ADC, /**< temperature sensor (adc) */ TEMPERATURE_ADC, /**< temperature sensor (adc) */
TEMPERATURE_FPGA, /**< temperature sensor (fpga) */ TEMPERATURE_FPGA, /**< temperature sensor (fpga) */
HUMIDITY, /**< humidity sensor (adc) */ HUMIDITY, /**< humidity sensor (adc) */
DETECTOR_BIAS, /**< detector bias */ DETECTOR_BIAS,/**< detector bias */
VA_POT, /**< power supply va */ VA_POT, /**< power supply va */
VDD_POT, /**< chiptest board power supply vdd */ VDD_POT, /**< chiptest board power supply vdd */
VSH_POT, /**< chiptest board power supply vsh */ VSH_POT, /**< chiptest board power supply vsh */
VIO_POT, /**< chiptest board power supply va */ VIO_POT, /**< chiptest board power supply va */
HV_POT, /**< Gotthard, chiptest board high voltage */ HV_POT, /**< gotthard, chiptest board high voltage */
G_VREF_DS, /**< gotthard */ G_VREF_DS, /**< gotthard */
G_VCASCN_PB, /**< gotthard */ G_VCASCN_PB, /**< gotthard */
G_VCASCP_PB, /**< gotthard */ G_VCASCP_PB, /**< gotthard */
G_VOUT_CM, /**< gotthard */ G_VOUT_CM, /**< gotthard */
G_VCASC_OUT, /**< gotthard */ G_VCASC_OUT, /**< gotthard */
G_VIN_CM, /**< gotthard */ G_VIN_CM, /**< gotthard */
G_VREF_COMP, /**< gotthard */ G_VREF_COMP, /**< gotthard */
G_IB_TESTC /**< 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++; idac++;
} }
//---------------config--------------- //---------------gain---------------
getline(infile,str); getline(infile,str);
iline++; iline++;
#ifdef VERBOSE #ifdef VERBOSE
@ -413,7 +413,7 @@ int gotthardDetector::retrieveDetectorSetup(string fname1, int level){
#ifdef VERBOSE #ifdef VERBOSE
std::cout<< sargname << " is " << ival << std::endl; std::cout<< sargname << " is " << ival << std::endl;
#endif #endif
int configval = ival;//myMod->dacs[idac]=ival; thisDetector->confGain = ival;
//---------------mac address---------- //---------------mac address----------
getline(infile,str); 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 #ifdef VERBOSE
std::cout<< "slsDetector setSettings "<< std::endl; std::cout<< "slsDetector setSettings "<< std::endl;
#endif #endif
@ -2578,7 +2578,7 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
detectorSettings minsettings, maxsettings; detectorSettings minsettings, maxsettings;
switch(thisDetector->myDetectorType){ switch(thisDetector->myDetectorType){
case GOTTHARD: case GOTTHARD:
minsettings = HIGHGAIN; minsettings = HIGHGAIN;
maxsettings = GAIN3; maxsettings = GAIN3;
break; break;
@ -2638,13 +2638,11 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
#ifdef VERBOSE #ifdef VERBOSE
std::cout<< thisDetector->settingsDir<<endl<< thisDetector->calDir <<endl; std::cout<< thisDetector->settingsDir<<endl<< thisDetector->calDir <<endl;
#endif #endif
break; break;
default: default:
ostfn << thisDetector->settingsDir << ssettings <<"/noise.sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im) << setbase(10); 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);
} }
//oscfn << thisDetector->calDir << ssettings << "/calibration.sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im) << setbase(10);
settingsfname=ostfn.str(); settingsfname=ostfn.str();
#ifdef VERBOSE #ifdef VERBOSE
cout << "the settings name is "<<settingsfname << endl; cout << "the settings name is "<<settingsfname << endl;
@ -2678,19 +2676,24 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
setModule(*myMod); setModule(*myMod);
} }
} }
//all mods set gain here
setDAC(thisDetector->confGain,G_CONF_GAIN);
} }
} }
deleteModule(myMod); deleteModule(myMod);
/* switch(thisDetector->myDetectorType){
if (thisDetector->correctionMask&(1<<RATE_CORRECTION)) { case GOTTHARD:
int isett=getSettings(imod); break;
float t[]=defaultTDead; default:
if (isett>-1 && isett<3) { if (thisDetector->correctionMask&(1<<RATE_CORRECTION)) {
thisDetector->tDead=t[isett]; int isett=getSettings(imod);
float t[]=defaultTDead;
if (isett>-1 && isett<3) {
thisDetector->tDead=t[isett];
} }
}
} }
*/
return getSettings(imod); 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 */ /** is the hostname (or IP address) of the detector. needs to be set before startin the communication */
char hostname[MAX_STR_LENGTH]; 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*/ /** is the port used for control functions normally it should not be changed*/
int controlPort; int controlPort;
@ -303,6 +299,16 @@ typedef struct sharedSlsDetector {
/** memory offsets for the channel register arrays */ /** memory offsets for the channel register arrays */
int chanoff; 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; } sharedSlsDetector;