areaDetector  3-5-0
EPICS areaDetector framework
Public Member Functions | List of all members
paramList Class Reference

Class to support parameter library (also called parameter list); set and get values indexed by parameter number (pasynUser->reason) and do asyn callbacks when parameters change. More...

Public Member Functions

 paramList (class asynPortDriver *pPort)
 Constructor for paramList class. More...
 
 ~paramList ()
 Destructor for paramList class; frees resources allocated in constructor. More...
 
paramVal * getParameter (int index)
 Get a parameter from the list by index. More...
 
asynStatus createParam (const char *name, asynParamType type, int *index)
 Adds a new parameter to the parameter library. More...
 
asynStatus getNumParams (int *numParams)
 Returns the number of parameters in the library. More...
 
asynStatus findParam (const char *name, int *index)
 Finds a parameter in the parameter library. More...
 
asynStatus getName (int index, const char **name)
 Returns the name of a parameter from the parameter library. More...
 
asynStatus setInteger (int index, int value)
 Sets the value for an integer in the parameter library. More...
 
asynStatus setUInt32 (int index, epicsUInt32 value, epicsUInt32 valueMask, epicsUInt32 interruptMask)
 Sets the value for an integer in the parameter library. More...
 
asynStatus setDouble (int index, double value)
 Sets the value for a double in the parameter library. More...
 
asynStatus setString (int index, const char *string)
 Sets the value for a string in the parameter library. More...
 
asynStatus setString (int index, const std::string &string)
 Sets the value for a string in the parameter library. More...
 
asynStatus getInteger (int index, epicsInt32 *value)
 Returns the value for an integer from the parameter library. More...
 
asynStatus getUInt32 (int index, epicsUInt32 *value, epicsUInt32 mask)
 Returns the value for an integer from the parameter library. More...
 
asynStatus getDouble (int index, double *value)
 Returns the value for a double from the parameter library. More...
 
asynStatus getString (int index, int maxChars, char *value)
 Returns the value for a string from the parameter library. More...
 
asynStatus getString (int index, std::string &value)
 Returns the value for a string from the parameter library. More...
 
asynStatus setUInt32Interrupt (int index, epicsUInt32 mask, interruptReason reason)
 Sets the value of the UInt32Interrupt in the parameter library. More...
 
asynStatus clearUInt32Interrupt (int index, epicsUInt32 mask)
 Clears the UInt32Interrupt in the parameter library. More...
 
asynStatus getUInt32Interrupt (int index, epicsUInt32 *mask, interruptReason reason)
 Returns the UInt32Interrupt from the parameter library. More...
 
asynStatus callCallbacks (int addr)
 Calls the registered asyn callback functions for all clients for any parameters that have changed since the last time this function was called. More...
 
asynStatus callCallbacks ()
 
asynStatus setStatus (int index, asynStatus status)
 Sets the status for a parameter in the parameter library. More...
 
asynStatus getStatus (int index, asynStatus *status)
 Returns the status for a parameter in the parameter library. More...
 
asynStatus setAlarmStatus (int index, int alarmStatus)
 Sets the alarmStatus for a parameter in the parameter library. More...
 
asynStatus getAlarmStatus (int index, int *alarmStatus)
 Returns the alarmStatus for a parameter in the parameter library. More...
 
asynStatus setAlarmSeverity (int index, int alarmSeverity)
 Sets the alarmSeverity for a parameter in the parameter library. More...
 
asynStatus getAlarmSeverity (int index, int *alarmSeverity)
 Returns the alarmSeverity for a parameter in the parameter library. More...
 
void report (FILE *fp, int details)
 Reports on status of the paramList. More...
 

Detailed Description

Class to support parameter library (also called parameter list); set and get values indexed by parameter number (pasynUser->reason) and do asyn callbacks when parameters change.

The parameter class supports 3 types of parameters: int, double and dynamic-length strings.

Constructor & Destructor Documentation

◆ paramList()

paramList::paramList ( class asynPortDriver pPort)

Constructor for paramList class.

Parameters
[in]pPortPointer to asynPortDriver port for this paramList.

◆ ~paramList()

paramList::~paramList ( )

Destructor for paramList class; frees resources allocated in constructor.

Member Function Documentation

◆ callCallbacks() [1/2]

asynStatus paramList::callCallbacks ( int  addr)

Calls the registered asyn callback functions for all clients for any parameters that have changed since the last time this function was called.

Parameters
[in]addrA client will be called if addr matches the asyn address registered for that client.

Don't do anything if interruptAccept=0. There is a thread that will do all callbacks once when interruptAccept goes to 1.

