areaDetector  3-13
EPICS areaDetector framework
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mythen Class Reference

Driver for sls array detectors using over TCP/IP socket. More...

Inheritance diagram for mythen:
ADDriver asynNDArrayDriver

Public Member Functions

 mythen (const char *portName, const char *IPPortName, int maxBuffers, size_t maxMemory, int priority, int stackSize)
 Constructor for mythen driver; most parameters are simply passed to ADDriver::ADDriver. More...
 
virtual asynStatus writeInt32 (asynUser *pasynUser, epicsInt32 value)
 Called when asyn clients call pasynInt32->write(). More...
 
virtual asynStatus writeFloat64 (asynUser *pasynUser, epicsFloat64 value)
 Called when asyn clients call pasynFloat64->write(). More...
 
virtual asynStatus writeOctet (asynUser *pasynUser, const char *value, size_t nChars, size_t *nActual)
 Called when asyn clients call pasynOctet->write(). More...
 
virtual void report (FILE *fp, int details)
 Report status of the driver. More...
 
epicsInt32 dataCallback (epicsInt32 *pData)
 
void pollTask ()
 
void acquisitionTask ()
 
void shutdown ()
 
- Public Member Functions inherited from ADDriver
 ADDriver (const char *portName, int maxAddr, int numParams, int maxBuffers, size_t maxMemory, int interfaceMask, int interruptMask, int asynFlags, int autoConnect, int priority, int stackSize)
 All of the arguments are simply passed to the constructor for the asynNDArrayDriver base class, except numParams. More...
 
virtual asynStatus connect (asynUser *pasynUser)
 Connects driver to device; This method is called when the driver's pasynCommon->connect() function is called. More...
 
virtual void setShutter (int open)
 Set the shutter position. More...
 
- Public Member Functions inherited from asynNDArrayDriver
 asynNDArrayDriver (const char *portName, int maxAddr, int maxBuffers, size_t maxMemory, int interfaceMask, int interruptMask, int asynFlags, int autoConnect, int priority, int stackSize)
 This is the constructor for the asynNDArrayDriver class. More...
 
virtual ~asynNDArrayDriver ()
 
virtual asynStatus readGenericPointer (asynUser *pasynUser, void *genericPointer)
 This method copies an NDArray object from the asynNDArrayDriver to an NDArray pointer passed in by the caller. More...
 
virtual asynStatus writeGenericPointer (asynUser *pasynUser, void *genericPointer)
 This method currently does nothing, but it should be implemented in this base class. More...
 
virtual asynStatus setIntegerParam (int index, int value)
 Sets the value for an integer in the parameter library. More...
 
virtual asynStatus setIntegerParam (int list, int index, int value)
 Sets the value for an integer in the parameter library. More...
 
virtual asynStatus createFilePath (const char *path, int pathDepth)
 Function to create a directory path for a file. More...
 
virtual asynStatus checkPath ()
 Checks whether the directory specified NDFilePath parameter exists. More...
 
virtual bool checkPath (std::string &filePath)
 Checks whether the directory specified exists. More...
 
virtual asynStatus createFileName (int maxChars, char *fullFileName)
 Build a file name from component parts. More...
 
virtual asynStatus createFileName (int maxChars, char *filePath, char *fileName)
 Build a file name from component parts. More...
 
virtual asynStatus readNDAttributesFile ()
 Create this driver's NDAttributeList (pAttributeList) by reading an XML file This clears any existing attributes from this drivers' NDAttributeList and then creates a new list based on the XML file. More...
 
virtual asynStatus getAttributes (NDAttributeList *pAttributeList)
 Get the current values of attributes from this driver and appends them to an output attribute list. More...
 
virtual void updateTimeStamps (NDArray *pArray)
 
asynStatus incrementQueuedArrayCount ()
 
asynStatus decrementQueuedArrayCount ()
 
int getQueuedArrayCount ()
 
void updateQueuedArrayCount ()
 

Protected Member Functions

virtual asynStatus setAcquire (epicsInt32 value)
 Starts and stops the acquisition. More...
 
virtual asynStatus setFCorrection (epicsInt32 value)
 Enables or disables the flatfield correction. More...
 
virtual asynStatus setRCorrection (epicsInt32 value)
 Enables or disables the rate correction. More...
 
virtual asynStatus setExposureTime (epicsFloat64 value)
 Sets the exposure time of one frame. More...
 
virtual asynStatus setDelayAfterTrigger (epicsFloat64 value)
 Sets the exposure time of one frame. More...
 
