ADApp/pluginSrc/NDPluginFFT.cpp
NDPluginFFT::NDPluginFFT(const char *portName, int queueSize, int blockingCallbacks,
                         const char *NDArrayPort, int NDArrayAddr, 
                         int maxBuffers, size_t maxMemory,
                         int priority, int stackSize)
    /* Invoke the base class constructor */
    : NDPluginDriver(portName, queueSize, blockingCallbacks,
             NDArrayPort, NDArrayAddr, 1, NUM_NDPLUGIN_FFT_PARAMS, maxBuffers, maxMemory,
             asynFloat64Mask | asynFloat64ArrayMask | asynGenericPointerMask,
             asynFloat64Mask | asynFloat64ArrayMask | asynGenericPointerMask,
             0, 1, priority, stackSize),
    uniqueId_(0), timePerPoint_(0), timeAxis_(0), freqAxis_(0), timeSeries_(0), 
    FFTReal_(0), FFTImaginary_(0), FFTAbsValue_(0)
{
  //const char *functionName = "NDPluginFFT::NDPluginFFT";

  createParam(FFTTimeAxisString,         asynParamFloat64Array, &P_FFTTimeAxis);
  createParam(FFTFreqAxisString,         asynParamFloat64Array, &P_FFTFreqAxis);
  createParam(FFTTimePerPointString,          asynParamFloat64, &P_FFTTimePerPoint);
  createParam(FFTDirectionString,               asynParamInt32, &P_FFTDirection);
  createParam(FFTSuppressDCString,              asynParamInt32, &P_FFTSuppressDC);
  createParam(FFTNumAverageString,              asynParamInt32, &P_FFTNumAverage);
  createParam(FFTNumAveragedString,             asynParamInt32, &P_FFTNumAveraged);
  createParam(FFTResetAverageString,            asynParamInt32, &P_FFTResetAverage);
  
  createParam(FFTTimeSeriesString,       asynParamFloat64Array, &P_FFTTimeSeries);
  createParam(FFTRealString,             asynParamFloat64Array, &P_FFTReal);
  createParam(FFTImaginaryString,        asynParamFloat64Array, &P_FFTImaginary);
  createParam(FFTAbsValueString,         asynParamFloat64Array, &P_FFTAbsValue);
 
  /* Set the plugin type string */
  setStringParam(NDPluginDriverPluginType, "NDPluginFFT");
  
  /* Try to connect to the array port */
  connectToArrayPort();

  callParamCallbacks();
  
}
/** Constructor for NDPluginFFT; most parameters are simply passed to NDPluginDriver::NDPluginDriver.
  * \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] 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 NDPluginFFT; most parameters are simply passed to NDPluginDriver::NDPluginDriver.
\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] 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 NDPluginFFT ; most parameters are simply passed to NDPluginDriver :: NDPluginDriver . \ 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 ] 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 .
NDPluginFFT::NDPluginFFT(const char *portName, int queueSize, int blockingCallbacks,
                         const char *NDArrayPort, int NDArrayAddr, 
                         int maxBuffers, size_t maxMemory,
                         int priority, int stackSize)
    : NDPluginDriver(portName, queueSize, blockingCallbacks,
             NDArrayPort, NDArrayAddr, 1, NUM_NDPLUGIN_FFT_PARAMS, maxBuffers, maxMemory,
             asynFloat64Mask | asynFloat64ArrayMask | asynGenericPointerMask,
             asynFloat64Mask | asynFloat64ArrayMask | asynGenericPointerMask,
             0, 1, priority, stackSize),
    uniqueId_(0), timePerPoint_(0), timeAxis_(0), freqAxis_(0), timeSeries_(0), 
    FFTReal_(0), FFTImaginary_(0), FFTAbsValue_(0)
{
  createParam(FFTTimeAxisString,         asynParamFloat64Array, &P_FFTTimeAxis);
  createParam(FFTFreqAxisString,         asynParamFloat64Array, &P_FFTFreqAxis);
  createParam(FFTTimePerPointString,          asynParamFloat64, &P_FFTTimePerPoint);
  createParam(FFTDirectionString,               asynParamInt32, &P_FFTDirection);
  createParam(FFTSuppressDCString,              asynParamInt32, &P_FFTSuppressDC);
  createParam(FFTNumAverageString,              asynParamInt32, &P_FFTNumAverage);
  createParam(FFTNumAveragedString,             asynParamInt32, &P_FFTNumAveraged);
  createParam(FFTResetAverageString,            asynParamInt32, &P_FFTResetAverage);
  createParam(FFTTimeSeriesString,       asynParamFloat64Array, &P_FFTTimeSeries);
  createParam(FFTRealString,             asynParamFloat64Array, &P_FFTReal);
  createParam(FFTImaginaryString,        asynParamFloat64Array, &P_FFTImaginary);
  createParam(FFTAbsValueString,         asynParamFloat64Array, &P_FFTAbsValue);
  setStringParam(NDPluginDriverPluginType, "NDPluginFFT");
  connectToArrayPort();
  callParamCallbacks();
}
NDPluginFFT :: NDPluginFFT ( const char * portName , int queueSize , int blockingCallbacks , const char * NDArrayPort , int NDArrayAddr , int maxBuffers , size_t maxMemory , int priority , int stackSize ) : NDPluginDriver ( portName , queueSize , blockingCallbacks , NDArrayPort , NDArrayAddr , 1 , NUM_NDPLUGIN_FFT_PARAMS , maxBuffers , maxMemory , asynFloat64Mask | asynFloat64ArrayMask | asynGenericPointerMask , asynFloat64Mask | asynFloat64ArrayMask | asynGenericPointerMask , 0 , 1 , priority , stackSize ) , uniqueId_ ( 0 ) , timePerPoint_ ( 0 ) , timeAxis_ ( 0 ) , freqAxis_ ( 0 ) , timeSeries_ ( 0 ) , FFTReal_ ( 0 ) , FFTImaginary_ ( 0 ) , FFTAbsValue_ ( 0 ) { createParam ( FFTTimeAxisString , asynParamFloat64Array , & P_FFTTimeAxis ) ; createParam ( FFTFreqAxisString , asynParamFloat64Array , & P_FFTFreqAxis ) ; createParam ( FFTTimePerPointString , asynParamFloat64 , & P_FFTTimePerPoint ) ; createParam ( FFTDirectionString , asynParamInt32 , & P_FFTDirection ) ; createParam ( FFTSuppressDCString , asynParamInt32 , & P_FFTSuppressDC ) ; createParam ( FFTNumAverageString , asynParamInt32 , & P_FFTNumAverage ) ; createParam ( FFTNumAveragedString , asynParamInt32 , & P_FFTNumAveraged ) ; createParam ( FFTResetAverageString , asynParamInt32 , & P_FFTResetAverage ) ; createParam ( FFTTimeSeriesString , asynParamFloat64Array , & P_FFTTimeSeries ) ; createParam ( FFTRealString , asynParamFloat64Array , & P_FFTReal ) ; createParam ( FFTImaginaryString , asynParamFloat64Array , & P_FFTImaginary ) ; createParam ( FFTAbsValueString , asynParamFloat64Array , & P_FFTAbsValue ) ; setStringParam ( NDPluginDriverPluginType , " " ) ; connectToArrayPort ( ) ; callParamCallbacks ( ) ; }
Constructor for NDPluginFFT; most parameters are simply passed to NDPluginDriver::NDPluginDriver.
Constructor for NDPluginFFT ; most parameters are simply passed to NDPluginDriver :: NDPluginDriver .
/* Invoke the base class constructor */ //const char *functionName = "NDPluginFFT::NDPluginFFT"; /* Set the plugin type string */ /* Try to connect to the array port */