From 9f85175dce2ed9b116abf1fa9d94284a40ce2534 Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Tue, 22 Nov 2011 17:55:17 +0000 Subject: [PATCH] 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 --- .../commonFiles/sls_detector_defs.h | 43 ++++++++++--------- .../gotthardDetector/gotthardDetector.cpp | 4 +- .../slsDetector/slsDetector.cpp | 29 +++++++------ slsDetectorSoftware/slsDetector/slsDetector.h | 14 ++++-- 4 files changed, 50 insertions(+), 40 deletions(-) diff --git a/slsDetectorSoftware/commonFiles/sls_detector_defs.h b/slsDetectorSoftware/commonFiles/sls_detector_defs.h index e39c904c4..f9c2a7aee 100755 --- a/slsDetectorSoftware/commonFiles/sls_detector_defs.h +++ b/slsDetectorSoftware/commonFiles/sls_detector_defs.h @@ -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 */ }; /** diff --git a/slsDetectorSoftware/gotthardDetector/gotthardDetector.cpp b/slsDetectorSoftware/gotthardDetector/gotthardDetector.cpp index d5d873784..f93605759 100644 --- a/slsDetectorSoftware/gotthardDetector/gotthardDetector.cpp +++ b/slsDetectorSoftware/gotthardDetector/gotthardDetector.cpp @@ -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); diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index 4833ca367..9b0fd752e 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -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<calDir <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 "<confGain,G_CONF_GAIN); + } } deleteModule(myMod); - /* - if (thisDetector->correctionMask&(1<-1 && isett<3) { - thisDetector->tDead=t[isett]; + switch(thisDetector->myDetectorType){ + case GOTTHARD: + break; + default: + if (thisDetector->correctionMask&(1<-1 && isett<3) { + thisDetector->tDead=t[isett]; } + } } - */ - return getSettings(imod); }; diff --git a/slsDetectorSoftware/slsDetector/slsDetector.h b/slsDetectorSoftware/slsDetector/slsDetector.h index c84c0fbcd..f4be796e8 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.h +++ b/slsDetectorSoftware/slsDetector/slsDetector.h @@ -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;