1 #ifndef SLS_DETECTOR_USERS_H
2 #define SLS_DETECTOR_USERS_H
17 class multiSlsDetector;
18 class multiSlsDetectorCommand;
20 #include "sls_detector_defs.h"
328 double setExposureTime(
double t=-1,
bool inseconds=
false,
int imod = -1);
421 void registerDataCallback(
int( *userCallback)(detectorData* d,
int f,
int s,
void*),
void *pArg);
449 virtual void addFrame(
double *data,
double pos,
double i0,
double t, std::string fname,
double var);
459 virtual void finalizeDataset(
double *a,
double *v,
double *e,
int &np);
652 std::string
putCommand(
int narg,
char *args[],
int pos=-1);
661 std::string
getCommand(
int narg,
char *args[],
int pos=-1);
704 int setDAC(std::string dac,
int val,
int id = -1);
712 int getADC(std::string adc,
int id = -1);
830 int setROI(
int n=-1, slsDetectorDefs::ROI roiLimits[]=NULL,
int imod = -1);
839 slsDetectorDefs::ROI*
getROI(
int &n,
int imod = -1);
853 case 0:
return std::string(
"idle"); \
854 case 1:
return std::string(
"error"); \
855 case 2:
return std::string(
"waiting"); \
856 case 3:
return std::string(
"finished"); \
857 case 4:
return std::string(
"data"); \
858 case 5:
return std::string(
"running"); \
859 case 6:
return std::string(
"stoppped"); \
860 default:
return std::string(
"unknown"); \
871 if (s==
"standard")
return 0; \
872 if (s==
"fast")
return 1; \
873 if (s==
"highgain")
return 2; \
874 if (s==
"dynamicgain")
return 3; \
875 if (s==
"lowgain")
return 4; \
876 if (s==
"mediumgain")
return 5; \
877 if (s==
"veryhighgain")
return 6; \
886 case 0:
return std::string(
"standard");\
887 case 1:
return std::string(
"fast");\
888 case 2:
return std::string(
"highgain");\
889 case 3:
return std::string(
"dynamicgain"); \
890 case 4:
return std::string(
"lowgain"); \
891 case 5:
return std::string(
"mediumgain"); \
892 case 6:
return std::string(
"veryhighgain"); \
893 default:
return std::string(
"undefined"); \
906 case 0:
return std::string(
"auto"); \
907 case 1:
return std::string(
"trigger"); \
908 case 2:
return std::string(
"ro_trigger"); \
909 case 3:
return std::string(
"gating"); \
910 case 4:
return std::string(
"triggered_gating"); \
911 case 5:
return std::string(
"burst_trigger"); \
912 default:
return std::string(
"unknown"); \
922 if (s==
"auto")
return 0; \
923 if (s==
"trigger")
return 1; \
924 if (s==
"ro_trigger")
return 2; \
925 if (s==
"gating")
return 3; \
926 if (s==
"triggered_gating")
return 4; \
931 multiSlsDetector *myDetector;
932 multiSlsDetectorCommand *myCmd;
int stopMeasurement()
stop measurement
double setSubFrameExposureDeadTime(double t=-1, bool inseconds=false, int imod=-1)
std::string setFilePath(std::string s)
sets the default output files path
int enableWriteToFile(int i=-1)
int64_t getModuleFirmwareVersion(int imod=-1)
int64_t getDetectorSoftwareVersion(int imod=-1)
int enableGapPixels(int enable=-1)
int setStoragecellStart(int pos=-1)
int64_t getDetectorFirmwareVersion(int imod=-1)
slsDetectorDefs::ROI * getROI(int &n, int imod=-1)
int setBitDepth(int i=-1)
set/get dynamic range
void registerDataCallback(int(*userCallback)(detectorData *d, int f, int s, void *), void *pArg)
register calbback for accessing detector final data, also enables data streaming in client and receiv...
int sendSoftwareTrigger()
void startMeasurement()
start measurement and acquires
int setAllTrimbits(int val, int id=-1)
sets all trimbits to value (only available for eiger)
static std::string getTimingMode(int f)
returns external communication mode std::string from index
int setOverflowMode(int value)
show saturated for overflow in subframes in 32 bit mode (eiger only)
void registerGoToPositionNoWaitCallback(int(*func)(double, void *), void *arg)
register callback for moving the detector without waiting
int setReceiverOnline(int const online=-1)
sets the receivers onlineFlag
int setDetectorSize(int x0=-1, int y0=-1, int nx=-1, int ny=-1)
sets the detector size (only 1 ROI)
double setExposurePeriod(double t=-1, bool inseconds=false, int imod=-1)
set/get exposure period
virtual void initDataset(int refresh)
function to initalize a set of measurements (reset binning if angular conversion, reset summing other...
int64_t getThisSoftwareVersion()
int setTimingMode(int pol=-1)
set/get the external communication mode
double setExposureTime(double t=-1, bool inseconds=false, int imod=-1)
set/get exposure time value
int retrieveDetectorSetup(std::string const fname)
Loads the detector setup from file.
int setReceiverPartialFramesPadding(int f=-1)
int stopReceiver()
stop receiver listening mode
std::string getCommand(int narg, char *args[], int pos=-1)
gets parameters in command interface http://www.psi.ch/detectors/UsersSupportEN/slsDetectorClientHowT...
int setReceiverMode(int n=-1)
sets the mode by which gui requests data from receiver
int setOnline(int const online=-1)
sets the onlineFlag
int64_t setNumberOfCycles(int64_t t=-1, int imod=-1)
set/get number of cycles i.e. number of triggers
double setSubFrameExposureTime(double t=-1, bool inseconds=false, int imod=-1)
std::string setFlatFieldCorrectionDir(std::string dir)
set flat field corrections file directory
virtual void finalizeDataset(double *a, double *v, double *e, int &np)
finalizes the data set returning the array of angles, values and errors to be used as final data - ca...
std::string getDetectorType()
useful for data plotting etc.
int setDAC(std::string dac, int val, int id=-1)
set dac value
std::string getFlatFieldCorrectionFile()
get flat field corrections file name
void registerConnectChannelsCallback(int(*func)(void *), void *arg)
register callback for connecting to the epics channels
static int getDetectorSettings(std::string s)
returns detector settings std::string from index
void registerGetI0Callback(double(*func)(int, void *), void *arg)
register calbback reading to I0
std::string getFlatFieldCorrectionDir()
get flat field corrections file directory
double getMeasuredSubFramePeriod(bool inseconds=false, int imod=-1)
int setHighVoltage(int i)
The slsDetectorUsers class is a minimal interface class which should be instantiated by the users in ...
virtual ~slsDetectorUsers()
virtual destructor
int setTenGigabitEthernet(int i=-1)
int getThresholdEnergy()
get threshold energy
int setClientDataStreamingInPort(int i=-1)
void registerDisconnectChannelsCallback(int(*func)(void *), void *arg)
register callback to disconnect the epics channels
int setReceiverSilentMode(int i)
std::string getFileName()
int setThresholdEnergy(int e_eV)
set threshold energy
int dumpDetectorSetup(std::string const fname)
Reads the parameters from the detector and writes them to file.
int setReceiverFramesPerFile(int f=-1)
int setReceiverDataStreamingOutPort(int i=-1)
int enableDataStreamingToClient(int i=-1)
int getPositions(double *pos=NULL)
get positions for the acquisition
int setClockDivider(int value)
sets clock divider of detector
int64_t setNumberOfStorageCells(int64_t t=-1, int imod=-1)
int enableCountRateCorrection(int i=-1)
enable/disable count rate corrections
int64_t setNumberOfGates(int64_t t=-1, int imod=-1)
set/get number of gates
int setFlatFieldCorrectionFile(std::string fname="")
set flat field correction file
int getDetectorStatus()
get run status
int setParallelMode(int value)
sets parallel mode
int startReceiver()
start receiver listening mode
virtual void addFrame(double *data, double pos, double i0, double t, std::string fname, double var)
adds frame to merging/summation - can be overcome by the user's functions thanks to the virtual prope...
int setFileIndex(int i)
sets the default output file index
int enableDataStreamingFromReceiver(int i=-1)
std::string setFileName(std::string s)
sets the default output files path
void registerRawDataCallback(int(*userCallback)(double *p, int n, void *), void *pArg)
register callback for accessing raw data - if the rawDataCallback is registered, no filewriting/postp...
int getDetectorSize(int &x0, int &y0, int &nx, int &ny)
gets detector size (roi size if only one roi)
int resetFramesCaughtInReceiver()
std::string setReceiverDataStreamingOutIP(std::string ip="")
int64_t setNumberOfFrames(int64_t t=-1, int imod=-1)
set/get number of frames i.e. number of exposure per trigger
int setPositions(int nPos, double *pos)
set positions for the acquisition
slsDetectorUsers(int &ret, int id=0)
default constructor
int64_t getModuleSerialNumber(int imod=-1)
std::string setClientDataStreamingInIP(std::string ip="")
std::string setReceiverFramesDiscardPolicy(std::string f="get")
int enablePixelMaskCorrection(int i=-1)
enable/disable bad channel corrections
static std::string getDetectorSettings(int s)
returns detector settings std::string from index
std::string getDetectorDeveloper()
useful to define subset of working functions
double getMeasuredPeriod(bool inseconds=false, int imod=-1)
std::string getFilePath()
returns the default output files path
void registerGoToPositionCallback(int(*func)(double, void *), void *arg)
register callback for moving the detector
int readConfigurationFile(std::string const fname)
Reads the configuration file – will contain all the informations needed for the configuration (e...
static std::string runStatusType(int s)
returns std::string from run status index
int getADC(std::string adc, int id=-1)
get adc value
static int getTimingMode(std::string s)
returns external communication mode std::string from index
int setSettings(int isettings=-1)
set detector settings
double setDelayAfterTrigger(double t=-1, bool inseconds=false, int imod=-1)
set/get delay after trigger
void registerAcquisitionFinishedCallback(int(*func)(double, int, void *), void *pArg)
register calbback for accessing detector final data
void registerGetPositionCallback(double(*func)(void *), void *arg)
register calbback for reading detector position
int setReceiverFifoDepth(int i=-1)
int64_t getDetectorSerialNumber(int imod=-1)
std::string putCommand(int narg, char *args[], int pos=-1)
sets parameters in command interface http://www.psi.ch/detectors/UsersSupportEN/slsDetectorClientHowT...
int setFlowControl10G(int i=-1)
int setROI(int n=-1, slsDetectorDefs::ROI roiLimits[]=NULL, int imod=-1)
int enableAngularConversion(int i=-1)
enable/disable angular conversion
int enableFlatFieldCorrection(int i=-1)
enable/disable flat field corrections (without changing file name)
int getMaximumDetectorSize(int &nx, int &ny)
gets the maximum detector size