mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 15:20:02 +02:00
gotthard and mythen detector merged
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@42 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
93af09b71e
commit
6edf6fa614
@ -254,14 +254,14 @@ enum dacIndex {
|
||||
VSH_POT, /**< chiptest board power supply vsh */
|
||||
VIO_POT, /**< chiptest board power supply va */
|
||||
HV_POT, /**< 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_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 */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -316,6 +316,9 @@ enum timerIndex {
|
||||
GATES_NUMBER, /**< number of gates per frame (in gated mode) */
|
||||
PROBES_NUMBER, /**< number of probe types in pump-probe mode */
|
||||
CYCLES_NUMBER, /**< number of cycles: total number of acquisitions is number or frames*number of cycles */
|
||||
ACTUAL_TIME, /**< Actual time of the detector's internal timer */
|
||||
MEASUREMENT_TIME, /**< Time of the measurement from the detector (fifo) */
|
||||
|
||||
PROGRESS /**< fraction of measurement elapsed - only get! */
|
||||
};
|
||||
|
||||
@ -459,11 +462,11 @@ enum {
|
||||
//Trimming
|
||||
F_EXECUTE_TRIMMING, /**< execute trimming */
|
||||
|
||||
F_EXIT_SERVER, /**< turnoff detector server */
|
||||
F_EXIT_SERVER, /**< turn off detector server */
|
||||
|
||||
|
||||
F_GET_ACTUAL_TIME, /**< Gets the actual time of the detector's internal timer */
|
||||
F_GET_MEASUREMENT_TIME /**< Gets the time of the measurement from the detector (fifo) */
|
||||
F_GET_TEMPERATURE,
|
||||
F_SET_GOTTHARD,
|
||||
F_GET_GOTTHARD
|
||||
|
||||
|
||||
/* Always append functions hereafter!!! */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -41,28 +41,6 @@ class gotthardDetector : public slsDetector{
|
||||
|
||||
|
||||
|
||||
/**
|
||||
executes a set of string arguments according to a given format. It is used to read/write configuration file, dump and retrieve detector settings and for the command line interface command parsing
|
||||
\param narg number of arguments
|
||||
\param args array of string arguments
|
||||
\param action can be PUT_ACTION or GET_ACTION (from text client even READOUT_ACTION for acquisition)
|
||||
\returns answer string
|
||||
*/
|
||||
string executeLine(int narg, char *args[], int action=GET_ACTION);
|
||||
|
||||
/**
|
||||
returns the help for the executeLine command
|
||||
\param os output stream to return the help to
|
||||
\param action can be PUT_ACTION or GET_ACTION (from text client even READOUT_ACTION for acquisition)
|
||||
*/
|
||||
static string helpLine(int action=GET_ACTION);
|
||||
|
||||
|
||||
/**
|
||||
type of action performed
|
||||
*/
|
||||
enum {GET_ACTION, PUT_ACTION, READOUT_ACTION};
|
||||
|
||||
|
||||
/**
|
||||
reads configuration file fname calling executeLine
|
||||
@ -179,174 +157,8 @@ enum {GET_ACTION, PUT_ACTION, READOUT_ACTION};
|
||||
int writeCalibrationFile(string fname, float gain, float offset);
|
||||
|
||||
|
||||
/**
|
||||
reads an angular conversion file
|
||||
\param fname file to be read
|
||||
\sa angleConversionConstant
|
||||
*/
|
||||
int readAngularConversion(string fname="");
|
||||
/**
|
||||
writes an angular conversion file
|
||||
\param fname file to be written
|
||||
\sa angleConversionConstant
|
||||
*/
|
||||
int writeAngularConversion(string fname="");
|
||||
|
||||
|
||||
|
||||
|
||||
//Corrections
|
||||
|
||||
|
||||
/**
|
||||
set angular conversion
|
||||
\param fname file with angular conversion constants ("" disable)
|
||||
\returns 0 if angular conversion disabled, >0 otherwise
|
||||
*/
|
||||
int setAngularConversion(string fname="");
|
||||
|
||||
/**
|
||||
get angular conversion
|
||||
\param reference to diffractometer direction
|
||||
\param angconv array that will be filled with the angular conversion constants
|
||||
\returns 0 if angular conversion disabled, >0 otherwise
|
||||
*/
|
||||
int getAngularConversion(int &direction, angleConversionConstant *angconv=NULL);
|
||||
|
||||
|
||||
/** returns the angular conversion file */
|
||||
string getAngularConversion() {if (thisDetector->correctionMask&(1<< ANGULAR_CONVERSION)) return string(thisDetector->angConvFile); else return string("none");};
|
||||
|
||||
/**
|
||||
set detector global offset
|
||||
*/
|
||||
float setGlobalOffset(float f){thisDetector->globalOffset=f; return thisDetector->globalOffset;};
|
||||
|
||||
/**
|
||||
set detector fine offset
|
||||
*/
|
||||
float setFineOffset(float f){thisDetector->fineOffset=f; return thisDetector->fineOffset;};
|
||||
/**
|
||||
get detector fine offset
|
||||
*/
|
||||
float getFineOffset(){return thisDetector->fineOffset;};
|
||||
|
||||
/**
|
||||
get detector global offset
|
||||
*/
|
||||
float getGlobalOffset(){return thisDetector->globalOffset;};
|
||||
|
||||
/**
|
||||
set positions for the acquisition
|
||||
\param nPos number of positions
|
||||
\param pos array with the encoder positions
|
||||
\returns number of positions
|
||||
*/
|
||||
int setPositions(int nPos, float *pos);
|
||||
/**
|
||||
get positions for the acquisition
|
||||
\param pos array which will contain the encoder positions
|
||||
\returns number of positions
|
||||
*/
|
||||
int getPositions(float *pos=NULL);
|
||||
|
||||
|
||||
/** set detector bin size used for merging (approx angular resolution)*/
|
||||
float setBinSize(float bs) {thisDetector->binSize=bs; return thisDetector->binSize;}
|
||||
/** return detector bin size used for merging (approx angular resolution)*/
|
||||
float getBinSize() {return thisDetector->binSize;}
|
||||
|
||||
|
||||
|
||||
|
||||
/** sets the arrays of the merged data to 0. NB The array should be created with size >= 360./getBinSize();
|
||||
\param mp already merged postions
|
||||
\param mv already merged data
|
||||
\param me already merged errors (squared sum)
|
||||
\param mm multiplicity of merged arrays
|
||||
\returns OK or FAIL
|
||||
*/
|
||||
int resetMerging(float *mp, float *mv,float *me, int *mm);
|
||||
/** merge dataset
|
||||
\param p1 angular positions of dataset
|
||||
\param v1 data
|
||||
\param e1 errors
|
||||
\param mp already merged postions
|
||||
\param mv already merged data
|
||||
\param me already merged errors (squared sum)
|
||||
\param mm multiplicity of merged arrays
|
||||
*/
|
||||
int addToMerging(float *p1, float *v1, float *e1, float *mp, float *mv,float *me, int *mm);
|
||||
|
||||
/**
|
||||
calculates the "final" positions, data value and errors for the emrged data
|
||||
\param mp already merged postions
|
||||
\param mv already merged data
|
||||
\param me already merged errors (squared sum)
|
||||
\param mm multiplicity of merged arrays
|
||||
\returns FAIL or the
|
||||
*/
|
||||
int finalizeMerging(float *mp, float *mv,float *me, int *mm);
|
||||
|
||||
|
||||
/**
|
||||
function for processing data
|
||||
\param delflag if 1 the data are deleted, else left there for further processing (or plotting?)
|
||||
*/
|
||||
void* processData(int delflag=1); // thread function
|
||||
|
||||
/** performs the complete acquisition and data processing
|
||||
moves the detector to next position <br>
|
||||
starts and reads the detector <br>
|
||||
reads the IC (if required) <br>
|
||||
reads the encoder (iof required for angualr conversion) <br>
|
||||
processes the data (flat field, rate, angular conversion and merging ::processData())
|
||||
\param delflag if 1 the data are deleted, else left there for further processing (or plotting?)
|
||||
*/
|
||||
|
||||
void acquire(int delflag=1);
|
||||
|
||||
/**
|
||||
get current timer value on the stop socket
|
||||
\param index timer index
|
||||
\returns elapsed time value in ns or number of...(e.g. frames, gates, probes)
|
||||
*/
|
||||
|
||||
int64_t getTimeLeft(timerIndex index);
|
||||
|
||||
/**
|
||||
get run status on the stop socket
|
||||
\returns status mask
|
||||
*/
|
||||
runStatus getRunStatus();
|
||||
|
||||
|
||||
/**
|
||||
get current temperature
|
||||
\returns current temperature
|
||||
*/
|
||||
|
||||
float getTemperature(int imod=0);
|
||||
|
||||
private:
|
||||
/**
|
||||
start data processing thread
|
||||
*/
|
||||
void startThread(int delflag=1); //
|
||||
/** the data processing thread */
|
||||
|
||||
pthread_t dataProcessingThread;
|
||||
|
||||
/** sets when the acquisition is finished */
|
||||
int jointhread;
|
||||
|
||||
/** data queue size */
|
||||
int queuesize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
static void* startProcessData(void *n);
|
||||
static void* startProcessDataNoDelete(void *n);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user