◆ callCallbacks() [2/2]

asynStatus paramList::callCallbacks ( )

◆ clearUInt32Interrupt()

asynStatus paramList::clearUInt32Interrupt ( int  index,
epicsUInt32  mask 
)

Clears the UInt32Interrupt in the parameter library.

Parameters
[in]indexThe parameter number
[in]maskThe interrupt mask.
Returns
Returns asynParamBadIndex if the index is not valid, or asynParamWrongType if the parameter type is not asynParamUInt32Digital

◆ createParam()

asynStatus paramList::createParam ( const char *  name,
asynParamType  type,
int *  index 
)

Adds a new parameter to the parameter library.

Parameters
[in]nameThe name of this parameter
[in]typeThe type of this parameter
[out]indexThe parameter number
Returns
Returns asynParamAlreadyExists if the parameter already exists. If adding this parameter exceeds the pre-allocated size of the parameter list a warning is printed.

◆ findParam()

asynStatus paramList::findParam ( const char *  name,
int *  index 
)

Finds a parameter in the parameter library.

Parameters
[in]nameThe name of this parameter
[out]indexThe parameter number
Returns
Returns asynParamNotFound if name is not found in the parameter list.

◆ getAlarmSeverity()

asynStatus paramList::getAlarmSeverity ( int  index,
int *  alarmSeverity 
)

Returns the alarmSeverity for a parameter in the parameter library.

Parameters
[in]indexThe parameter number
[out]alarmSeverityAddress of status to get
Returns
Returns asynParamBadIndex if the index is not valid

◆ getAlarmStatus()

asynStatus paramList::getAlarmStatus ( int  index,
int *  alarmStatus 
)

Returns the alarmStatus for a parameter in the parameter library.

Parameters
[in]indexThe parameter number
[out]alarmStatusAddress of status to get
Returns
Returns asynParamBadIndex if the index is not valid

◆ getDouble()

asynStatus paramList::getDouble ( int  index,
double *  value 
)

Returns the value for a double from the parameter library.

Parameters
[in]indexThe parameter number
[out]valueAddress of value to get.
Returns
Returns asynParamBadIndex if the index is not valid, asynParamWrongType if the parameter type is not asynParamFloat64, or asynParamUndefined if the value has not been defined.

◆ getInteger()

asynStatus paramList::getInteger ( int  index,
epicsInt32 *  value 
)

Returns the value for an integer from the parameter library.

Parameters
[in]indexThe parameter number
[out]valueAddress of value to get.
Returns
Returns asynParamBadIndex if the index is not valid, asynParamWrongType if the parameter type is not asynParamInt32, or asynParamUndefined if the value has not been defined.

◆ getName()

asynStatus paramList::getName ( int  index,
const char **  value 
)

Returns the name of a parameter from the parameter library.

Parameters
[in]indexThe parameter number
[out]valueAddress of pointer that will contain name string pointer.
Returns
Returns asynParamBadIndex if the index is not valid

◆ getNumParams()

asynStatus paramList::getNumParams ( int *  numParams)

Returns the number of parameters in the library.

Parameters
[out]numParamsNumber of parameters

◆ getParameter()

paramVal * paramList::getParameter ( int  index)

Get a parameter from the list by index.

Parameters
[in]indexThe index of the desired parameter in the list
Returns
The parameter associated with the input index
Exceptions
ParamListInvalidIndexif the index is outside the list boundaries

◆ getStatus()

asynStatus paramList::getStatus ( int  index,
asynStatus *  status 
)

Returns the status for a parameter in the parameter library.

Parameters
[in]indexThe parameter number
[out]statusAddress of status to get
Returns
Returns asynParamBadIndex if the index is not valid

◆ getString() [1/2]

asynStatus paramList::getString ( int  index,
int  maxChars,
char *  value 
)

Returns the value for a string from the parameter library.

Parameters
[in]indexThe parameter number
[in]maxCharsMaximum number of characters to return.
[out]valueAddress of value to get.
Returns
Returns asynParamBadIndex if the index is not valid, asynParamWrongType if the parameter type is not asynParamOctet, or asynParamUndefined if the value has not been defined.

◆ getString() [2/2]

asynStatus paramList::getString ( int  index,
std::string &  value 
)

Returns the value for a string from the parameter library.

Parameters
[in]indexThe parameter number
[out]valueString value to get.
Returns
Returns asynParamBadIndex if the index is not valid, asynParamWrongType if the parameter type is not asynParamOctet, or asynParamUndefined if the value has not been defined.

