areaDetector  3-12-1
EPICS areaDetector framework
Public Member Functions | Protected Attributes | List of all members
SpecsAnalyser Class Reference

#include <specsAnalyser.h>

Inheritance diagram for SpecsAnalyser:
ADDriver asynNDArrayDriver

Public Member Functions

 SpecsAnalyser (const char *portName, const char *driverPort, int maxBuffers, size_t maxMemory, int priority, int stackSize)
 
virtual ~SpecsAnalyser ()
 specsAnalyser destructor More...
 
void specsAnalyserTask ()
 Task to listen to the SPECS prodigy application and update the higher level software. More...
 
asynStatus makeConnection ()
 
asynStatus connect ()
 
asynStatus disconnect ()
 
asynStatus readEnum (asynUser *pasynUser, char *strings[], int values[], int severities[], size_t nElements, size_t *nIn)
 Called when asyn clients call pasynEnum->read(). More...
 
asynStatus writeInt32 (asynUser *pasynUser, epicsInt32 value)
 Called when asyn clients call pasynInt32->write(). More...
 
asynStatus writeFloat64 (asynUser *pasynUser, epicsFloat64 value)
 Called when asyn clients call pasynFloat64->write(). More...
 
asynStatus validateSpectrum ()
 Validate the currently defined spectrum. More...
 
asynStatus defineSpectrumFAT ()
 Define a Fixed Analyser Transmission spectrum. More...
 
asynStatus defineSpectrumSFAT ()
 Define a Snapshot Fixed Analyser Transmission spectrum. More...
 
asynStatus defineSpectrumFRR ()
 
asynStatus defineSpectrumFE ()
 
asynStatus readAcquisitionData (int startIndex, int endIndex, std::vector< double > &values)
 
asynStatus sendStartCommand (bool safeAfter)
 Send the start command to the analyser. More...
 
asynStatus sendSimpleCommand (const std::string &command, std::map< std::string, std::string > *data=NULL)
 Method for sending a simple command (no parameters) that will check the error status and do the right thing. More...
 
asynStatus readDeviceVisibleName ()
 This method queries the analyser for its device name to populate the ADModel parameter. More...
 
asynStatus setupEPICSParameters ()
 This method sets up the analyser parameters that are not known prior to connecting to the device. More...
 
asynStatus getAnalyserParameterType (const std::string &name, SPECSValueType_t &value)
 
asynStatus getAnalyserParameter (const std::string &name, int &value)
 
asynStatus getAnalyserParameter (const std::string &name, double &value)
 
asynStatus getAnalyserParameter (const std::string &name, std::string &value)
 
asynStatus getAnalyserParameter (const std::string &name, bool &value)
 
asynStatus setAnalyserParameter (const std::string &name, int value)
 
asynStatus setAnalyserParameter (const std::string &name, double value)
 
asynStatus setAnalyserParameter (const std::string &name, std::string value)
 
asynStatus readIntegerData (std::map< std::string, std::string > data, const std::string &name, int &value)
 
asynStatus readDoubleData (std::map< std::string, std::string > data, const std::string &name, double &value)
 
asynStatus readSpectrumParameter (int param)
 
asynStatus readRunModes ()
 
asynStatus readSpectrumDataInfo (SPECSDataInfoParam_t param)
 Send the GetSpectrumDataInfo method to query the spectrum metadata. More...
 
asynStatus asynPortConnect (const char *port, int addr, asynUser **ppasynUser, const char *inputEos, const char *outputEos)
 Connect to the underlying low level Asyn port that is used for comms. More...
 
asynStatus asynPortDisconnect (asynUser *pasynUser)
 
asynStatus commandResponse (const std::string &command, std::string &response, std::map< std::string, std::string > &data)
 This sends a command to the device and parses the response. More...
 
asynStatus asynWriteRead (const char *command, char *response)
 Wrapper for asynOctetSyncIO write/read functions. More...
 
asynStatus cleanString (std::string &str, const std::string &search=": \n", int where=0)
 Utility function, returns strings with unwanted characters stripped. More...
 
