areaDetector
3-13
EPICS areaDetector framework
|
#include <specsAnalyser.h>
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 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... | |
virtual void | updateTimeStamps (NDArray *pArray) |
asynStatus | incrementQueuedArrayCount () |
asynStatus | decrementQueuedArrayCount () |
int | getQueuedArrayCount () |
void | updateQueuedArrayCount () |
Additional Inherited Members | |
Public Attributes inherited from asynNDArrayDriver | |
class NDArrayPool * | pNDArrayPool |
An NDArrayPool pointer that is initialized to pNDArrayPoolPvt_ in the constructor. More... | |
SpecsAnalyser::SpecsAnalyser | ( | const char * | portName, |
const char * | driverPort, | ||
int | maxBuffers, | ||
size_t | maxMemory, | ||
int | priority, | ||
int | stackSize | ||
) |
|
virtual |
specsAnalyser destructor
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.
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. |
asynStatus SpecsAnalyser::asynPortDisconnect | ( | asynUser * | pasynUser | ) |
asynStatus SpecsAnalyser::asynWriteRead | ( | const char * | command, |
char * | response | ||
) |
Wrapper for asynOctetSyncIO write/read functions.
command | - String command to send. |
response | - String response back. |
asynStatus SpecsAnalyser::cleanString | ( | std::string & | str, |
const std::string & | search = ": \n" , |
||
int | where = 0 |
||
) |
Utility function, returns strings with unwanted characters stripped.
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. |
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
command | - String command to send. |
response | - String response back (OK or ERROR) |
data | - Map of data items indexed by name |
asynStatus SpecsAnalyser::connect | ( | ) |
asynStatus SpecsAnalyser::debug | ( | const std::string & | method, |
const std::string & | msg | ||
) |
asynStatus SpecsAnalyser::debug | ( | const std::string & | method, |
const std::string & | msg, | ||
const std::string & | value | ||
) |
asynStatus SpecsAnalyser::debug | ( | const std::string & | method, |
const std::string & | msg, | ||
double | value | ||
) |
asynStatus SpecsAnalyser::debug | ( | const std::string & | method, |
const std::string & | msg, | ||
int | value | ||
) |
asynStatus SpecsAnalyser::debug | ( | const std::string & | method, |
const std::string & | msg, | ||
std::map< int, std::string > | value | ||
) |
asynStatus SpecsAnalyser::debug | ( | const std::string & | method, |
const std::string & | msg, | ||
std::map< std::string, std::string > | value | ||
) |
asynStatus SpecsAnalyser::debugLevel | ( | const std::string & | method, |
int | onOff | ||
) |
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.
asynStatus SpecsAnalyser::defineSpectrumFE | ( | ) |
asynStatus SpecsAnalyser::defineSpectrumFRR | ( | ) |
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.
asynStatus SpecsAnalyser::disconnect | ( | ) |
asynStatus SpecsAnalyser::getAnalyserParameter | ( | const std::string & | name, |
bool & | value | ||
) |
asynStatus SpecsAnalyser::getAnalyserParameter | ( | const std::string & | name, |
double & | value | ||
) |
asynStatus SpecsAnalyser::getAnalyserParameter | ( | const std::string & | name, |
int & | value | ||
) |
asynStatus SpecsAnalyser::getAnalyserParameter | ( | const std::string & | name, |
std::string & | value | ||
) |
asynStatus SpecsAnalyser::getAnalyserParameterType | ( | const std::string & | name, |
SPECSValueType_t & | value | ||
) |
asynStatus SpecsAnalyser::initDebugger | ( | int | initDebug | ) |
asynStatus SpecsAnalyser::makeConnection | ( | ) |
asynStatus SpecsAnalyser::readAcquisitionData | ( | int | startIndex, |
int | endIndex, | ||
std::vector< double > & | values | ||
) |
asynStatus SpecsAnalyser::readDeviceVisibleName | ( | ) |
This method queries the analyser for its device name to populate the ADModel parameter.
asynStatus SpecsAnalyser::readDoubleData | ( | std::map< std::string, std::string > | data, |
const std::string & | name, | ||
double & | value | ||
) |
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.
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 |
asynStatus SpecsAnalyser::readIntegerData | ( | std::map< std::string, std::string > | data, |
const std::string & | name, | ||
int & | value | ||
) |
asynStatus SpecsAnalyser::readRunModes | ( | ) |
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.
param | - Data Info parameter to request. Currently (v1.11) only OrdinateRange is supported. |
asynStatus SpecsAnalyser::readSpectrumParameter | ( | int | param | ) |
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.
asynStatus SpecsAnalyser::sendStartCommand | ( | bool | safeAfter | ) |
Send the start command to the analyser.
asynStatus SpecsAnalyser::setAnalyserParameter | ( | const std::string & | name, |
double | value | ||
) |
asynStatus SpecsAnalyser::setAnalyserParameter | ( | const std::string & | name, |
int | value | ||
) |
asynStatus SpecsAnalyser::setAnalyserParameter | ( | const std::string & | name, |
std::string | value | ||
) |
asynStatus SpecsAnalyser::setupEPICSParameters | ( | ) |
This method sets up the analyser parameters that are not known prior to connecting to the device.
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.
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.
asynStatus SpecsAnalyser::writeFloat64 | ( | asynUser * | pasynUser, |
epicsFloat64 | value | ||
) |
Called when asyn clients call pasynFloat64->write().
Write integer value to the drivers parameter table.
pasynUser | - Pointer to the asyn user structure. |
value | - The new value to write |
|
virtual |
Called when asyn clients call pasynInt32->write().
Write integer value to the drivers parameter table.
pasynUser | - Pointer to the asyn user structure. |
value | - The new value to write |
Reimplemented from ADDriver.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |