scripting stuff added

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@26 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi
2011-02-07 16:24:03 +00:00
parent 677523aa6b
commit 67cd4f9c14
3 changed files with 1221 additions and 154 deletions

View File

@ -28,6 +28,8 @@ extern "C" {
#define MAX_ROIS 100
#define MAX_BADCHANS 2000
#define MAXPOS 50
#define MAX_SCAN_LEVELS 2
#define MAX_SCAN_STEPS 2000
#define NMODMAXX 24
#define NMODMAXY 24
@ -43,6 +45,9 @@ extern "C" {
enum {startScript, scriptBefore, headerBefore, headerAfter,scriptAfter, stopScript, MAX_ACTIONS};
/**
data structure to hold the detector data after postprocessing (e.g. to plot, store in a root tree etc.)
*/
@ -243,6 +248,7 @@ typedef struct sharedSlsDetector {
/** readout flags */
readOutFlags roFlags;
/* detector setup - not needed */
/** name root of the output files */
char trimFile[MAX_STR_LENGTH];
@ -254,9 +260,28 @@ typedef struct sharedSlsDetector {
int64_t timerValue[MAX_TIMERS];
/** clock divider */
//int clkDiv;
/** Scans and scripts */
int actionMask;
int actionMode[MAX_ACTIONS];
char actionScript[MAX_ACTIONS][MAX_STR_LENGTH];
char actionParameter[MAX_ACTIONS][MAX_STR_LENGTH];
int scanMode[MAX_SCAN_LEVELS];
char scanScript[MAX_SCAN_LEVELS][MAX_STR_LENGTH];
char scanParameter[MAX_SCAN_LEVELS][MAX_STR_LENGTH];
int nScanSteps[MAX_SCAN_LEVELS];
float scanSteps[MAX_SCAN_LEVELS][MAX_SCAN_STEPS];
int scanPrecision[MAX_SCAN_LEVELS];
/*offsets*/
/** memory offsets for the flat filed coefficients */
/** memory offsets for the flat field coefficients */
int ffoff;
/** memory offsets for the flat filed coefficient errors */
int fferroff;
@ -1079,7 +1104,7 @@ s
get flat field corrections file name
\returns flat field correction file name
*/
char *getFlatFieldCorrectionFile(){return thisDetector->flatFieldFile;};
char *getFlatFieldCorrectionFile(){ if (thisDetector->correctionMask&(1<<FLAT_FIELD_CORRECTION)) return thisDetector->flatFieldFile; else return "none";};
/**
set rate correction
@ -1094,8 +1119,14 @@ s
\param t reference for dead time
\returns 0 if rate correction disabled, >0 otherwise
*/
int getRateCorrection(float &t);
int getRateCorrection(float &t);
/**
get rate correction tau
\returns 0 if rate correction disabled, otherwise the tau used for the correction
*/
float getRateCorrectionTau();
/**
get rate correction
\returns 0 if rate correction disabled, >0 otherwise
@ -1210,6 +1241,106 @@ s
/**
set action
\param iaction can be enum {startScript, scriptBefore, headerBefore, headerAfter,scriptAfter, stopScript, MAX_ACTIONS}
\param fname for script ("" disable)
\param par for script
\returns 0 if action disabled, >0 otherwise
*/
int setAction(int iaction, string fname="", string par="");
/**
set action
\param iaction can be enum {startScript, scriptBefore, headerBefore, headerAfter,scriptAfter, stopScript, MAX_ACTIONS}
\param fname for script ("" disable)
\returns 0 if action disabled, >0 otherwise
*/
int setActionScript(int iaction, string fname="");
/**
set action
\param iaction can be enum {startScript, scriptBefore, headerBefore, headerAfter,scriptAfter, stopScript, MAX_ACTIONS}
\param par for script ("" disable)
\returns 0 if action disabled, >0 otherwise
*/
int setActionParameter(int iaction, string par="");
/**
returns action script
\param iaction can be enum {startScript, scriptBefore, headerBefore, headerAfter,scriptAfter, stopScript}
\returns action script
*/
string getActionScript(int iaction);
/**
returns action parameter
\param iaction can be enum {startScript, scriptBefore, headerBefore, headerAfter,scriptAfter, stopScript}
\returns action parameter
*/
string getActionParameter(int iaction);
/**
returns action mode
\param iaction can be enum {startScript, scriptBefore, headerBefore, headerAfter,scriptAfter, stopScript}
\returns action mode
*/
int getActionMode(int iaction);
/**
set scan
\param index of the scan (0,1)
\param fname for script ("" disables, "none" disables and overwrites current)
\param nvalues number of steps (0 disables, -1 leaves current value)
\param values pointer to steps (if NULL leaves current values)
\param par parameter for the scan script ("" leaves unchanged)
\returns 0 is scan disabled, >0 otherwise
*/
int setScan(int index, string script="", int nvalues=-1, float *values=NULL, string par="", int precision=-1);
int setScanScript(int index, string script="");
int setScanParameter(int index, string par="");
int setScanPrecision(int index, int precision=-1);
int setScanSteps(int index, int nvalues=-1, float *values=NULL);
/**
returns scan script
\param iscan can be (0,1)
\returns scan script
*/
string getScanScript(int iscan);
/**
returns scan parameter
\param iscan can be (0,1)
\returns scan parameter
*/
string getScanParameter(int iscan);
/**
returns scan mode
\param iscan can be (0,1)
\returns scan mode
*/
int getScanMode(int iscan);
/**
returns scan steps
\param iscan can be (0,1)
\param v is the pointer to the scan steps
\returns scan steps
*/
int getScanSteps(int iscan, float *v=NULL);
/**
returns scan precision
\param iscan can be (0,1)
\returns scan precision
*/
int getScanPrecision(int iscan);
/**
decode data from the detector converting them to an array of floats, one for each channle
@ -1407,6 +1538,20 @@ s
*/
float currentI0;
/**
current scan variable of the detector
*/
float currentScanVariable[MAX_SCAN_LEVELS];
/**
current scan variable index of the detector
*/
int currentScanIndex[MAX_SCAN_LEVELS];
/** merging bins */
@ -1421,11 +1566,6 @@ s
/** merging multiplicity */
int *mergingMultiplicity;
/** pointer to flat field coefficients */
float *ffcoefficients;