asynStatus initDebugger (int initDebug)
 
asynStatus debugLevel (const std::string &method, int onOff)
 
asynStatus debug (const std::string &method, const std::string &msg)
 
asynStatus debug (const std::string &method, const std::string &msg, int value)
 
asynStatus debug (const std::string &method, const std::string &msg, double value)
 
asynStatus debug (const std::string &method, const std::string &msg, const std::string &value)
 
asynStatus debug (const std::string &method, const std::string &msg, std::map< std::string, std::string > value)
 
asynStatus debug (const std::string &method, const std::string &msg, std::map< int, std::string > value)
 
- 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 writeOctet (asynUser *pasynUser, const char *value, size_t maxChars, size_t *nActual)
 Called when asyn clients call pasynOctet->write(). More...
 
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 readInt32 (asynUser *pasynUser, epicsInt32 *value)
 
virtual asynStatus readFloat64 (asynUser *pasynUser, epicsFloat64 *value)
 
virtual void report (FILE *fp, int details)
 Report status of the driver. 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...
 
asynStatus incrementQueuedArrayCount ()
 
asynStatus decrementQueuedArrayCount ()
 
int getQueuedArrayCount ()
 
void updateQueuedArrayCount ()
 

Protected Attributes

int SPECSConnect_
 
int SPECSConnected_
 
int SPECSPauseAcq_
 
int SPECSMsgCounter_
 
int SPECSServerName_
 
int SPECSProtocolVersion_
 
int SPECSProtocolVersionMinor_
 
int SPECSProtocolVersionMajor_
 
int SPECSStartEnergy_
 
int SPECSEndEnergy_
 
int SPECSRetardingRatio_
 
int SPECSKineticEnergy_
 
int SPECSStepWidth_
 
int SPECSSamples_
 
int SPECSSamplesIteration_
 
int SPECSSnapshotValues_
 
int SPECSPassEnergy_
 
int SPECSLensMode_
 
int SPECSScanRange_
 
int SPECSCurrentSample_
 
int SPECSPercentComplete_
 
int SPECSRemainingTime_
 
int SPECSCurrentSampleIteration_
 
int SPECSPercentCompleteIteration_
 
int SPECSRemainingTimeIteration_
 
int SPECSAcqSpectrum_
 
int SPECSAcqImage_
 
int SPECSRunMode_
 
int SPECSDefine_
 
int SPECSValidate_
 
int SPECSNonEnergyChannels_
 
int SPECSNonEnergyUnits_
 
int SPECSNonEnergyMin_
 
int SPECSNonEnergyMax_
 
int SPECSSafeState_
 
int SPECSDataDelayMax_
 
- 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 NDFileCapture
 
int NDFileDeleteDriverFile
 
int NDFileLazyOpen
 
int NDFileCreateDir
 
int NDFileTempSuffix
 
int NDAttributesFile
 
int NDAttributesStatus
 
int NDAttributesMacros
 
int NDArrayData
 
int NDArrayCallbacks
 
int NDPoolMaxBuffers
 
int NDPoolAllocBuffers
 
int NDPoolFreeBuffers
 
int NDPoolMaxMemory
 
int NDPoolUsedMemory
 
int NDPoolEmptyFreeList
 
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...
 

Constructor & Destructor Documentation

◆ SpecsAnalyser()

SpecsAnalyser::SpecsAnalyser ( const char *  portName,
const char *  driverPort,
int  maxBuffers,
size_t  maxMemory,
int  priority,
int  stackSize 
)

◆ ~SpecsAnalyser()

SpecsAnalyser::~SpecsAnalyser ( )
virtual

specsAnalyser destructor

Member Function Documentation

◆ asynPortConnect()

asynStatus SpecsAnalyser::asynPortConnect ( const char *  port,
int  addr,
asynUser **  ppasynUser,
const char *  inputEos,
const char *  outputEos 
)

Connect to the underlying low level Asyn port that is used for comms.

This uses the asynOctetSyncIO interface, and also sets the input and output terminators.

Parameters
port- Name of the port to connect to.
addr- Address to connect to.
ppasynUser- Pointer to the asyn user structure.
inputEos- String input EOS.
outputEos- String output EOS.

◆ asynPortDisconnect()

asynStatus SpecsAnalyser::asynPortDisconnect ( asynUser *  pasynUser)

◆ asynWriteRead()

asynStatus SpecsAnalyser::asynWriteRead ( const char *  command,
char *  response 
)

Wrapper for asynOctetSyncIO write/read functions.

Parameters
command- String command to send.
response- String response back.

◆ cleanString()

asynStatus SpecsAnalyser::cleanString ( std::string &  str,
const std::string &  search = ": \n",
int  where = 0 
)

Utility function, returns strings with unwanted characters stripped.

Parameters
str- string parameter, the string to clean up, returned by reference
search- string parameter containing the set of characters to strip from str
where- integer parameter to control where characters are stripped - 1 to strip from start, 2 to strip from end, 0 to do both.

◆ commandResponse()

asynStatus SpecsAnalyser::commandResponse ( const std::string &  command,
std::string &  response,
std::map< std::string, std::string > &  data 
)

This sends a command to the device and parses the response.

Data is returned in a std::map that is indexed by the parameter name

Parameters
command- String command to send.
response- String response back (OK or ERROR)
data- Map of data items indexed by name

◆ connect()

asynStatus SpecsAnalyser::connect ( )

◆ debug() [1/6]

asynStatus SpecsAnalyser::debug ( const std::string &  method,
const std::string &  msg 
)

◆ debug() [2/6]

asynStatus SpecsAnalyser::debug ( const std::string &  method,
const std::string &  msg,
int  value 
)

◆ debug() [3/6]

asynStatus SpecsAnalyser::debug ( const std::string &  method,
const std::string &  msg,
double  value 
)

◆ debug() [4/6]

asynStatus SpecsAnalyser::debug ( const std::string &  method,
const std::string &  msg,
const std::string &  value 
)

◆ debug() [5/6]

asynStatus SpecsAnalyser::debug ( const std::string &  method,
const std::string &  msg,
std::map< std::string, std::string >  value 
)

◆ debug() [6/6]

asynStatus SpecsAnalyser::debug ( const std::string &  method,
const std::string &  msg,
std::map< int, std::string >  value 
)

◆ debugLevel()

asynStatus SpecsAnalyser::debugLevel ( const std::string &  method,
int  onOff 
)

◆ defineSpectrumFAT()

asynStatus SpecsAnalyser::defineSpectrumFAT ( )

Define a Fixed Analyser Transmission spectrum.

All of the desired parameters should have already been set, this method constructs the required command string from those parameters and sends it to the device.

◆ defineSpectrumFE()

asynStatus SpecsAnalyser::defineSpectrumFE ( )

◆ defineSpectrumFRR()

asynStatus SpecsAnalyser::defineSpectrumFRR ( )

◆ defineSpectrumSFAT()

asynStatus SpecsAnalyser::defineSpectrumSFAT ( )

Define a Snapshot Fixed Analyser Transmission spectrum.

All of the desired parameters should have already been set, this method constructs the required command string from those parameters and sends it to the device.

◆ disconnect()

asynStatus SpecsAnalyser::disconnect ( )

◆ getAnalyserParameter() [1/4]

asynStatus SpecsAnalyser::getAnalyserParameter ( const std::string &  name,
int &  value 
)

◆ getAnalyserParameter() [2/4]

asynStatus SpecsAnalyser::getAnalyserParameter ( const std::string &  name,
double &  value 
)

◆ getAnalyserParameter() [3/4]

asynStatus SpecsAnalyser::getAnalyserParameter ( const std::string &  name,
std::string &  value 
)

◆ getAnalyserParameter() [4/4]

asynStatus SpecsAnalyser::getAnalyserParameter ( const std::string &  name,
bool &  value 
)

◆ getAnalyserParameterType()

asynStatus SpecsAnalyser::getAnalyserParameterType ( const std::string &  name,
SPECSValueType_t value 
)

◆ initDebugger()

asynStatus SpecsAnalyser::initDebugger ( int  initDebug)

◆ makeConnection()

asynStatus SpecsAnalyser::makeConnection ( )

◆ readAcquisitionData()

asynStatus SpecsAnalyser::readAcquisitionData ( int  startIndex,
int  endIndex,
std::vector< double > &  values 
)

◆ readDeviceVisibleName()

asynStatus SpecsAnalyser::readDeviceVisibleName ( )

This method queries the analyser for its device name to populate the ADModel parameter.

◆ readDoubleData()

asynStatus SpecsAnalyser::readDoubleData ( std::map< std::string, std::string >  data,
const std::string &  name,
double &  value 
)

◆ readEnum()

asynStatus SpecsAnalyser::readEnum ( asynUser *  pasynUser,
char *  strings[],
int  values[],
int  severities[],
size_t  nElements,
size_t *  nIn 
)

Called when asyn clients call pasynEnum->read().

The base class implementation simply prints an error message.

Parameters
pasynUser- pasynUser structure that encodes the reason and address.
strings- Array of string pointers.
values- Array of values
severities- Array of severities
nElements- Size of value array
nIn- Number of elements actually returned

◆ readIntegerData()

asynStatus SpecsAnalyser::readIntegerData ( std::map< std::string, std::string >  data,
const std::string &  name,
int &  value 
)

◆ readRunModes()

asynStatus SpecsAnalyser::readRunModes ( )

◆ readSpectrumDataInfo()

asynStatus SpecsAnalyser::readSpectrumDataInfo ( SPECSDataInfoParam_t  param)

Send the GetSpectrumDataInfo method to query the spectrum metadata.

Currently only OrdinateRange is supported, which gives us the units and min/max of the non-energy axis. This method is new in protocol version 1.11 so in earlier versions we expect to receive an error message.

Parameters
param- Data Info parameter to request. Currently (v1.11) only OrdinateRange is supported.

◆ readSpectrumParameter()

asynStatus SpecsAnalyser::readSpectrumParameter ( int  param)

◆ sendSimpleCommand()

asynStatus SpecsAnalyser::sendSimpleCommand ( const std::string &  command,
std::map< std::string, std::string > *  data = NULL 
)

Method for sending a simple command (no parameters) that will check the error status and do the right thing.

◆ sendStartCommand()

asynStatus SpecsAnalyser::sendStartCommand ( bool  safeAfter)

Send the start command to the analyser.

◆ setAnalyserParameter() [1/3]

asynStatus SpecsAnalyser::setAnalyserParameter ( const std::string &  name,
int  value 
)

◆ setAnalyserParameter() [2/3]

asynStatus SpecsAnalyser::setAnalyserParameter ( const std::string &  name,
double  value 
)

◆ setAnalyserParameter() [3/3]

asynStatus SpecsAnalyser::setAnalyserParameter ( const std::string &  name,
std::string  value 
)

◆ setupEPICSParameters()

asynStatus SpecsAnalyser::setupEPICSParameters ( )

This method sets up the analyser parameters that are not known prior to connecting to the device.

◆ specsAnalyserTask()

void SpecsAnalyser::specsAnalyserTask ( )

Task to listen to the SPECS prodigy application and update the higher level software.

This function runs the polling thread. It is started in the class constructor and must not return until the IOC stops.

◆ validateSpectrum()

asynStatus SpecsAnalyser::validateSpectrum ( )

Validate the currently defined spectrum.

This validation must take place before a new acquisition can begin. The values defined for the acquisition can actually be altered by the validation so the read back values are written back into the parameters.

◆ writeFloat64()

asynStatus SpecsAnalyser::writeFloat64 ( asynUser *  pasynUser,
epicsFloat64  value 
)

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

Write integer value to the drivers parameter table.

Parameters
pasynUser- Pointer to the asyn user structure.
value- The new value to write

