My Project
 All Classes Files Functions Variables Macros
Public Member Functions | Static Public Member Functions | List of all members
slsDetectorUsers Class Reference

The slsDetectorUsers class is a minimal interface class which should be instantiated by the users in their acquisition software (EPICS, spec etc.). More advanced configuration functions are not implemented and can be written in a configuration or parameters file that can be read/written. More...

#include <slsDetectorUsers.h>

Public Member Functions

 slsDetectorUsers (int &ret, int id=0)
 default constructor More...
 
virtual ~slsDetectorUsers ()
 virtual destructor More...
 
std::string getDetectorDeveloper ()
 useful to define subset of working functions More...
 
int setOnline (int const online=-1)
 sets the onlineFlag More...
 
int setReceiverOnline (int const online=-1)
 sets the receivers onlineFlag More...
 
void startMeasurement ()
 start measurement and acquires More...
 
int stopMeasurement ()
 stop measurement More...
 
int getDetectorStatus ()
 get run status More...
 
std::string getFilePath ()
 returns the default output files path More...
 
std::string setFilePath (std::string s)
 sets the default output files path More...
 
std::string getFileName ()
 
std::string setFileName (std::string s)
 sets the default output files path More...
 
int getFileIndex ()
 
int setFileIndex (int i)
 sets the default output file index More...
 
std::string getFlatFieldCorrectionDir ()
 get flat field corrections file directory More...
 
std::string setFlatFieldCorrectionDir (std::string dir)
 set flat field corrections file directory More...
 
std::string getFlatFieldCorrectionFile ()
 get flat field corrections file name More...
 
int setFlatFieldCorrectionFile (std::string fname="")
 set flat field correction file More...
 
int enableFlatFieldCorrection (int i=-1)
 enable/disable flat field corrections (without changing file name) More...
 
int enableCountRateCorrection (int i=-1)
 enable/disable count rate corrections More...
 
int enablePixelMaskCorrection (int i=-1)
 enable/disable bad channel corrections More...
 
int enableAngularConversion (int i=-1)
 enable/disable angular conversion More...
 
int enableWriteToFile (int i=-1)
 
int setPositions (int nPos, double *pos)
 set positions for the acquisition More...
 
int getPositions (double *pos=NULL)
 get positions for the acquisition More...
 
int setDetectorSize (int x0=-1, int y0=-1, int nx=-1, int ny=-1)
 sets the detector size (only 1 ROI) More...
 
int getDetectorSize (int &x0, int &y0, int &nx, int &ny)
 gets detector size (roi size if only one roi) More...
 
int getMaximumDetectorSize (int &nx, int &ny)
 gets the maximum detector size More...
 
int setBitDepth (int i=-1)
 set/get dynamic range More...
 
int setSettings (int isettings=-1)
 set detector settings More...
 
int getThresholdEnergy ()
 get threshold energy More...
 
int setThresholdEnergy (int e_eV)
 set threshold energy More...
 
int setThresholdEnergy (int e_ev, int tb, int isettings=-1, int id=-1)
 set threshold energy with choice to load trimbits (eiger only) More...
 
double setExposureTime (double t=-1, bool inseconds=false, int imod=-1)
 set/get exposure time value More...
 
double setExposurePeriod (double t=-1, bool inseconds=false, int imod=-1)
 set/get exposure period More...
 
double setDelayAfterTrigger (double t=-1, bool inseconds=false, int imod=-1)
 set/get delay after trigger More...
 
int64_t setNumberOfGates (int64_t t=-1, int imod=-1)
 set/get number of gates More...
 
int64_t setNumberOfFrames (int64_t t=-1, int imod=-1)
 set/get number of frames i.e. number of exposure per trigger More...
 
int64_t setNumberOfCycles (int64_t t=-1, int imod=-1)
 set/get number of cycles i.e. number of triggers More...
 
int setTimingMode (int pol=-1)
 set/get the external communication mode More...
 
int readConfigurationFile (std::string const fname)
 Reads the configuration file – will contain all the informations needed for the configuration (e.g. for a PSI detector caldir, settingsdir, angconv, badchannels, hostname etc.) More...
 
int dumpDetectorSetup (std::string const fname)
 Reads the parameters from the detector and writes them to file. More...
 
int retrieveDetectorSetup (std::string const fname)
 Loads the detector setup from file. More...
 
std::string getDetectorType ()
 useful for data plotting etc. More...
 
