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

@ -254,7 +254,7 @@ enum dacIndex {
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 */
HV_POT, /**< gotthard, chiptest board high voltage */
G_VREF_DS, /**< gotthard */
G_VCASCN_PB, /**< gotthard */
G_VCASCP_PB, /**< gotthard */
@ -262,7 +262,8 @@ enum dacIndex {
G_VCASC_OUT, /**< gotthard */
G_VIN_CM, /**< 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++;
}
//---------------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

@ -2643,8 +2643,6 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
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,10 +2676,16 @@ 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);
/*
switch(thisDetector->myDetectorType){
case GOTTHARD:
break;
default:
if (thisDetector->correctionMask&(1<<RATE_CORRECTION)) {
int isett=getSettings(imod);
float t[]=defaultTDead;
@ -2689,8 +2693,7 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
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;