◆ writeInt32()

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

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

Write integer value to the drivers parameter table.

Parameters
pasynUser- Pointer to the asyn user structure.
value- The new value to write

Reimplemented from ADDriver.

Member Data Documentation

◆ SPECSAcqImage_

int SpecsAnalyser::SPECSAcqImage_
protected

◆ SPECSAcqSpectrum_

int SpecsAnalyser::SPECSAcqSpectrum_
protected

◆ SPECSConnect_

int SpecsAnalyser::SPECSConnect_
protected

◆ SPECSConnected_

int SpecsAnalyser::SPECSConnected_
protected

◆ SPECSCurrentSample_

int SpecsAnalyser::SPECSCurrentSample_
protected

◆ SPECSCurrentSampleIteration_

int SpecsAnalyser::SPECSCurrentSampleIteration_
protected

◆ SPECSDataDelayMax_

int SpecsAnalyser::SPECSDataDelayMax_
protected

◆ SPECSDefine_

int SpecsAnalyser::SPECSDefine_
protected

◆ SPECSEndEnergy_

int SpecsAnalyser::SPECSEndEnergy_
protected

◆ SPECSKineticEnergy_

int SpecsAnalyser::SPECSKineticEnergy_
protected

◆ SPECSLensMode_

int SpecsAnalyser::SPECSLensMode_
protected

◆ SPECSMsgCounter_

int SpecsAnalyser::SPECSMsgCounter_
protected

◆ SPECSNonEnergyChannels_

int SpecsAnalyser::SPECSNonEnergyChannels_
protected

◆ SPECSNonEnergyMax_

int SpecsAnalyser::SPECSNonEnergyMax_
protected

◆ SPECSNonEnergyMin_

int SpecsAnalyser::SPECSNonEnergyMin_
protected

◆ SPECSNonEnergyUnits_

int SpecsAnalyser::SPECSNonEnergyUnits_
protected

◆ SPECSPassEnergy_

int SpecsAnalyser::SPECSPassEnergy_
protected

◆ SPECSPauseAcq_

int SpecsAnalyser::SPECSPauseAcq_
protected

◆ SPECSPercentComplete_

int SpecsAnalyser::SPECSPercentComplete_
protected

◆ SPECSPercentCompleteIteration_

int SpecsAnalyser::SPECSPercentCompleteIteration_
protected

◆ SPECSProtocolVersion_

int SpecsAnalyser::SPECSProtocolVersion_
protected

◆ SPECSProtocolVersionMajor_

int SpecsAnalyser::SPECSProtocolVersionMajor_
protected

◆ SPECSProtocolVersionMinor_

int SpecsAnalyser::SPECSProtocolVersionMinor_
protected

◆ SPECSRemainingTime_

int SpecsAnalyser::SPECSRemainingTime_
protected

◆ SPECSRemainingTimeIteration_

int SpecsAnalyser::SPECSRemainingTimeIteration_
protected

◆ SPECSRetardingRatio_

int SpecsAnalyser::SPECSRetardingRatio_
protected

◆ SPECSRunMode_

int SpecsAnalyser::SPECSRunMode_
protected

◆ SPECSSafeState_

int SpecsAnalyser::SPECSSafeState_
protected

◆ SPECSSamples_

int SpecsAnalyser::SPECSSamples_
protected

◆ SPECSSamplesIteration_

int SpecsAnalyser::SPECSSamplesIteration_
protected

◆ SPECSScanRange_

int SpecsAnalyser::SPECSScanRange_
protected

◆ SPECSServerName_

int SpecsAnalyser::SPECSServerName_
protected

◆ SPECSSnapshotValues_

int SpecsAnalyser::SPECSSnapshotValues_
protected

◆ SPECSStartEnergy_

int SpecsAnalyser::SPECSStartEnergy_
protected

◆ SPECSStepWidth_

int SpecsAnalyser::SPECSStepWidth_
protected

◆ SPECSValidate_

int SpecsAnalyser::SPECSValidate_
protected

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