#include <NDPluginROI.h>
Public Member Functions | |
NDPluginROI (const char *portName, int queueSize, int blockingCallbacks, const char *NDArrayPort, int NDArrayAddr, int maxROIs, int maxBuffers, size_t maxMemory, int priority, int stackSize) | |
Constructor for NDPluginROI; most parameters are simply passed to NDPluginDriver::NDPluginDriver. | |
void | processCallbacks (NDArray *pArray) |
Callback function that is called by the NDArray driver with new NDArray data. | |
asynStatus | writeInt32 (asynUser *pasynUser, epicsInt32 value) |
Called when asyn clients call pasynInt32->write(). | |
asynStatus | drvUserCreate (asynUser *pasynUser, const char *drvInfo, const char **pptypeName, size_t *psize) |
Sets pasynUser->reason to one of the enum values for the parameters defined for this class if the drvInfo field matches one the strings defined for it. | |
asynStatus | readFloat64Array (asynUser *pasynUser, epicsFloat64 *value, size_t nelements, size_t *nIn) |
Called when asyn clients call pasynFloat64Array->read(). |
The plugin also optionally computes a statistics on the ROI.
NDPluginROI::NDPluginROI | ( | const char * | portName, | |
int | queueSize, | |||
int | blockingCallbacks, | |||
const char * | NDArrayPort, | |||
int | NDArrayAddr, | |||
int | maxROIs, | |||
int | maxBuffers, | |||
size_t | maxMemory, | |||
int | priority, | |||
int | stackSize | |||
) |
Constructor for NDPluginROI; most parameters are simply passed to NDPluginDriver::NDPluginDriver.
After calling the base class constructor this method sets reasonable default values for all of the ROI parameters.
[in] | portName | The name of the asyn port driver to be created. |
[in] | queueSize | The number of NDArrays that the input queue for this plugin can hold when NDPluginDriverBlockingCallbacks=0. Larger queues can decrease the number of dropped arrays, at the expense of more NDArray buffers being allocated from the underlying driver's NDArrayPool. |
[in] | blockingCallbacks | Initial setting for the NDPluginDriverBlockingCallbacks flag. 0=callbacks are queued and executed by the callback thread; 1 callbacks execute in the thread of the driver doing the callbacks. |
[in] | NDArrayPort | Name of asyn port driver for initial source of NDArray callbacks. |
[in] | NDArrayAddr | asyn port driver address for initial source of NDArray callbacks. |
[in] | maxROIs | The maximum number of ROIs this plugin supports. 1 is minimum. |
[in] | maxBuffers | The 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] | maxMemory | The 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] | priority | The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags. |
[in] | stackSize | The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags. |
asynStatus NDPluginROI::drvUserCreate | ( | asynUser * | pasynUser, | |
const char * | drvInfo, | |||
const char ** | pptypeName, | |||
size_t * | psize | |||
) | [virtual] |
Sets pasynUser->reason to one of the enum values for the parameters defined for this class if the drvInfo field matches one the strings defined for it.
If the parameter is not recognized by this class then calls NDPluginDriver::drvUserCreate. Uses asynPortDriver::drvUserCreateParam.
[in] | pasynUser | pasynUser structure that driver modifies |
[in] | drvInfo | String containing information about what driver function is being referenced |
[out] | pptypeName | Location in which driver puts a copy of drvInfo. |
[out] | psize | Location where driver puts size of param |
Reimplemented from NDPluginDriver.
void NDPluginROI::processCallbacks | ( | NDArray * | pArray | ) | [virtual] |
Callback function that is called by the NDArray driver with new NDArray data.
Extracts the NDArray data into each of the ROIs that are being used. Computes statistics on the ROI if NDPluginROIComputeStatistics is 1. Computes the histogram of ROI values if NDPluginROIComputeHistogram is 1.
[in] | pArray | The NDArray from the callback. |
Reimplemented from NDPluginDriver.
asynStatus NDPluginROI::readFloat64Array | ( | asynUser * | pasynUser, | |
epicsFloat64 * | value, | |||
size_t | nElements, | |||
size_t * | nIn | |||
) |
Called when asyn clients call pasynFloat64Array->read().
Returns the histogram array when pasynUser->reason=NDPluginROIHistArray.
[in] | pasynUser | pasynUser structure that encodes the reason and address. |
[in] | value | Pointer to the array to read. |
[in] | nElements | Number of elements to read. |
[out] | nIn | Number of elements actually read. |
asynStatus NDPluginROI::writeInt32 | ( | asynUser * | pasynUser, | |
epicsInt32 | value | |||
) | [virtual] |
Called when asyn clients call pasynInt32->write().
This function performs actions for some parameters, including minimum, size, binning, etc. for each ROI. For other parameters it calls NDPluginDriver::writeInt32 to see if that method understands the parameter. For all parameters it sets the value in the parameter library and calls any registered callbacks..
[in] | pasynUser | pasynUser structure that encodes the reason and address. |
[in] | value | Value to write. |
Reimplemented from NDPluginDriver.