int setReceiverMode (int n=-1)
 sets the mode by which gui requests data from receiver More...
 
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 receiver (if receiver exists) More...
 
void registerRawDataCallback (int(*userCallback)(double *p, int n, void *), void *pArg)
 register callback for accessing raw data - if the rawDataCallback is registered, no filewriting/postprocessing will be carried on automatically by the software - the raw data are deleted by the software More...
 
virtual void initDataset (int refresh)
 function to initalize a set of measurements (reset binning if angular conversion, reset summing otherwise) - can be overcome by the user's functions thanks to the virtual property More...
 
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 property More...
 
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 - can be overcome by the user's functions thanks to the virtual property More...
 
int enableDataStreamingFromReceiver (int i=-1)
 
int enableDataStreamingToClient (int i=-1)
 
int setReceiverDataStreamingOutPort (int i=-1)
 
int setClientDataStreamingInPort (int i=-1)
 
std::string setReceiverDataStreamingOutIP (std::string ip="")
 
std::string setClientDataStreamingInIP (std::string ip="")
 
int64_t getModuleFirmwareVersion (int imod=-1)
 
int64_t getModuleSerialNumber (int imod=-1)
 
int64_t getDetectorFirmwareVersion (int imod=-1)
 
int64_t getDetectorSerialNumber (int imod=-1)
 
int64_t getDetectorSoftwareVersion (int imod=-1)
 
int64_t getThisSoftwareVersion ()
 
int enableGapPixels (int enable=-1)
 
std::string setReceiverFramesDiscardPolicy (std::string f="get")
 
int setReceiverPartialFramesPadding (int f=-1)
 
int setReceiverFramesPerFile (int f=-1)
 
int sendSoftwareTrigger ()
 
double getMeasuredPeriod (bool inseconds=false, int imod=-1)
 
double getMeasuredSubFramePeriod (bool inseconds=false, int imod=-1)
 
void registerAcquisitionFinishedCallback (int(*func)(double, int, void *), void *pArg)
 register calbback for accessing detector final data More...
 
void registerGetPositionCallback (double(*func)(void *), void *arg)
 register calbback for reading detector position More...
 
void registerConnectChannelsCallback (int(*func)(void *), void *arg)
 register callback for connecting to the epics channels More...
 
void registerDisconnectChannelsCallback (int(*func)(void *), void *arg)
 register callback to disconnect the epics channels More...
 
void registerGoToPositionCallback (int(*func)(double, void *), void *arg)
 register callback for moving the detector More...
 
void registerGoToPositionNoWaitCallback (int(*func)(double, void *), void *arg)
 register callback for moving the detector without waiting More...
 
void registerGetI0Callback (double(*func)(int, void *), void *arg)
 register calbback reading to I0 More...
 
std::string putCommand (int narg, char *args[], int pos=-1)
 sets parameters in command interface http://www.psi.ch/detectors/UsersSupportEN/slsDetectorClientHowTo.pdf More...
 
std::string getCommand (int narg, char *args[], int pos=-1)
 gets parameters in command interface http://www.psi.ch/detectors/UsersSupportEN/slsDetectorClientHowTo.pdf More...
 
int setClockDivider (int value)
 sets clock divider of detector More...
 
int setParallelMode (int value)
 sets parallel mode More...
 
int setOverflowMode (int value)
 show saturated for overflow in subframes in 32 bit mode (eiger only) More...
 
int setAllTrimbits (int val, int id=-1)
 sets all trimbits to value (only available for eiger) More...
 
int setDAC (std::string dac, int val, int id=-1)
 set dac value More...
 
int getADC (std::string adc, int id=-1)
 get adc value More...
 
int startReceiver ()
 start receiver listening mode More...
 
int stopReceiver ()
 stop receiver listening mode More...
 
int startAcquisition ()
 
int stopAcquisition ()
 
int setReceiverSilentMode (int i)
 
int setHighVoltage (int i)
 
int resetFramesCaughtInReceiver ()
 
int setReceiverFifoDepth (int i=-1)
 
int setFlowControl10G (int i=-1)
 
int setTenGigabitEthernet (int i=-1)
 
int getNMods ()
 
double setSubFrameExposureTime (double t=-1, bool inseconds=false, int imod=-1)
 
double setSubFrameExposureDeadTime (double t=-1, bool inseconds=false, int imod=-1)
 
int64_t setNumberOfStorageCells (int64_t t=-1, int imod=-1)
 
