mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +02:00
cretated the class slsDetectorDefs, more advanced funcs moved from slsDetectorBase to slsDetectorUtils, separated function index enum from other definitions (share with dectris?)
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@162 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -29,7 +29,17 @@ and to the server programs running on the detector
|
||||
/** get flag form most functions */
|
||||
#define GET_FLAG -1
|
||||
|
||||
enum {startScript, scriptBefore, headerBefore, headerAfter,scriptAfter, stopScript, MAX_ACTIONS};
|
||||
#ifdef __cplusplus
|
||||
class slsDetectorDefs {
|
||||
|
||||
public:
|
||||
|
||||
slsDetectorDefs(){};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
enum {startScript, scriptBefore, headerBefore, headerAfter,scriptAfter, stopScript, MAX_ACTIONS};
|
||||
|
||||
|
||||
|
||||
@ -39,28 +49,28 @@ enum {startScript, scriptBefore, headerBefore, headerAfter,scriptAfter, stopScri
|
||||
|
||||
\see ::channelRegisterBit
|
||||
*/
|
||||
typedef struct {
|
||||
int chan; /**< is the channel number */
|
||||
int chip; /**< is the chip number */
|
||||
int module; /**< is the module number */
|
||||
int64_t reg; /**< is the is the channel register (e.g. trimbits, calibration enable, comparator enable...) */
|
||||
} sls_detector_channel;
|
||||
|
||||
/**
|
||||
typedef struct {
|
||||
int chan; /**< is the channel number */
|
||||
int chip; /**< is the chip number */
|
||||
int module; /**< is the module number */
|
||||
int64_t reg; /**< is the is the channel register (e.g. trimbits, calibration enable, comparator enable...) */
|
||||
} sls_detector_channel;
|
||||
|
||||
/**
|
||||
structure for a detector chip
|
||||
should not be used by unexperienced users
|
||||
\see ::chipRegisterBit ::channelRegisterBit
|
||||
*/
|
||||
typedef struct {
|
||||
int chip; /**< is the chip number */
|
||||
int module; /**< is the module number */
|
||||
int nchan; /**< is the number of channels in the chip */
|
||||
int reg; /**<is the chip register (e.g. output analogue buffer enable)
|
||||
\see ::chipRegisterBit */
|
||||
int *chanregs; /**< is the pointer to the array of the channel registers
|
||||
\see ::channelRegisterBit */
|
||||
} sls_detector_chip;
|
||||
|
||||
typedef struct {
|
||||
int chip; /**< is the chip number */
|
||||
int module; /**< is the module number */
|
||||
int nchan; /**< is the number of channels in the chip */
|
||||
int reg; /**<is the chip register (e.g. output analogue buffer enable)
|
||||
\see ::chipRegisterBit */
|
||||
int *chanregs; /**< is the pointer to the array of the channel registers
|
||||
\see ::channelRegisterBit */
|
||||
} sls_detector_chip;
|
||||
|
||||
/**
|
||||
structure for a detector module
|
||||
should not be used by unexperienced users
|
||||
@ -443,118 +453,6 @@ enum imageType {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
function indexes to call on the server
|
||||
|
||||
|
||||
All set functions with argument -1 work as get, when possible
|
||||
|
||||
*/
|
||||
|
||||
enum {
|
||||
|
||||
// General purpose functions
|
||||
F_EXEC_COMMAND=0, /**< command is executed */
|
||||
F_GET_ERROR, /**< return detector error status */
|
||||
|
||||
// configuration functions
|
||||
F_GET_DETECTOR_TYPE, /**< return detector type */
|
||||
F_SET_NUMBER_OF_MODULES, /**< set/get number of installed modules */
|
||||
F_GET_MAX_NUMBER_OF_MODULES, /**< get maximum number of installed modules */
|
||||
F_SET_EXTERNAL_SIGNAL_FLAG, /**< set/get flag for external signal */
|
||||
F_SET_EXTERNAL_COMMUNICATION_MODE, /**< set/get external communication mode (obsolete) */
|
||||
|
||||
|
||||
// Tests and identification
|
||||
|
||||
F_GET_ID, /**< get detector id of version */
|
||||
F_DIGITAL_TEST, /**< digital test of the detector */
|
||||
F_ANALOG_TEST, /**<analog test of the detector */
|
||||
F_ENABLE_ANALOG_OUT, /**<enable the analog output */
|
||||
F_CALIBRATION_PULSE, /**<pulse the calibration input */
|
||||
|
||||
// Initialization functions
|
||||
F_SET_DAC, /**< set DAC value */
|
||||
F_GET_ADC, /**< get ADC value */
|
||||
F_WRITE_REGISTER, /**< write to register */
|
||||
F_READ_REGISTER, /**< read register */
|
||||
F_WRITE_MEMORY, /**< write to memory */
|
||||
F_READ_MEMORY, /**< read memory */
|
||||
|
||||
|
||||
F_SET_CHANNEL, /**< initialize channel */
|
||||
F_GET_CHANNEL, /**< get channel register */
|
||||
F_SET_ALL_CHANNELS, /**< initialize all channels */
|
||||
|
||||
F_SET_CHIP, /**< initialize chip */
|
||||
F_GET_CHIP, /**< get chip status */
|
||||
F_SET_ALL_CHIPS, /**< initialize all chips */
|
||||
|
||||
F_SET_MODULE, /**< initialize module */
|
||||
F_GET_MODULE, /**< get module status */
|
||||
F_SET_ALL_MODULES, /**< initialize all modules */
|
||||
|
||||
|
||||
F_SET_SETTINGS, /**< set detector settings */
|
||||
F_GET_THRESHOLD_ENERGY, /**< get detector threshold (in eV) */
|
||||
F_SET_THRESHOLD_ENERGY, /**< set detector threshold (in eV) */
|
||||
|
||||
|
||||
// Acquisition functions
|
||||
F_START_ACQUISITION, /**< start acquisition */
|
||||
F_STOP_ACQUISITION, /**< stop acquisition */
|
||||
F_START_READOUT, /**< start readout */
|
||||
F_GET_RUN_STATUS, /**< get acquisition status */
|
||||
F_START_AND_READ_ALL, /**< start acquisition and read all frames*/
|
||||
F_READ_FRAME, /**< read one frame */
|
||||
F_READ_ALL, /**< read alla frames */
|
||||
|
||||
//Acquisition setup functions
|
||||
F_SET_TIMER, /**< set/get timer value */
|
||||
F_GET_TIME_LEFT, /**< get current value of the timer (time left) */
|
||||
|
||||
|
||||
|
||||
F_SET_DYNAMIC_RANGE, /**< set/get detector dynamic range */
|
||||
F_SET_READOUT_FLAGS, /**< set/get readout flags */
|
||||
F_SET_ROI, /**< set/get region of interest */
|
||||
|
||||
F_SET_SPEED, /**< set/get readout speed parameters */
|
||||
|
||||
//Trimming
|
||||
F_EXECUTE_TRIMMING, /**< execute trimming */
|
||||
|
||||
F_EXIT_SERVER, /**< turn off detector server */
|
||||
|
||||
F_LOCK_SERVER, /**< Locks/Unlocks server communication to the given client */
|
||||
|
||||
F_GET_LAST_CLIENT_IP, /**< returns the IP of the client last connected to the detector */
|
||||
|
||||
F_SET_PORT, /**< Changes communication port of the server */
|
||||
|
||||
F_UPDATE_CLIENT, /**< Returns all the important parameters to update the shared memory of the client */
|
||||
|
||||
F_CONFIGURE_MAC, /**< Configures MAC for Gotthard readout */
|
||||
|
||||
F_LOAD_IMAGE, /**< Loads Dark/Gain image to the Gotthard detector */
|
||||
|
||||
// multi detector structures
|
||||
|
||||
F_SET_MASTER, /**< sets master/slave flag for multi detector structures */
|
||||
|
||||
F_SET_SYNCHRONIZATION_MODE, /**< sets master/slave synchronization mode for multidetector structures */
|
||||
|
||||
// not multi detector
|
||||
|
||||
F_READ_COUNTER_BLOCK, /**< reads counter memory block for the Gotthard detector */
|
||||
|
||||
F_RESET_COUNTER_BLOCK /**< resets counter memory block for the Gotthard detector */
|
||||
|
||||
/* Always append functions hereafter!!! */
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
angular conversion constant for a module
|
||||
*/
|
||||
@ -580,4 +478,15 @@ enum angleConversionParameter {
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
protected:
|
||||
#endif
|
||||
|
||||
#include "sls_detector_funcs.h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
108
slsDetectorSoftware/commonFiles/sls_detector_funcs.h
Normal file
108
slsDetectorSoftware/commonFiles/sls_detector_funcs.h
Normal file
@ -0,0 +1,108 @@
|
||||
/**
|
||||
@internal
|
||||
|
||||
function indexes to call on the server
|
||||
All set functions with argument -1 work as get, when possible
|
||||
|
||||
*/
|
||||
|
||||
enum {
|
||||
|
||||
// General purpose functions
|
||||
F_EXEC_COMMAND=0, /**< command is executed */
|
||||
F_GET_ERROR, /**< return detector error status */
|
||||
|
||||
// configuration functions
|
||||
F_GET_DETECTOR_TYPE, /**< return detector type */
|
||||
F_SET_NUMBER_OF_MODULES, /**< set/get number of installed modules */
|
||||
F_GET_MAX_NUMBER_OF_MODULES, /**< get maximum number of installed modules */
|
||||
F_SET_EXTERNAL_SIGNAL_FLAG, /**< set/get flag for external signal */
|
||||
F_SET_EXTERNAL_COMMUNICATION_MODE, /**< set/get external communication mode (obsolete) */
|
||||
|
||||
|
||||
// Tests and identification
|
||||
|
||||
F_GET_ID, /**< get detector id of version */
|
||||
F_DIGITAL_TEST, /**< digital test of the detector */
|
||||
F_ANALOG_TEST, /**<analog test of the detector */
|
||||
F_ENABLE_ANALOG_OUT, /**<enable the analog output */
|
||||
F_CALIBRATION_PULSE, /**<pulse the calibration input */
|
||||
|
||||
// Initialization functions
|
||||
F_SET_DAC, /**< set DAC value */
|
||||
F_GET_ADC, /**< get ADC value */
|
||||
F_WRITE_REGISTER, /**< write to register */
|
||||
F_READ_REGISTER, /**< read register */
|
||||
F_WRITE_MEMORY, /**< write to memory */
|
||||
F_READ_MEMORY, /**< read memory */
|
||||
|
||||
|
||||
F_SET_CHANNEL, /**< initialize channel */
|
||||
F_GET_CHANNEL, /**< get channel register */
|
||||
F_SET_ALL_CHANNELS, /**< initialize all channels */
|
||||
|
||||
F_SET_CHIP, /**< initialize chip */
|
||||
F_GET_CHIP, /**< get chip status */
|
||||
F_SET_ALL_CHIPS, /**< initialize all chips */
|
||||
|
||||
F_SET_MODULE, /**< initialize module */
|
||||
F_GET_MODULE, /**< get module status */
|
||||
F_SET_ALL_MODULES, /**< initialize all modules */
|
||||
|
||||
|
||||
F_SET_SETTINGS, /**< set detector settings */
|
||||
F_GET_THRESHOLD_ENERGY, /**< get detector threshold (in eV) */
|
||||
F_SET_THRESHOLD_ENERGY, /**< set detector threshold (in eV) */
|
||||
|
||||
|
||||
// Acquisition functions
|
||||
F_START_ACQUISITION, /**< start acquisition */
|
||||
F_STOP_ACQUISITION, /**< stop acquisition */
|
||||
F_START_READOUT, /**< start readout */
|
||||
F_GET_RUN_STATUS, /**< get acquisition status */
|
||||
F_START_AND_READ_ALL, /**< start acquisition and read all frames*/
|
||||
F_READ_FRAME, /**< read one frame */
|
||||
F_READ_ALL, /**< read alla frames */
|
||||
|
||||
//Acquisition setup functions
|
||||
F_SET_TIMER, /**< set/get timer value */
|
||||
F_GET_TIME_LEFT, /**< get current value of the timer (time left) */
|
||||
|
||||
|
||||
|
||||
F_SET_DYNAMIC_RANGE, /**< set/get detector dynamic range */
|
||||
F_SET_READOUT_FLAGS, /**< set/get readout flags */
|
||||
F_SET_ROI, /**< set/get region of interest */
|
||||
|
||||
F_SET_SPEED, /**< set/get readout speed parameters */
|
||||
|
||||
//Trimming
|
||||
F_EXECUTE_TRIMMING, /**< execute trimming */
|
||||
|
||||
F_EXIT_SERVER, /**< turn off detector server */
|
||||
|
||||
F_LOCK_SERVER, /**< Locks/Unlocks server communication to the given client */
|
||||
|
||||
F_GET_LAST_CLIENT_IP, /**< returns the IP of the client last connected to the detector */
|
||||
|
||||
F_SET_PORT, /**< Changes communication port of the server */
|
||||
|
||||
F_UPDATE_CLIENT, /**< Returns all the important parameters to update the shared memory of the client */
|
||||
|
||||
F_CONFIGURE_MAC, /**< Configures MAC for Gotthard readout */
|
||||
|
||||
F_LOAD_IMAGE, /**< Loads Dark/Gain image to the Gotthard detector */
|
||||
|
||||
// multi detector structures
|
||||
|
||||
F_SET_MASTER, /**< sets master/slave flag for multi detector structures */
|
||||
|
||||
F_SET_SYNCHRONIZATION_MODE /**< sets master/slave synchronization mode for multidetector structures */
|
||||
|
||||
|
||||
/* Always append functions hereafter!!! */
|
||||
|
||||
};
|
||||
|
||||
|
||||
/** @endinternal */
|
Reference in New Issue
Block a user