#ifndef NDPluginXTCAV_H #define NDPluginXTCAV_H #include #include #include "NDPluginDriver.h" #include "TimeUtil.h" /* XTCAV general parameters */ #define XTCAV_NAME_PARAM "NAME" /* (asynOctet, r/w) Name of this XTCAV */ /* XTCAV definition */ #define CURRENT_PULSEID_PARAM "PULSEID" /* (asynInt32, r/o) Image PULSEID */ #define MAX_PROC_TIME_PARAM "MAXTIME" /* (asynInt32, r/o) Image max processing time */ #define MIN_PROC_TIME_PARAM "MINTIME" /* (asynInt32, r/o) Image min processing time */ #define AVG_PROC_TIME_PARAM "AVGTIME" /* (asynInt32, r/o) Image avg processing time */ #define RST_PROC_TIME_PARAM "RSTTIME" /* (asynInt32, r/w) Reset processing time stats */ #define MAX_CB_TIME_PARAM "MAXCBTIME" /* (asynInt32, r/o) Image max time between cbacks */ #define MIN_CB_TIME_PARAM "MINCBTIME" /* (asynInt32, r/o) Image min time between cbacks */ #define AVG_CB_TIME_PARAM "AVGCBTIME" /* (asynInt32, r/o) Image avg time between cbacks */ #define RST_CB_TIME_PARAM "RSTCBTIME" /* (asynInt32, r/w) Reset time between cbacks */ #define RATE_CB_TIME_PARAM "RATECBTIME" /* (asynInt32, r/o) Reset processing time stats */ /** * Extract XTCAV properties from NDArray data; the plugin can be a source of NDArray callbacks for * other plugins, passing these sub-arrays. */ class NDPluginXTCAV : public NDPluginDriver { public: NDPluginXTCAV(const char *portName, int queueSize, int blockingCallbacks, const char *NDArrayPort, int NDArrayAddr, int maxBuffers, size_t maxMemory, int priority, int stackSize); /* These methods override the virtual methods in the base class */ void processCallbacks(NDArray *pArray); protected: TimeAverage _processingTime; TimeAverage _timeBetweenCallbacks; int _name; /* XTCAV general parameters */ #define FIRST_NDPLUGIN_XTCAV_PARAM _name int _maxProcTime; int _minProcTime; int _avgProcTime; int _rstProcTime; int _maxCbTime; int _minCbTime; int _avgCbTime; int _rstCbTime; int _rateCbTime; int _currentPulseId; /* XTCAV definition */ #define LAST_NDPLUGIN_XTCAV_PARAM _currentPulseId private: int _counter; }; #define NUM_NDPLUGIN_XTCAV_PARAMS (&LAST_NDPLUGIN_XTCAV_PARAM - &FIRST_NDPLUGIN_XTCAV_PARAM + 1) #endif