virtual asynStatus setBitDepth (epicsInt32 value)
 Enables or disables the flipping of the channel numbering. More...
 
virtual asynStatus setBadChanIntrpl (epicsInt32 value)
 Enables or disables the bad channel interpolation. More...
 
virtual asynStatus setUseGates (epicsInt32 value)
 Enables or disables the gates. More...
 
virtual asynStatus setNumGates (epicsInt32 value)
 Number of gates. More...
 
virtual asynStatus setKthresh (epicsFloat64 value)
 Sets the energy threshold for the module. More...
 
virtual asynStatus setEnergy (epicsFloat64 value)
 Sets the energy threshold for the module. More...
 
virtual asynStatus setTau (epicsFloat64 value)
 Sets the dead time constant for the rate correction. More...
 
virtual asynStatus setFrames (epicsInt32 value)
 Sets the number of frames whitin an acquisition. More...
 
virtual asynStatus setFlip (epicsInt32 value)
 Enables or disables the flipping of the channel numbering. More...
 
virtual asynStatus setTrigger (epicsInt32 value)
 Sets the Trigger Mode 0 = None, 1 = Single, 2=Continuous. More...
 
virtual asynStatus loadSettings (epicsInt32 value)
 Loads predefined settings for the current module to measure some common x-ray radiation. More...
 
virtual asynStatus setReset ()
 Sets the detector back to default settings. More...
 
virtual asynStatus getSettings ()
 Reads the values of all the modules parameters, sets them in the parameter library. More...
 
virtual epicsInt32 getStatus ()
 Get Acquition Status. More...
 
virtual asynStatus getFirmware ()
 Get Firmware Version. More...
 
void decodeRawReadout (int nmods, int nbits, int *data, int *result)
 

Protected Attributes

int SDSetting
 
int SDDelayTime
 
int SDThreshold
 
int SDEnergy
 
int SDUseFlatField
 
int SDUseCountRate
 
int SDUseBadChanIntrpl
 
int SDBitDepth
 
int SDUseGates
 
int SDNumGates
 
int SDNumCycles
 
int SDNumFrames
 
int SDTrigger
 
int SDReset
 
int SDTau
 
int SDFirmwareVersion
 
int SDReadMode
 
int SDNModules
 
- Protected Attributes inherited from ADDriver
int ADGain
 
int ADBinX
 
int ADBinY
 
int ADMinX
 
int ADMinY
 
int ADSizeX
 
int ADSizeY
 
int ADMaxSizeX
 
int ADMaxSizeY
 
int ADReverseX
 
int ADReverseY
 
int ADFrameType
 
int ADImageMode
 
int ADNumExposures
 
int ADNumExposuresCounter
 
int ADNumImages
 
int ADNumImagesCounter
 
int ADAcquireTime
 
int ADAcquirePeriod
 
int ADTimeRemaining
 
int ADStatus
 
int ADTriggerMode
 
int ADShutterControl
 
int ADShutterControlEPICS
 
int ADShutterStatus
 
int ADShutterMode
 
int ADShutterOpenDelay
 
int ADShutterCloseDelay
 
int ADTemperature
 
int ADTemperatureActual
 
int ADReadStatus
 
int ADStatusMessage
 
int ADStringToServer
 
int ADStringFromServer
 
bool deviceIsReachable
 
- Protected Attributes inherited from asynNDArrayDriver
int NDPortNameSelf
 
int NDADCoreVersion
 
int NDDriverVersion
 
int ADManufacturer
 
int ADModel
 
int ADSerialNumber
 
int ADSDKVersion
 
int ADFirmwareVersion
 
int ADAcquire
 
int ADAcquireBusy
 
int ADWaitForPlugins
 
int NDArraySizeX
 
int NDArraySizeY
 
int NDArraySizeZ
 
int NDArraySize
 
int NDNDimensions
 
int NDDimensions
 
int NDDataType
 
int NDColorMode
 
int NDUniqueId
 
int NDTimeStamp
 
int NDEpicsTSSec
 
int NDEpicsTSNsec
 
int NDBayerPattern
 
int NDCodec
 
int NDCompressedSize
 
int NDArrayCounter
 
int NDFilePath
 
int NDFilePathExists
 
int NDFileName
 
int NDFileNumber
 
int NDFileTemplate
 
int NDAutoIncrement
 
int NDFullFileName
 
int NDFileFormat
 
int NDAutoSave
 
int NDWriteFile
 