int setStoragecellStart (int pos=-1)
 
int setROI (int n=-1, slsDetectorDefs::ROI roiLimits[]=NULL, int imod=-1)
 
slsDetectorDefs::ROI * getROI (int &n, int imod=-1)
 

Static Public Member Functions

static std::string runStatusType (int s)
 returns std::string from run status index More...
 
static int getDetectorSettings (std::string s)
 returns detector settings std::string from index More...
 
static std::string getDetectorSettings (int s)
 returns detector settings std::string from index More...
 
static std::string getTimingMode (int f)
 returns external communication mode std::string from index More...
 
static int getTimingMode (std::string s)
 returns external communication mode std::string from index More...
 

Detailed Description

The slsDetectorUsers class is a minimal interface class which should be instantiated by the users in their acquisition software (EPICS, spec etc.). More advanced configuration functions are not implemented and can be written in a configuration or parameters file that can be read/written.

Class for detector functionalities to embed the detector controls in the users custom interface e.g. EPICS, Lima etc.

Definition at line 85 of file slsDetectorUsers.h.

Constructor & Destructor Documentation

slsDetectorUsers::slsDetectorUsers ( int &  ret,
int  id = 0 
)

default constructor

Parameters
retaddress of return value. It will be set to 0 for success, else 1 for failure
idmulti detector id in creating multidetector object
virtual slsDetectorUsers::~slsDetectorUsers ( )
virtual

virtual destructor

Member Function Documentation

virtual void slsDetectorUsers::addFrame ( double *  data,
double  pos,
double  i0,
double  t,
std::string  fname,
double  var 
)
virtual

adds frame to merging/summation - can be overcome by the user's functions thanks to the virtual property

Parameters
datapointer to the raw data
posencoder position
i0beam monitor readout for intensity normalization (if 0 not performed)
texposure time in seconds, required only if rate corrections
fnamefile name (unused since filewriting would be performed by the user)
varoptional parameter - unused.
int slsDetectorUsers::dumpDetectorSetup ( std::string const  fname)

Reads the parameters from the detector and writes them to file.

Parameters
fnamefile to write to
Returns
OK or FAIL
int slsDetectorUsers::enableAngularConversion ( int  i = -1)

enable/disable angular conversion

Parameters
i0 disables, 1 enables, -1 gets
Returns
0 if angular conversion disabled, 1 if enabled
int slsDetectorUsers::enableCountRateCorrection ( int  i = -1)

enable/disable count rate corrections

Parameters
i0 disables, 1 enables with default values, -1 gets
Returns
0 if count corrections disabled, 1 if enabled
int slsDetectorUsers::enableDataStreamingFromReceiver ( int  i = -1)

Enable or disable streaming data from receiver (creates transmitting sockets)

Parameters
i0 to disable 1 to enable -1 to only get the value
Returns
data streaming from receiver enable
int slsDetectorUsers::enableDataStreamingToClient ( int  i = -1)

Enable data streaming to client (creates receiving sockets)

Parameters
i0 to disable, 1 to enable, -1 to get the value
Returns
data streaming to client enable
int slsDetectorUsers::enableFlatFieldCorrection ( int  i = -1)

enable/disable flat field corrections (without changing file name)

Parameters
i0 disables, 1 enables, -1 gets
Returns
0 if ff corrections disabled, 1 if enabled
int slsDetectorUsers::enableGapPixels ( int  enable = -1)

Enable gap pixels, only for Eiger and for 8,16 and 32 bit mode. 4 bit mode gap pixels only in gui call back (registerDataCallback)

Parameters
enable1 sets, 0 unsets, -1 gets
Returns
gap pixel enable or -1 for error
int slsDetectorUsers::enablePixelMaskCorrection ( int  i = -1)

enable/disable bad channel corrections

Parameters
i0 disables, 1 enables, -1 gets
Returns
0 if bad channels corrections disabled, 1 if enabled
int slsDetectorUsers::enableWriteToFile ( int  i = -1)

Enable write file function included

virtual void slsDetectorUsers::finalizeDataset ( double *  a,
double *  v,
double *  e,
int &  np 
)
virtual

finalizes the data set returning the array of angles, values and errors to be used as final data - can be overcome by the user's functions thanks to the virtual property

Parameters
apointer to the array of angles - can be null if no angular coversion is required
vpointer to the array of values
epointer to the array of errors
npreference returning the number of points
int slsDetectorUsers::getADC ( std::string  adc,
int  id = -1 
)

