mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-24 02:27:59 +02:00
still updating slsdetector.cpp
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -32,8 +32,6 @@ typedef struct detParameterList {
|
||||
int nChipY;
|
||||
int nDacs;
|
||||
int nAdcs;
|
||||
int nGain;
|
||||
int nOffset;
|
||||
int dynamicRange;
|
||||
int nGappixelsX;
|
||||
int nGappixelsY;
|
||||
@ -112,12 +110,6 @@ private:
|
||||
/** number of adcs per module */
|
||||
int nAdcs;
|
||||
|
||||
/** number of extra gain values*/
|
||||
int nGain;
|
||||
|
||||
/** number of extra offset values */
|
||||
int nOffset;
|
||||
|
||||
/** dynamic range of the detector data */
|
||||
int dynamicRange;
|
||||
|
||||
@ -158,18 +150,9 @@ private:
|
||||
/** memory offsets for the adc arrays */
|
||||
int adcoff;
|
||||
|
||||
/** memory offsets for the chip register arrays */
|
||||
int chipoff;
|
||||
|
||||
/** memory offsets for the channel register arrays -trimbits*/
|
||||
int chanoff;
|
||||
|
||||
/** memory offsets for the gain register arrays */
|
||||
int gainoff;
|
||||
|
||||
/** memory offsets for the offset register arrays -trimbits*/
|
||||
int offsetoff;
|
||||
|
||||
/** ip address/hostname of the receiver for client control via TCP */
|
||||
char receiver_hostname[MAX_STR_LENGTH];
|
||||
|
||||
@ -622,12 +605,10 @@ public:
|
||||
* Writes a trim/settings file for module number
|
||||
* the values will be read from the current detector structure
|
||||
* @param fname name of the file to be written
|
||||
* @param iodelay io delay (detector specific)
|
||||
* @param tau tau (detector specific)
|
||||
* @returns OK or FAIL if the file could not be written
|
||||
* \sa ::sls_detector_module sharedSlsDetector mythenDetector::writeSettingsFile(string, int)
|
||||
*/
|
||||
int writeSettingsFile(std::string fname, int iodelay, int tau);
|
||||
int writeSettingsFile(std::string fname);
|
||||
|
||||
/**
|
||||
* Get detector settings
|
||||
@ -1073,11 +1054,11 @@ public:
|
||||
|
||||
/**
|
||||
* Gets counter memory block in detector (Gotthard)
|
||||
* @param arg counter memory block from detector
|
||||
* @param image counter memory block from detector
|
||||
* @param startACQ 1 to start acquisition afterwards, else 0
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int getCounterBlock(short int arg[],int startACQ=0);
|
||||
int getCounterBlock(short int image[],int startACQ=0);
|
||||
|
||||
/**
|
||||
* Resets counter in detector
|
||||
@ -1276,10 +1257,8 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
* Returns the trimbits from the detector's shared memmory (Mythen, Eiger)
|
||||
* Returns the trimbits from the detector's shared memmory (Eiger)
|
||||
* @param retval is the array with the trimbits
|
||||
* @param fromDetector is true if the trimbits shared memory have to be
|
||||
* uploaded from detector
|
||||
* @returns total number of channels for the detector
|
||||
*/
|
||||
int getChanRegs(double* retval,bool fromDetector);
|
||||
@ -1289,17 +1268,11 @@ public:
|
||||
* Called for loading trimbits and settings settings to the detector
|
||||
* @param module module to be set - must contain correct module number and
|
||||
* also channel and chip registers
|
||||
* @param iodelay iodelay (detector specific)
|
||||
* @param tau tau (detector specific)
|
||||
* @param e_eV threashold in eV (detector specific)
|
||||
* @param gainval pointer to extra gain values
|
||||
* @param offsetval pointer to extra offset values
|
||||
* @param tb 1 to include trimbits, 0 to exclude (used for eiger)
|
||||
* @returns ok or fail
|
||||
* \sa ::sls_detector_module
|
||||
*/
|
||||
int setModule(sls_detector_module module, int iodelay, int tau, int e_eV,
|
||||
int* gainval=0, int* offsetval=0, int tb=1);
|
||||
int setModule(sls_detector_module module, int tb = 1);
|
||||
|
||||
|
||||
/**
|
||||
@ -1308,14 +1281,6 @@ public:
|
||||
*/
|
||||
sls_detector_module *getModule();
|
||||
|
||||
/**
|
||||
* Calibrate Pedestal (ChipTestBoard)
|
||||
* Starts acquisition, calibrates pedestal and writes to fpga
|
||||
* @param frames number of frames
|
||||
* @returns number of frames
|
||||
*/
|
||||
int calibratePedestal(int frames = 0);
|
||||
|
||||
/**
|
||||
* Set Rate correction (Mythen, Eiger)
|
||||
* @param t dead time in ns - if 0 disable correction,
|
||||
@ -1323,19 +1288,19 @@ public:
|
||||
* for current settings
|
||||
* @returns 0 if rate correction disabled, >0 otherwise
|
||||
*/
|
||||
int setRateCorrection(int t=0);
|
||||
int setRateCorrection(int64_t t = 0);
|
||||
|
||||
/**
|
||||
* Get rate correction Eiger)
|
||||
* @returns 0 if rate correction disabled, > 0 otherwise
|
||||
*/
|
||||
int getRateCorrection();
|
||||
int64_t getRateCorrection();
|
||||
|
||||
/**
|
||||
* Prints receiver configuration
|
||||
* @returns OK or FAIL
|
||||
* #param level print level
|
||||
*/
|
||||
int printReceiverConfiguration();
|
||||
void printReceiverConfiguration(int level = logINFO);
|
||||
|
||||
/**
|
||||
* Checks if receiver is online and set flag
|
||||
@ -1824,28 +1789,21 @@ private:
|
||||
/**
|
||||
* reads a trim/settings file
|
||||
* @param fname name of the file to be read
|
||||
* @param iodelay io delay (detector specific)
|
||||
* @param tau tau (detector specific)
|
||||
* @param myMod pointer to the module structure which has to be set. <BR>
|
||||
* If it is NULL a new module structure will be created
|
||||
* @param tb 1 to include trimbits, 0 to exclude (used for eiger)
|
||||
* @returns the pointer to myMod or NULL if reading the file failed
|
||||
*/
|
||||
|
||||
sls_detector_module* readSettingsFile(std::string fname,
|
||||
int& iodelay, int& tau,
|
||||
sls_detector_module* myMod=NULL, int tb=1);
|
||||
sls_detector_module* readSettingsFile(std::string fname, sls_detector_module* myMod=NULL, int tb=1);
|
||||
|
||||
/**
|
||||
* writes a trim/settings file
|
||||
* @param fname name of the file to be written
|
||||
* @param mod module structure which has to be written to file
|
||||
* @param iodelay io delay (detector specific)
|
||||
* @param tau tau (detector specific)
|
||||
* @returns OK or FAIL if the file could not be written
|
||||
*/
|
||||
int writeSettingsFile(std::string fname,
|
||||
sls_detector_module mod, int iodelay, int tau);
|
||||
int writeSettingsFile(std::string fname, sls_detector_module mod);
|
||||
|
||||
|
||||
/** slsDetector Id or position in the detectors list */
|
||||
@ -1884,17 +1842,8 @@ private:
|
||||
/** pointer to adc valuse in shared memory */
|
||||
int *adcs;
|
||||
|
||||
/** pointer to chip registers in shared memory */
|
||||
int *chipregs;
|
||||
|
||||
/** pointer to channal registers in shared memory */
|
||||
int *chanregs;
|
||||
|
||||
/** pointer to gain values in shared memory */
|
||||
int *gain;
|
||||
|
||||
/** pointer to offset values in shared memory */
|
||||
int *offset;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -924,14 +924,6 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings;
|
||||
++i;
|
||||
|
||||
/*! \page settings
|
||||
- <b>pedestal [i]</b> starts acquisition for i frames, calculates pedestal and writes back to fpga. Used in GOTTHARD only. Only put! \c Returns \c (int)
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName="pedestal"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings;
|
||||
++i;
|
||||
|
||||
|
||||
|
||||
/* pots */
|
||||
/*! \page settings
|
||||
@ -2725,16 +2717,16 @@ string slsDetectorCommand::cmdRateCorr(int narg, char *args[], int action, int d
|
||||
if (action==HELP_ACTION) {
|
||||
return helpRateCorr(action);
|
||||
}
|
||||
int fval;
|
||||
int64_t ival;
|
||||
char answer[1000];
|
||||
|
||||
myDet->setOnline(ONLINE_FLAG, detPos);
|
||||
|
||||
if (action==PUT_ACTION) {
|
||||
sscanf(args[1],"%d",&fval);
|
||||
myDet->setRateCorrection(fval, detPos);
|
||||
sscanf(args[1],"%lld",&ival);
|
||||
myDet->setRateCorrection(ival, detPos);
|
||||
}
|
||||
sprintf(answer,"%d",myDet->getRateCorrection(detPos));
|
||||
sprintf(answer,"%lld",myDet->getRateCorrection(detPos));
|
||||
return string(answer);
|
||||
}
|
||||
|
||||
@ -3549,15 +3541,6 @@ string slsDetectorCommand::cmdSettings(int narg, char *args[], int action, int d
|
||||
}
|
||||
sprintf(ans,"%d",myDet->setAllTrimbits(-1, detPos));
|
||||
return ans;
|
||||
} else if (cmd=="pedestal") {
|
||||
if (action==GET_ACTION)
|
||||
return string("cannot get");
|
||||
if (sscanf(args[1],"%d",&val)){
|
||||
sprintf(ans,"%d",myDet->calibratePedestal(val, detPos));
|
||||
return string(ans);
|
||||
}else
|
||||
return string("cannot parse frame number")+cmd;
|
||||
|
||||
}
|
||||
return string("unknown settings command ")+cmd;
|
||||
|
||||
@ -3574,8 +3557,6 @@ string slsDetectorCommand::helpSettings(int action) {
|
||||
os << "thresholdnotb eV [sett]\n sets the detector threshold in eV without loading trimbits. If sett is provided for eiger, uses settings sett"<< std::endl;
|
||||
os << "trimbits fname\n loads the trimfile fname to the detector. If no extension is specified, the serial number of each module will be attached."<< std::endl;
|
||||
os << "trimval i \n sets all the trimbits to i" << std::endl;
|
||||
os << "pedestal i \n starts acquisition for i frames, calculates pedestal and writes back to fpga."<< std::endl;
|
||||
|
||||
}
|
||||
if (action==GET_ACTION || action==HELP_ACTION) {
|
||||
os << "settings \n gets the settings of the detector"<< std::endl;
|
||||
|
Reference in New Issue
Block a user