int NDReadFile
 
int NDFileWriteMode
 
int NDFileWriteStatus
 
int NDFileWriteMessage
 
int NDFileNumCapture
 
int NDFileNumCaptured
 
int NDFileFreeCapture
 
int NDFileCapture
 
int NDFileDeleteDriverFile
 
int NDFileLazyOpen
 
int NDFileCreateDir
 
int NDFileTempSuffix
 
int NDAttributesFile
 
int NDAttributesStatus
 
int NDAttributesMacros
 
int NDArrayData
 
int NDArrayCallbacks
 
int NDPoolMaxBuffers
 
int NDPoolAllocBuffers
 
int NDPoolPreAllocBuffers
 
int NDPoolNumPreAllocBuffers
 
int NDPoolFreeBuffers
 
int NDPoolMaxMemory
 
int NDPoolUsedMemory
 
int NDPoolEmptyFreeList
 
int NDPoolPollStats
 
int NDNumQueuedArrays
 
class NDArray ** pArrays
 An array of NDArray pointers used to store data in the driver. More...
 
class NDAttributeListpAttributeList
 An NDAttributeList object used to obtain the current values of a set of attributes. More...
 
int threadStackSize_
 
int threadPriority_
 

Additional Inherited Members

- Public Attributes inherited from asynNDArrayDriver
class NDArrayPoolpNDArrayPool
 An NDArrayPool pointer that is initialized to pNDArrayPoolPvt_ in the constructor. More...
 

Detailed Description

Driver for sls array detectors using over TCP/IP socket.

Constructor & Destructor Documentation

◆ mythen()

mythen::mythen ( const char *  portName,
const char *  IPPortName,
int  maxBuffers,
size_t  maxMemory,
int  priority,
int  stackSize 
)

Constructor for mythen driver; most parameters are simply passed to ADDriver::ADDriver.

After calling the base class constructor this method creates a thread to collect the detector data, and sets reasonable default values for the parameters defined in this class, asynNDArrayDriver, and ADDriver.

Parameters
[in]portNameThe name of the asyn port driver to be created.
[in]IPPortNameThe asyn network port connection to the Mythen
[in]maxBuffersThe maximum number of NDArray buffers that the NDArrayPool for this driver is allowed to allocate. Set this to -1 to allow an unlimited number of buffers.
[in]maxMemoryThe maximum amount of memory that the NDArrayPool for this driver is allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
[in]priorityThe thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
[in]stackSizeThe stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.

Member Function Documentation

◆ acquisitionTask()

void mythen::acquisitionTask ( )

◆ dataCallback()

epicsInt32 mythen::dataCallback ( epicsInt32 *  pData)

◆ decodeRawReadout()

void mythen::decodeRawReadout ( int  nmods,
int  nbits,
int *  data,
int *  result 
)
protected

◆ getFirmware()

asynStatus mythen::getFirmware ( )
protectedvirtual

Get Firmware Version.

◆ getSettings()

asynStatus mythen::getSettings ( )
protectedvirtual

Reads the values of all the modules parameters, sets them in the parameter library.

◆ getStatus()

epicsInt32 mythen::getStatus ( )
protectedvirtual

Get Acquition Status.

◆ loadSettings()

asynStatus mythen::loadSettings ( epicsInt32  value)
protectedvirtual

Loads predefined settings for the current module to measure some common x-ray radiation.

The command loads the energy calibration, the bad channels file, the flatfield correction, and the trimbits for the corresponding settings, and sets the energy threshold to a suitable value.

◆ pollTask()

void mythen::pollTask ( void  )

◆ report()

void mythen::report ( FILE *  fp,
int  details 
)
virtual

Report status of the driver.

Prints details about the driver if details>0. It then calls the ADDriver::report() method.

Parameters
[in]fpFile pointed passed by caller where the output is written to.
[in]detailsIf >0 then driver details are printed.

Reimplemented from asynNDArrayDriver.

◆ setAcquire()

asynStatus mythen::setAcquire ( epicsInt32  value)
protectedvirtual

Starts and stops the acquisition.

◆ setBadChanIntrpl()

asynStatus mythen::setBadChanIntrpl ( epicsInt32  value)
protectedvirtual

Enables or disables the bad channel interpolation.

◆ setBitDepth()

asynStatus mythen::setBitDepth ( epicsInt32  value)
protectedvirtual

Enables or disables the flipping of the channel numbering.

◆ setDelayAfterTrigger()