get adc value

Parameters
adcadc as std::string. can be temp_fpga, temp_fpgaext, temp_10ge, temp_dcdc, temp_sodl, temp_sodr, temp_fpgafl, temp_fpgafr. others not supported
idmodule index (-1 for all)
Returns
adc value in millidegree Celsius or -1 (if id=-1 & adc value is different for all modules) or -9999 if adc std::string does not match
std::string slsDetectorUsers::getCommand ( int  narg,
char *  args[],
int  pos = -1 
)

gets parameters in command interface http://www.psi.ch/detectors/UsersSupportEN/slsDetectorClientHowTo.pdf

Parameters
nargvalue to be set
argsvalue to be set
posposition of detector in multislsdetector list
Returns
answer std::string
std::string slsDetectorUsers::getDetectorDeveloper ( )

useful to define subset of working functions

Returns
"PSI" or "Dectris"
int64_t slsDetectorUsers::getDetectorFirmwareVersion ( int  imod = -1)

get get Detector Firmware Version

Parameters
imodmodule number
Returns
id
int64_t slsDetectorUsers::getDetectorSerialNumber ( int  imod = -1)

get get Detector Serial Number

Parameters
imodmodule number
Returns
id
static int slsDetectorUsers::getDetectorSettings ( std::string  s)
inlinestatic

returns detector settings std::string from index

Parameters
scan be standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain
Returns
setting index (-1 unknown std::string)

Definition at line 870 of file slsDetectorUsers.h.

static std::string slsDetectorUsers::getDetectorSettings ( int  s)
inlinestatic

returns detector settings std::string from index

Parameters
ssettings index
Returns
standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain, undefined when wrong index

Definition at line 884 of file slsDetectorUsers.h.

int slsDetectorUsers::getDetectorSize ( int &  x0,
int &  y0,
int &  nx,
int &  ny 
)

gets detector size (roi size if only one roi)

Parameters
x0horizontal position origin in channel number
y0vertical position origin in channel number
nxnumber of channels in horiziontal
nynumber of channels in vertical
Returns
total number of channels
int64_t slsDetectorUsers::getDetectorSoftwareVersion ( int  imod = -1)

get get Detector Software Version

Parameters
imodmodule number
Returns
id
int slsDetectorUsers::getDetectorStatus ( )

get run status

Returns
status mask
std::string slsDetectorUsers::getDetectorType ( )

useful for data plotting etc.

Returns
Mythen, Eiger, Gotthard etc.
int slsDetectorUsers::getFileIndex ( )
Returns
the default output file index
std::string slsDetectorUsers::getFileName ( )
Returns
the default output files root name
std::string slsDetectorUsers::getFilePath ( )

returns the default output files path

std::string slsDetectorUsers::getFlatFieldCorrectionDir ( )

get flat field corrections file directory

Returns
flat field correction file directory
std::string slsDetectorUsers::getFlatFieldCorrectionFile ( )

get flat field corrections file name

Returns
flat field correction file name
int slsDetectorUsers::getMaximumDetectorSize ( int &  nx,
int &  ny 
)

gets the maximum detector size

Parameters
nxnumber of channels in horiziontal
nynumber of channels in vertical
Returns
OK/FAIL
double slsDetectorUsers::getMeasuredPeriod ( bool  inseconds = false,
int  imod = -1 
)

get measured period between previous two frames(EIGER only)

Parameters
insecondstrue if the value is in s, else ns
imodmodule number (-1 for all)
Returns
measured period
double slsDetectorUsers::getMeasuredSubFramePeriod ( bool  inseconds = false,
int  imod = -1 
)

get measured sub period between previous two sub frames in 32 bit mode (EIGER only)

Parameters
insecondstrue if the value is in s, else ns
imodmodule number (-1 for all)
Returns
measured sub period
int64_t slsDetectorUsers::getModuleFirmwareVersion ( int  imod = -1)

get get Module Firmware Version

Parameters
imodmodule number
Returns
id
int64_t slsDetectorUsers::getModuleSerialNumber ( int  imod = -1)

get get Module Serial Number (only mythen)

Parameters
imodmodule number
Returns
id
int slsDetectorUsers::getNMods ( )

returns total number of detector modules

Returns
the total number of detector modules
int slsDetectorUsers::getPositions ( double *  pos = NULL)

get positions for the acquisition