◆ getUInt32()

asynStatus paramList::getUInt32 ( int  index,
epicsUInt32 *  value,
epicsUInt32  mask 
)

Returns the value for an integer from the parameter library.

Parameters
[in]indexThe parameter number
[out]valueAddress of value to get.
[in]maskThe mask to use when getting the value.
Returns
Returns asynParamBadIndex if the index is not valid, asynParamWrongType if the parameter type is not asynParamUInt32Digital, or asynParamUndefined if the value has not been defined.

◆ getUInt32Interrupt()

asynStatus paramList::getUInt32Interrupt ( int  index,
epicsUInt32 *  mask,
interruptReason  reason 
)

Returns the UInt32Interrupt from the parameter library.

Parameters
[in]indexThe parameter number
[out]maskThe address of the interrupt mask to return.
[in]reasonThe interrupt reason.
Returns
Returns asynParamBadIndex if the index is not valid, or asynParamWrongType if the parameter type is not asynParamUInt32Digital

◆ report()

void paramList::report ( FILE *  fp,
int  details 
)

Reports on status of the paramList.

Parameters
[in]fpThe file pointer on which report information will be written
[in]detailsThe level of report detail desired. Prints the number of parameters in the list, and the index, data type, name, and value of each parameter.

◆ setAlarmSeverity()

asynStatus paramList::setAlarmSeverity ( int  index,
int  alarmSeverity 
)

Sets the alarmSeverity for a parameter in the parameter library.

Parameters
[in]indexThe parameter number
[in]alarmSeveritySeverity to set
Returns
Returns asynParamBadIndex if the index is not valid

◆ setAlarmStatus()

asynStatus paramList::setAlarmStatus ( int  index,
int  alarmStatus 
)

Sets the alarmStatus for a parameter in the parameter library.

Parameters
[in]indexThe parameter number
[in]alarmStatusStatus to set
Returns
Returns asynParamBadIndex if the index is not valid

◆ setDouble()

asynStatus paramList::setDouble ( int  index,
double  value 
)

Sets the value for a double in the parameter library.

Parameters
[in]indexThe parameter number
[in]valueValue to set.
Returns
Returns asynParamBadIndex if the index is not valid or asynParamWrongType if the parameter type is not asynParamFloat64.

◆ setInteger()

asynStatus paramList::setInteger ( int  index,
int  value 
)

Sets the value for an integer in the parameter library.

Parameters
[in]indexThe parameter number
[in]valueValue to set.
Returns
Returns asynParamBadIndex if the index is not valid or asynParamWrongType if the parametertype is not asynParamInt32.

◆ setStatus()

asynStatus paramList::setStatus ( int  index,
asynStatus  status 
)

Sets the status for a parameter in the parameter library.

Parameters
[in]indexThe parameter number
[in]statusStatus to set
Returns
Returns asynParamBadIndex if the index is not valid

◆ setString() [1/2]

asynStatus paramList::setString ( int  index,
const char *  value 
)

Sets the value for a string in the parameter library.

Parameters
[in]indexThe parameter number
[in]valueAddress of value to set.
Returns
Returns asynParamBadIndex if the index is not valid or asynParamWrongType if the parameter type is not asynParamOctet.

◆ setString() [2/2]

asynStatus paramList::setString ( int  index,
const std::string &  value 
)

Sets the value for a string in the parameter library.

Parameters
[in]indexThe parameter number
[in]valueString value to set.
Returns
Returns asynParamBadIndex if the index is not valid or asynParamWrongType if the parameter type is not asynParamOctet.

◆ setUInt32()

asynStatus paramList::setUInt32 ( int  index,
epicsUInt32  value,
epicsUInt32  valueMask,
epicsUInt32  interruptMask 
)

Sets the value for an integer in the parameter library.

Parameters
[in]indexThe parameter number
[in]valueValue to set.
[in]valueMaskMask to use when setting the value.
[in]interruptMaskMask of bits that have changed even if the value has not changed
Returns
Returns asynParamBadIndex if the index is not valid or asynParamWrongType if the parameter type is not asynParamUInt32Digital.

◆ setUInt32Interrupt()

asynStatus paramList::setUInt32Interrupt ( int  index,
epicsUInt32  mask,
interruptReason  reason 
)

Sets the value of the UInt32Interrupt in the parameter library.

Parameters
[in]indexThe parameter number
[in]maskThe interrupt mask.
[in]reasonThe interrupt reason.
Returns
Returns asynParamBadIndex if the index is not valid, or asynParamWrongType if the parameter type is not asynParamUInt32Digital

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