asynStatus mythen::setDelayAfterTrigger ( epicsFloat64  value)
protectedvirtual

Sets the exposure time of one frame.

(units of 100ns)

◆ setEnergy()

asynStatus mythen::setEnergy ( epicsFloat64  value)
protectedvirtual

Sets the energy threshold for the module.

◆ setExposureTime()

asynStatus mythen::setExposureTime ( epicsFloat64  value)
protectedvirtual

Sets the exposure time of one frame.

(units of 100ns)

◆ setFCorrection()

asynStatus mythen::setFCorrection ( epicsInt32  value)
protectedvirtual

Enables or disables the flatfield correction.

After initialisation the flatfield correction is enabled.

◆ setFlip()

asynStatus mythen::setFlip ( epicsInt32  value)
protectedvirtual

Enables or disables the flipping of the channel numbering.

◆ setFrames()

asynStatus mythen::setFrames ( epicsInt32  value)
protectedvirtual

Sets the number of frames whitin an acquisition.

◆ setKthresh()

asynStatus mythen::setKthresh ( epicsFloat64  value)
protectedvirtual

Sets the energy threshold for the module.

◆ setNumGates()

asynStatus mythen::setNumGates ( epicsInt32  value)
protectedvirtual

Number of gates.

◆ setRCorrection()

asynStatus mythen::setRCorrection ( epicsInt32  value)
protectedvirtual

Enables or disables the rate correction.

After initialisation the rate correction is disabled.

◆ setReset()

asynStatus mythen::setReset ( )
protectedvirtual

Sets the detector back to default settings.

This command takes about two seconds per module.

◆ setTau()

asynStatus mythen::setTau ( epicsFloat64  value)
protectedvirtual

Sets the dead time constant for the rate correction.

◆ setTrigger()

asynStatus mythen::setTrigger ( epicsInt32  value)
protectedvirtual

Sets the Trigger Mode 0 = None, 1 = Single, 2=Continuous.

◆ setUseGates()

asynStatus mythen::setUseGates ( epicsInt32  value)
protectedvirtual

Enables or disables the gates.

After initialisation the gates are disabled.

◆ shutdown()

void mythen::shutdown ( void  )

◆ writeFloat64()

asynStatus mythen::writeFloat64 ( asynUser *  pasynUser,
epicsFloat64  value 
)
virtual

Called when asyn clients call pasynFloat64->write().

For all parameters it sets the value in the parameter library and calls any registered callbacks.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueValue to write.

◆ writeInt32()

asynStatus mythen::writeInt32 ( asynUser *  pasynUser,
epicsInt32  value 
)
virtual

Called when asyn clients call pasynInt32->write().

This function performs actions for some parameters, including ADAcquire, ADBinX, etc. For all parameters it sets the value in the parameter library and calls any registered callbacks..

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueValue to write.

Reimplemented from ADDriver.

◆ writeOctet()

asynStatus mythen::writeOctet ( asynUser *  pasynUser,
const char *  value,
size_t  nChars,
size_t *  nActual 
)
virtual

Called when asyn clients call pasynOctet->write().

For all parameters it sets the value in the parameter library and calls any registered callbacks..

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueValue to write.
[in]nCharsNumber of characters to write
[out]nActualNumber of characters actually written

Reimplemented from asynNDArrayDriver.

Member Data Documentation

◆ SDBitDepth

int mythen::SDBitDepth
protected

◆ SDDelayTime

int mythen::SDDelayTime
protected

◆ SDEnergy

int mythen::SDEnergy
protected

◆ SDFirmwareVersion

int mythen::SDFirmwareVersion
protected

◆ SDNModules

int mythen::SDNModules
protected

◆ SDNumCycles

int mythen::SDNumCycles
protected

◆ SDNumFrames

int mythen::SDNumFrames
protected

◆ SDNumGates

int mythen::SDNumGates
protected

◆ SDReadMode

int mythen::SDReadMode
protected

◆ SDReset

int mythen::SDReset
protected

◆ SDSetting

int mythen::SDSetting
protected

◆ SDTau

int mythen::SDTau
protected

◆ SDThreshold

int mythen::SDThreshold
protected

◆ SDTrigger

int mythen::SDTrigger
protected

◆ SDUseBadChanIntrpl

int mythen::SDUseBadChanIntrpl
protected

◆ SDUseCountRate

int mythen::SDUseCountRate
protected

◆ SDUseFlatField

int mythen::SDUseFlatField
protected

◆ SDUseGates

int mythen::SDUseGates
protected

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