Parameters
posarray which will contain the encoder positions
Returns
number of positions
slsDetectorDefs::ROI* slsDetectorUsers::getROI ( int &  n,
int  imod = -1 
)

Get ROI from each detector and convert it to the multi detector scale (Gotthard) >= 1 roi, but max 1 roi per module

Parameters
nnumber of rois
imodmodule number (ignored)
Returns
pointer to array of ROI structure
int64_t slsDetectorUsers::getThisSoftwareVersion ( )

get this Software Version

Returns
id
int slsDetectorUsers::getThresholdEnergy ( )

get threshold energy

Returns
current threshold value for imod in ev (-1 failed)
static std::string slsDetectorUsers::getTimingMode ( int  f)
inlinestatic

returns external communication mode std::string from index

Parameters
findex for communication mode
Returns
auto, trigger, ro_trigger, gating, triggered_gating, unknown when wrong mode

Definition at line 904 of file slsDetectorUsers.h.

static int slsDetectorUsers::getTimingMode ( std::string  s)
inlinestatic

returns external communication mode std::string from index

Parameters
sindex for communication mode
Returns
auto, trigger, ro_trigger, gating, triggered_gating, unknown when wrong mode

Definition at line 921 of file slsDetectorUsers.h.

virtual void slsDetectorUsers::initDataset ( int  refresh)
virtual

function to initalize a set of measurements (reset binning if angular conversion, reset summing otherwise) - can be overcome by the user's functions thanks to the virtual property

Parameters
refreshif 1, all parameters like ffcoefficients, badchannels, ratecorrections etc. are reset (should be called at least onece with this option), if 0 simply reset merging/ summation
std::string slsDetectorUsers::putCommand ( int  narg,
char *  args[],
int  pos = -1 
)

sets parameters in command interface http://www.psi.ch/detectors/UsersSupportEN/slsDetectorClientHowTo.pdf

Parameters
nargvalue to be set
argsvalue to be set
posposition of detector in multislsdetector list
Returns
answer std::string
int slsDetectorUsers::readConfigurationFile ( std::string const  fname)

Reads the configuration file – will contain all the informations needed for the configuration (e.g. for a PSI detector caldir, settingsdir, angconv, badchannels, hostname etc.)

Parameters
fnamefile name
Returns
OK or FAIL
void slsDetectorUsers::registerAcquisitionFinishedCallback ( int(*)(double, int, void *)  func,
void *  pArg 
)

register calbback for accessing detector final data

Parameters
funcfunction to be called at the end of the acquisition. gets detector status and progress index as arguments
pArgargument
void slsDetectorUsers::registerConnectChannelsCallback ( int(*)(void *)  func,
void *  arg 
)

register callback for connecting to the epics channels

Parameters
funcfunction for connecting to the epics channels
argargument
void slsDetectorUsers::registerDataCallback ( int(*)(detectorData *d, int f, int s, void *)  userCallback,
void *  pArg 
)

register calbback for accessing detector final data, also enables data streaming in client and receiver (if receiver exists)

Parameters
userCallbackfunction for plotting/analyzing the data. Its arguments are the data structure d and the frame number f, s is for subframe number for eiger for 32 bit mode
pArgargument
void slsDetectorUsers::registerDisconnectChannelsCallback ( int(*)(void *)  func,
void *  arg 
)

register callback to disconnect the epics channels

Parameters
funcfunction to disconnect the epics channels
argargument
void slsDetectorUsers::registerGetI0Callback ( double(*)(int, void *)  func,
void *  arg 
)

register calbback reading to I0

Parameters
funcfunction for reading the I0 (called with parameter 0 before the acquisition, 1 after and the return value used as I0)
argargument
void slsDetectorUsers::registerGetPositionCallback ( double(*)(void *)  func,
void *  arg 
)

register calbback for reading detector position

Parameters
funcfunction for reading the detector position
argargument
void slsDetectorUsers::registerGoToPositionCallback ( int(*)(double, void *)  func,
void *  arg 
)

register callback for moving the detector

Parameters
funcfunction for moving the detector
argargument
void slsDetectorUsers::registerGoToPositionNoWaitCallback ( int(*)(double, void *)  func,
void *  arg 
)

register callback for moving the detector without waiting

Parameters
funcfunction for moving the detector
argargument
void slsDetectorUsers::registerRawDataCallback ( int(*)(double *p, int n, void *)  userCallback,
void *  pArg 
)

