ADApp/pluginSrc/NDPluginOverlay.cpp
NDPluginOverlay::NDPluginOverlay(const char *portName, int queueSize, int blockingCallbacks,
                         const char *NDArrayPort, int NDArrayAddr, int maxOverlays,
                         int maxBuffers, size_t maxMemory,
                         int priority, int stackSize)
    /* Invoke the base class constructor */
    : NDPluginDriver(portName, queueSize, blockingCallbacks,
                   NDArrayPort, NDArrayAddr, maxOverlays, NUM_NDPLUGIN_OVERLAY_PARAMS, maxBuffers, maxMemory,
                   asynGenericPointerMask,
                   asynGenericPointerMask,
                   ASYN_MULTIDEVICE, 1, priority, stackSize)
{
    static const char *functionName = "NDPluginOverlay";


    this->maxOverlays = maxOverlays;
    this->pOverlays = (NDOverlay_t *)callocMustSucceed(maxOverlays, sizeof(*this->pOverlays), functionName);

    createParam(NDPluginOverlayMaxSizeXString,      asynParamInt32, &NDPluginOverlayMaxSizeX);
    createParam(NDPluginOverlayMaxSizeYString,      asynParamInt32, &NDPluginOverlayMaxSizeY);
    createParam(NDPluginOverlayNameString,          asynParamOctet, &NDPluginOverlayName);
    createParam(NDPluginOverlayUseString,           asynParamInt32, &NDPluginOverlayUse);
    createParam(NDPluginOverlayPositionXString,     asynParamInt32, &NDPluginOverlayPositionX);
    createParam(NDPluginOverlayPositionYString,     asynParamInt32, &NDPluginOverlayPositionY);
    createParam(NDPluginOverlaySizeXString,         asynParamInt32, &NDPluginOverlaySizeX);
    createParam(NDPluginOverlaySizeYString,         asynParamInt32, &NDPluginOverlaySizeY);
    createParam(NDPluginOverlayWidthXString,        asynParamInt32, &NDPluginOverlayWidthX);
    createParam(NDPluginOverlayWidthYString,        asynParamInt32, &NDPluginOverlayWidthY);
    createParam(NDPluginOverlayShapeString,         asynParamInt32, &NDPluginOverlayShape);
    createParam(NDPluginOverlayDrawModeString,      asynParamInt32, &NDPluginOverlayDrawMode);
    createParam(NDPluginOverlayRedString,           asynParamInt32, &NDPluginOverlayRed);
    createParam(NDPluginOverlayGreenString,         asynParamInt32, &NDPluginOverlayGreen);
    createParam(NDPluginOverlayBlueString,          asynParamInt32, &NDPluginOverlayBlue);
    createParam(NDPluginOverlayTimeStampFormatString, asynParamOctet, &NDPluginOverlayTimeStampFormat);
    createParam(NDPluginOverlayFontString,          asynParamInt32, &NDPluginOverlayFont);
    createParam(NDPluginOverlayDisplayTextString,   asynParamOctet, &NDPluginOverlayDisplayText);      

    /* Set the plugin type string */
    setStringParam(NDPluginDriverPluginType, "NDPluginOverlay");

    // Enable ArrayCallbacks.  
    // This plugin currently ignores this setting and always does callbacks, so make the setting reflect the behavior
    setIntegerParam(NDArrayCallbacks, 1);

    /* Try to connect to the array port */
    connectToArrayPort();
}
/** Constructor for NDPluginOverlay; 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.
  * \param[in] portName The name of the asyn port driver to be created.
  * \param[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.
  * \param[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.
  * \param[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
  * \param[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
  * \param[in] maxOverlays The maximum number ofoverlays this plugin supports. 1 is minimum.
  * \param[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.
  * \param[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.
  * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
  * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
  */
