mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 00:58:01 +02:00
Gotthard class implemented
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@34 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -160,8 +160,8 @@ typedef struct sharedSlsDetector {
|
||||
detectorType myDetectorType;
|
||||
|
||||
|
||||
/** path of the trimbits files */
|
||||
char trimDir[MAX_STR_LENGTH];
|
||||
/** path of the trimbits/settings files */
|
||||
char settingsDir[MAX_STR_LENGTH];
|
||||
/** path of the calibration files */
|
||||
char calDir[MAX_STR_LENGTH];
|
||||
/** number of energies at which the detector has been trimmed (unused) */
|
||||
@ -253,7 +253,7 @@ typedef struct sharedSlsDetector {
|
||||
|
||||
/* detector setup - not needed */
|
||||
/** name root of the output files */
|
||||
char trimFile[MAX_STR_LENGTH];
|
||||
char settingsFile[MAX_STR_LENGTH];
|
||||
/** detector settings (standard, fast, etc.) */
|
||||
detectorSettings currentSettings;
|
||||
/** detector threshold (eV) */
|
||||
@ -322,6 +322,7 @@ typedef struct sharedSlsDetector {
|
||||
\returns 1 if the detector structure has already be initlialized, 0 otherwise */
|
||||
int exists() {return thisDetector->alreadyExisting;};
|
||||
|
||||
|
||||
/**
|
||||
Purely virtual function
|
||||
Should be implemented in the specific detector class
|
||||
@ -378,10 +379,10 @@ typedef struct sharedSlsDetector {
|
||||
|
||||
|
||||
/* I/O */
|
||||
/** returns the detector trimbit directory \sa sharedSlsDetector */
|
||||
char* getTrimDir() {return thisDetector->trimDir;};
|
||||
/** sets the detector trimbit directory \sa sharedSlsDetector */
|
||||
char* setTrimDir(string s) {sprintf(thisDetector->trimDir, s.c_str()); return thisDetector->trimDir;};
|
||||
/** returns the detector trimbit/settings directory \sa sharedSlsDetector */
|
||||
char* getSettingsDir() {return thisDetector->settingsDir;};
|
||||
/** sets the detector trimbit/settings directory \sa sharedSlsDetector */
|
||||
char* setSettingsDir(string s) {sprintf(thisDetector->settingsDir, s.c_str()); return thisDetector->settingsDir;};
|
||||
/** returns the number of trim energies and their value \sa sharedSlsDetector
|
||||
\param point to the array that will contain the trim energies (in ev)
|
||||
\returns number of trim energies
|
||||
@ -404,49 +405,49 @@ typedef struct sharedSlsDetector {
|
||||
|
||||
/**
|
||||
Pure virtual function
|
||||
reads a trim file
|
||||
reads a trim/settings file
|
||||
\param fname name of the file to be read
|
||||
\param myMod pointer to the module structure which has to be set. <BR> If it is NULL a new module structure will be created
|
||||
\returns the pointer to myMod or NULL if reading the file failed
|
||||
\sa mythenDetector::readTrimFile
|
||||
\sa mythenDetector::readSettingsFile
|
||||
*/
|
||||
|
||||
virtual sls_detector_module* readTrimFile(string fname, sls_detector_module* myMod=NULL)=0;
|
||||
virtual sls_detector_module* readSettingsFile(string fname, sls_detector_module* myMod=NULL)=0;
|
||||
|
||||
/**
|
||||
Pure virtual function
|
||||
writes a trim file
|
||||
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
|
||||
\returns OK or FAIL if the file could not be written
|
||||
|
||||
\sa ::sls_detector_module mythenDetector::writeTrimFile(string, sls_detector_module)
|
||||
\sa ::sls_detector_module mythenDetector::writeSettingsFile(string, sls_detector_module)
|
||||
*/
|
||||
virtual int writeTrimFile(string fname, sls_detector_module mod)=0;
|
||||
virtual int writeSettingsFile(string fname, sls_detector_module mod)=0;
|
||||
|
||||
/**
|
||||
returns currently the loaded trimfile name
|
||||
Pure virtual function
|
||||
writes a trim/settings file for module number imod - the values will be read from the current detector structure
|
||||
\param fname name of the file to be written
|
||||
\param imod module number
|
||||
\returns OK or FAIL if the file could not be written
|
||||
\sa ::sls_detector_module sharedSlsDetector mythenDetector::writeSettingsFile(string, int)
|
||||
*/
|
||||
virtual int writeSettingsFile(string fname, int imod)=0;
|
||||
|
||||
const char *getTrimFile(){\
|
||||
string s(thisDetector->trimFile); \
|
||||
|
||||
/**
|
||||
returns currently the loaded trimfile/settingsfile name
|
||||
*/
|
||||
const char *getSettingsFile(){\
|
||||
string s(thisDetector->settingsFile); \
|
||||
if (s.length()>6) {\
|
||||
if (s.substr(s.length()-6,3)==string(".sn") && s.substr(s.length()-3)!=string("xxx") ) \
|
||||
return s.substr(0,s.length()-6).c_str(); \
|
||||
} \
|
||||
return thisDetector->trimFile;\
|
||||
return thisDetector->settingsFile;\
|
||||
};
|
||||
|
||||
/**
|
||||
Pure virtual function
|
||||
writes a trim file for module number imod - the values will be read from the current detector structure
|
||||
\param fname name of the file to be written
|
||||
\param imod module number
|
||||
\returns OK or FAIL if the file could not be written
|
||||
\sa ::sls_detector_module sharedSlsDetector mythenDetector::writeTrimFile(string, int)
|
||||
*/
|
||||
virtual int writeTrimFile(string fname, int imod)=0;
|
||||
|
||||
/**
|
||||
sets the default output files path
|
||||
\sa sharedSlsDetector
|
||||
@ -899,7 +900,7 @@ typedef struct sharedSlsDetector {
|
||||
\param imod module number (-1 all)
|
||||
\returns current settings
|
||||
|
||||
in this function trimbits and calibration files are searched in the trimDir and calDir directories and the detector is initialized
|
||||
in this function trimbits/settings and calibration files are searched in the settingsDir and calDir directories and the detector is initialized
|
||||
*/
|
||||
virtual detectorSettings setSettings(detectorSettings isettings, int imod=-1);
|
||||
|
||||
|
Reference in New Issue
Block a user