register callback for accessing raw data - if the rawDataCallback is registered, no filewriting/postprocessing will be carried on automatically by the software - the raw data are deleted by the software

Parameters
userCallbackfunction for postprocessing and saving the data - p is the pointer to the data, n is the number of channels
pArgargument
int slsDetectorUsers::resetFramesCaughtInReceiver ( )

reset frames caught in receiver should be called before startReceiver()

Returns
OK or FAIL
int slsDetectorUsers::retrieveDetectorSetup ( std::string const  fname)

Loads the detector setup from file.

Parameters
fnamefile to read from
Returns
OK or FAIL
static std::string slsDetectorUsers::runStatusType ( int  s)
inlinestatic

returns std::string from run status index

Parameters
srun status index
Returns
std::string error, waiting, running, data, finished or unknown when wrong index

Definition at line 851 of file slsDetectorUsers.h.

int slsDetectorUsers::sendSoftwareTrigger ( )

Sends a software internal trigger (EIGER only)

Returns
0 for success, 1 for fail
int slsDetectorUsers::setAllTrimbits ( int  val,
int  id = -1 
)

sets all trimbits to value (only available for eiger)

Parameters
valvalue to be set (-1 gets)
idmodule index (-1 for all)
Returns
value set
int slsDetectorUsers::setBitDepth ( int  i = -1)

set/get dynamic range

Parameters
idynamic range (-1 get)
Returns
current dynamic range
std::string slsDetectorUsers::setClientDataStreamingInIP ( std::string  ip = "")

(for expert users) Set/Get client streaming in ZMQ IP By default, it is the IP of receiver hostname

Parameters
ipsets, empty std::string gets
Returns
client streaming in ZMQ IP
int slsDetectorUsers::setClientDataStreamingInPort ( int  i = -1)

(for expert users) Set/Get client streaming in ZMQ port For multi modules, it calculates (increments), sets the ports and restarts the sockets

Parameters
isets, -1 gets
Returns
client streaming in ZMQ port (if multiple, of first client socket)
int slsDetectorUsers::setClockDivider ( int  value)

sets clock divider of detector

Parameters
valuevalue to be set (-1 gets)
Returns
speed of detector
int slsDetectorUsers::setDAC ( std::string  dac,
int  val,
int  id = -1 
)

set dac value

Parameters
dacdac as std::string. can be vcmp_ll, vcmp_lr, vcmp_rl, vcmp_rr, vthreshold, vrf, vrs, vtr, vcall, vcp. others not supported
valvalue to be set (-1 gets)
idmodule index (-1 for all)
Returns
dac value or -1 (if id=-1 & dac value is different for all modules) or -9999 if dac std::string does not match
double slsDetectorUsers::setDelayAfterTrigger ( double  t = -1,
bool  inseconds = false,
int  imod = -1 
)

set/get delay after trigger

Parameters
ttime in ns (-1 gets)
insecondstrue if the value is in s, else ns
imodmodule number (-1 for all)
Returns
timer set value in ns, or s if specified
int slsDetectorUsers::setDetectorSize ( int  x0 = -1,
int  y0 = -1,
int  nx = -1,
int  ny = -1 
)

sets the detector size (only 1 ROI)

Parameters
x0horizontal position origin in channel number (-1 unchanged)
y0vertical position origin in channel number (-1 unchanged)
nxnumber of channels in horiziontal (-1 unchanged)
nynumber of channels in vertical (-1 unchanged)
Returns
OK/FAIL
double slsDetectorUsers::setExposurePeriod ( double  t = -1,
bool  inseconds = false,
int  imod = -1 
)

set/get exposure period

Parameters
ttime in ns (-1 gets)
insecondstrue if the value is in s, else ns
imodmodule number (-1 for all)
Returns
timer set value in ns, or s if specified
double slsDetectorUsers::setExposureTime ( double  t = -1,
bool  inseconds = false,
int  imod = -1 
)

set/get exposure time value

Parameters
ttime in sn (-1 gets)
insecondstrue if the value is in s, else ns
imodmodule number (-1 for all)
Returns
timer set value in ns, or s if specified
int slsDetectorUsers::setFileIndex ( int  i)

sets the default output file index

Parameters
ifile index
Returns
the default output file index
std::string slsDetectorUsers::setFileName ( std::string  s)

sets the default output files path

Parameters
sfile name
Returns
the default output files root name
std::string slsDetectorUsers::setFilePath ( std::string  s)