Constructor for NDPluginOverlay; 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.
\param[in] portName The name of the asyn port driver to be created.
\param[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.
\param[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.
\param[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
\param[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
\param[in] maxOverlays The maximum number ofoverlays this plugin supports. 1 is minimum.
\param[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.
\param[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.
\param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
\param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
Constructor for NDPluginOverlay ; 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 . \ param [ in ] portName The name of the asyn port driver to be created . \ param [ 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 . \ param [ 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 . \ param [ in ] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks . \ param [ in ] NDArrayAddr asyn port driver address for initial source of NDArray callbacks . \ param [ in ] maxOverlays The maximum number ofoverlays this plugin supports . 1 is minimum . \ param [ 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 . \ param [ 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 . \ param [ in ] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags . \ param [ in ] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags .
NDPluginOverlay::NDPluginOverlay(const char *portName, int queueSize, int blockingCallbacks,
                         const char *NDArrayPort, int NDArrayAddr, int maxOverlays,
                         int maxBuffers, size_t maxMemory,
                         int priority, int stackSize)
    : NDPluginDriver(portName, queueSize, blockingCallbacks,
                   NDArrayPort, NDArrayAddr, maxOverlays, NUM_NDPLUGIN_OVERLAY_PARAMS, maxBuffers, maxMemory,
                   asynGenericPointerMask,
                   asynGenericPointerMask,
                   ASYN_MULTIDEVICE, 1, priority, stackSize)
{
    static const char *functionName = "NDPluginOverlay";
    this->maxOverlays = maxOverlays;
    this->pOverlays = (NDOverlay_t *)callocMustSucceed(maxOverlays, sizeof(*this->pOverlays), functionName);
    createParam(NDPluginOverlayMaxSizeXString,      asynParamInt32, &NDPluginOverlayMaxSizeX);
    createParam(NDPluginOverlayMaxSizeYString,      asynParamInt32, &NDPluginOverlayMaxSizeY);
    createParam(NDPluginOverlayNameString,          asynParamOctet, &NDPluginOverlayName);
    createParam(NDPluginOverlayUseString,           asynParamInt32, &NDPluginOverlayUse);
    createParam(NDPluginOverlayPositionXString,     asynParamInt32, &NDPluginOverlayPositionX);
    createParam(NDPluginOverlayPositionYString,     asynParamInt32, &NDPluginOverlayPositionY);
    createParam(NDPluginOverlaySizeXString,         asynParamInt32, &NDPluginOverlaySizeX);
    createParam(NDPluginOverlaySizeYString,         asynParamInt32, &NDPluginOverlaySizeY);
    createParam(NDPluginOverlayWidthXString,        asynParamInt32, &NDPluginOverlayWidthX);
    createParam(NDPluginOverlayWidthYString,        asynParamInt32, &NDPluginOverlayWidthY);
    createParam(NDPluginOverlayShapeString,         asynParamInt32, &NDPluginOverlayShape);
    createParam(NDPluginOverlayDrawModeString,      asynParamInt32, &NDPluginOverlayDrawMode);
    createParam(NDPluginOverlayRedString,           asynParamInt32, &NDPluginOverlayRed);
    createParam(NDPluginOverlayGreenString,         asynParamInt32, &NDPluginOverlayGreen);
    createParam(NDPluginOverlayBlueString,          asynParamInt32, &NDPluginOverlayBlue);
    createParam(NDPluginOverlayTimeStampFormatString, asynParamOctet, &NDPluginOverlayTimeStampFormat);
    createParam(NDPluginOverlayFontString,          asynParamInt32, &NDPluginOverlayFont);
    createParam(NDPluginOverlayDisplayTextString,   asynParamOctet, &NDPluginOverlayDisplayText);      
    setStringParam(NDPluginDriverPluginType, "NDPluginOverlay");
    setIntegerParam(NDArrayCallbacks, 1);
    connectToArrayPort();
}
NDPluginOverlay :: NDPluginOverlay ( const char * portName , int queueSize , int blockingCallbacks , const char * NDArrayPort , int NDArrayAddr , int maxOverlays , int maxBuffers , size_t maxMemory , int priority , int stackSize ) : NDPluginDriver ( portName , queueSize , blockingCallbacks , NDArrayPort , NDArrayAddr , maxOverlays , NUM_NDPLUGIN_OVERLAY_PARAMS , maxBuffers , maxMemory , asynGenericPointerMask , asynGenericPointerMask , ASYN_MULTIDEVICE , 1 , priority , stackSize ) { static const char * functionName = " " ; this -> maxOverlays = maxOverlays ; this -> pOverlays = ( NDOverlay_t * ) callocMustSucceed ( maxOverlays , sizeof ( * this -> pOverlays ) , functionName ) ; createParam ( NDPluginOverlayMaxSizeXString , asynParamInt32 , & NDPluginOverlayMaxSizeX ) ; createParam ( NDPluginOverlayMaxSizeYString , asynParamInt32 , & NDPluginOverlayMaxSizeY ) ; createParam ( NDPluginOverlayNameString , asynParamOctet , & NDPluginOverlayName ) ; createParam ( NDPluginOverlayUseString , asynParamInt32 , & NDPluginOverlayUse ) ; createParam ( NDPluginOverlayPositionXString , asynParamInt32 , & NDPluginOverlayPositionX ) ; createParam ( NDPluginOverlayPositionYString , asynParamInt32 , & NDPluginOverlayPositionY ) ; createParam ( NDPluginOverlaySizeXString , asynParamInt32 , & NDPluginOverlaySizeX ) ; createParam ( NDPluginOverlaySizeYString , asynParamInt32 , & NDPluginOverlaySizeY ) ; createParam ( NDPluginOverlayWidthXString , asynParamInt32 , & NDPluginOverlayWidthX ) ; createParam ( NDPluginOverlayWidthYString , asynParamInt32 , & NDPluginOverlayWidthY ) ; createParam ( NDPluginOverlayShapeString , asynParamInt32 , & NDPluginOverlayShape ) ; createParam ( NDPluginOverlayDrawModeString , asynParamInt32 , & NDPluginOverlayDrawMode ) ; createParam ( NDPluginOverlayRedString , asynParamInt32 , & NDPluginOverlayRed ) ; createParam ( NDPluginOverlayGreenString , asynParamInt32 , & NDPluginOverlayGreen ) ; createParam ( NDPluginOverlayBlueString , asynParamInt32 , & NDPluginOverlayBlue ) ; createParam ( NDPluginOverlayTimeStampFormatString , asynParamOctet , & NDPluginOverlayTimeStampFormat ) ; createParam ( NDPluginOverlayFontString , asynParamInt32 , & NDPluginOverlayFont ) ; createParam ( NDPluginOverlayDisplayTextString , asynParamOctet , & NDPluginOverlayDisplayText ) ; setStringParam ( NDPluginDriverPluginType , " " ) ; setIntegerParam ( NDArrayCallbacks , 1 ) ; connectToArrayPort ( ) ; }
Constructor for NDPluginOverlay; most parameters are simply passed to NDPluginDriver::NDPluginDriver.
Constructor for NDPluginOverlay ; most parameters are simply passed to NDPluginDriver :: NDPluginDriver .
/* Invoke the base class constructor */ /* Set the plugin type string */ // Enable ArrayCallbacks.   // This plugin currently ignores this setting and always does callbacks, so make the setting reflect the behavior /* Try to connect to the array port */