sets the default output files path

Parameters
sfile path
Returns
file path
std::string slsDetectorUsers::setFlatFieldCorrectionDir ( std::string  dir)

set flat field corrections file directory

Parameters
dirflat field correction file directory
Returns
flat field correction file directory
int slsDetectorUsers::setFlatFieldCorrectionFile ( std::string  fname = "")

set flat field correction file

Parameters
fnamename of the flat field file (or "" if disable)
Returns
0 if disable (or file could not be read), >0 otherwise
int slsDetectorUsers::setFlowControl10G ( int  i = -1)

set flow control for 10Gbe (Eiger only)

Parameters
i1 sets, 0 unsets (-1 gets)
Returns
flow control enable for 10 Gbe
int slsDetectorUsers::setHighVoltage ( int  i)

set high voltage

Parameters
i> 0 sets, 0 unsets, (-1 gets)
Returns
high voltage
int64_t slsDetectorUsers::setNumberOfCycles ( int64_t  t = -1,
int  imod = -1 
)

set/get number of cycles i.e. number of triggers

Parameters
tnumber of frames (-1 gets)
imodmodule number (-1 for all)
Returns
number of frames
int64_t slsDetectorUsers::setNumberOfFrames ( int64_t  t = -1,
int  imod = -1 
)

set/get number of frames i.e. number of exposure per trigger

Parameters
tnumber of frames (-1 gets)
imodmodule number (-1 for all)
Returns
number of frames
int64_t slsDetectorUsers::setNumberOfGates ( int64_t  t = -1,
int  imod = -1 
)

set/get number of gates

Parameters
tnumber of gates (-1 gets)
imodmodule number (-1 for all)
Returns
number of gates
int64_t slsDetectorUsers::setNumberOfStorageCells ( int64_t  t = -1,
int  imod = -1 
)

set/get number of additional storage cells (Jungfrau)

Parameters
tnumber of additional storage cells. Default is 0. (-1 gets)
imodmodule number (-1 for all)
Returns
number of additional storage cells
int slsDetectorUsers::setOnline ( int const  online = -1)

sets the onlineFlag

Parameters
onlinecan be: -1 returns wether the detector is in online (1) or offline (0) state; 0 detector in offline state; 1 detector in online state
Returns
0 (offline) or 1 (online)
int slsDetectorUsers::setOverflowMode ( int  value)

show saturated for overflow in subframes in 32 bit mode (eiger only)

Parameters
value0 for do not show saturatd, 1 for show saturated (-1 gets)
Returns
overflow mode enable in 32 bit mode
int slsDetectorUsers::setParallelMode ( int  value)

sets parallel mode

Parameters
value0 for non parallel, 1 for parallel, 2 for safe mode (-1 gets)
Returns
gets parallel mode
int slsDetectorUsers::setPositions ( int  nPos,
double *  pos 
)

set positions for the acquisition

Parameters
nPosnumber of positions
posarray with the encoder positions
Returns
number of positions
std::string slsDetectorUsers::setReceiverDataStreamingOutIP ( std::string  ip = "")

(for expert users) Set/Get receiver streaming out ZMQ IP By default, it is the IP of receiver hostname

Parameters
ipsets, empty std::string gets
Returns
receiver streaming out ZMQ IP
int slsDetectorUsers::setReceiverDataStreamingOutPort ( int  i = -1)

(for expert users) Set/Get receiver streaming out ZMQ port For multi modules, it calculates (increments), sets the ports and restarts the sockets

Parameters
isets, -1 gets
Returns
receiver streaming out ZMQ port (if multiple, of first receiver socket)
int slsDetectorUsers::setReceiverFifoDepth ( int  i = -1)

set receiver fifo depth

Parameters
inumber of images in fifo depth (-1 gets)
Returns
receiver fifo depth
std::string slsDetectorUsers::setReceiverFramesDiscardPolicy ( std::string  f = "get")

Sets the frames discard policy in receiver frame discard policy options:

Parameters
fnodiscard (default),discardempty, discardpartial (fastest), get to get the value
Returns
f nodiscard (default),discardempty, discardpartial (fastest)
int slsDetectorUsers::setReceiverFramesPerFile ( int  f = -1)

Sets the frames per file in receiver

Parameters
fframes per file, 0 is infinite ie. every frame in same file (-1 gets)
Returns
frames per file
int slsDetectorUsers::setReceiverMode ( int  n = -1)

sets the mode by which gui requests data from receiver

Parameters
nis 0 for random requests for fast acquisitions and greater than 0 for nth read requests
Returns
the mode set in the receiver
int slsDetectorUsers::setReceiverOnline ( int const  online = -1)

sets the receivers onlineFlag

Parameters
onlinecan be: -1 returns wether the receiver is in online (1) or offline (0) state; 0 receiver in offline state; 1 receiver in online state
Returns
0 (offline) or 1 (online)
int slsDetectorUsers::setReceiverPartialFramesPadding ( int  f = -1)

Sets the frame padding in receiver

Parameters
f0 does not partial frames, 1 pads partial frames (-1 gets)
Returns
partial frames padding enable
int slsDetectorUsers::setReceiverSilentMode ( int  i)

set receiver in silent mode

Parameters
i1 sets, 0 unsets (-1 gets)
Returns
silent mode of receiver
int slsDetectorUsers::setROI ( int  n = -1,
slsDetectorDefs::ROI  roiLimits[] = NULL,
int  imod = -1 
)

Set ROI (Gotthard) (>= 1 roi, but max 1 roi per module) At the moment only one set allowed

Parameters
nnumber of rois
roiLimitsarray of roi
imodmodule number (-1 for all)
Returns
OK or FAIL
int slsDetectorUsers::setSettings ( int  isettings = -1)

set detector settings

Parameters
isettingssettings index (-1 gets)
Returns
current settings
int slsDetectorUsers::setStoragecellStart ( int  pos = -1)

Set storage cell that stores first acquisition of the series (Jungfrau)

Parameters
posstorage cell index. Value can be 0 to 15. Default is 15. (-1 gets)
Returns
the storage cell that stores the first acquisition of the series
double slsDetectorUsers::setSubFrameExposureDeadTime ( double  t = -1,
bool  inseconds = false,
int  imod = -1 
)

Set sub frame dead time (only for Eiger) Very advanced feature. Meant to be a constant in config file by an expert for each individual module

Parameters
tsub frame dead time (-1 gets)
insecondstrue if the value is in s, else ns
imodmodule number (-1 for all)
Returns
sub frame dead time in ns, or s if specified
double slsDetectorUsers::setSubFrameExposureTime ( double  t = -1,
bool  inseconds = false,
int  imod = -1 
)

Set sub frame exposure time (only for Eiger)

Parameters
tsub frame exposure time (-1 gets)
insecondstrue if the value is in s, else ns
imodmodule number (-1 for all)
Returns
sub frame exposure time in ns, or s if specified
int slsDetectorUsers::setTenGigabitEthernet ( int  i = -1)

enable/disable 10GbE (Eiger only)

Parameters
i1 sets, 0 unsets (-1 gets)
Returns
10GbE enable
int slsDetectorUsers::setThresholdEnergy ( int  e_eV)

set threshold energy

Parameters
e_eVthreshold in eV
Returns
current threshold value for imod in ev (-1 failed)
int slsDetectorUsers::setThresholdEnergy ( int  e_ev,
int  tb,
int  isettings = -1,
int  id = -1 
)

set threshold energy with choice to load trimbits (eiger only)

Parameters
e_evthreshold in ev
tb1 loads trimbits, 0 does not load trimbits
isettingssettings index (-1 uses current setting)
idmodule index (-1 for all)
Returns
current threshold value in ev (-1 failed)
int slsDetectorUsers::setTimingMode ( int  pol = -1)

set/get the external communication mode

Parameters
polvalue to be set
See Also
getTimingMode
Returns
current external communication mode
int slsDetectorUsers::startAcquisition ( )

start detector real time acquisition in non blocking mode does not include scans, scripts, incrementing file index, s tarting/stopping receiver, resetting frames caught in receiver

Returns
OK if all detectors are properly started, FAIL otherwise
void slsDetectorUsers::startMeasurement ( )

start measurement and acquires

Returns
OK/FAIL
int slsDetectorUsers::startReceiver ( )

start receiver listening mode

Returns
returns OK or FAIL
int slsDetectorUsers::stopAcquisition ( )

stop detector real time acquisition

Returns
OK if all detectors are properly started, FAIL otherwise
int slsDetectorUsers::stopMeasurement ( )

stop measurement

Returns
OK/FAIL
int slsDetectorUsers::stopReceiver ( )

stop receiver listening mode

Returns
returns OK or FAIL

The documentation for this class was generated from the following file: