areaDetector  3-13
EPICS areaDetector framework
NDPluginTimeSeries.h
Go to the documentation of this file.
1 
10 #ifndef NDPluginTimeSeries_H
11 #define NDPluginTimeSeries_H
12 
13 #include <epicsTime.h>
14 
15 #include "NDPluginDriver.h"
16 
17 
18 /* Per-plugin parameters */
19 #define TSAcquireString "TS_ACQUIRE" /* (asynInt32, r/w) Acquire on/off */
20 #define TSReadString "TS_READ" /* (asynInt32, r/w) Read data */
21 #define TSNumPointsString "TS_NUM_POINTS" /* (asynInt32, r/w) Number of time series points to use */
22 #define TSCurrentPointString "TS_CURRENT_POINT" /* (asynInt32, r/o) Current point in time series */
23 #define TSTimePerPointString "TS_TIME_PER_POINT" /* (asynFloat64, r/o) Time per time point from driver */
24 #define TSAveragingTimeString "TS_AVERAGING_TIME" /* (asynFloat64, r/o) Averaging time in plugin */
25 #define TSNumAverageString "TS_NUM_AVERAGE" /* (asynInt32, r/o) Time points to average */
26 #define TSElapsedTimeString "TS_ELAPSED_TIME" /* (asynFloat64, r/o) Elapsed acquisition time */
27 #define TSAcquireModeString "TS_ACQUIRE_MODE" /* (asynInt32, r/w) Acquire mode */
28 #define TSTimeAxisString "TS_TIME_AXIS" /* (asynFloat64Array, r/o) Time axis array */
29 #define TSTimestampString "TS_TIMESTAMP" /* (asynFloat64Array, r/o) Series of timestamps */
30 
31 /* Per-signal parameters */
32 #define TSTimeSeriesString "TS_TIME_SERIES" /* (asynFloat64Array, r/o) Time series array */
33 
34 
37 public:
38  NDPluginTimeSeries(const char *portName, int queueSize, int blockingCallbacks,
39  const char *NDArrayPort, int NDArrayAddr,
40  int maxSignals, int maxBuffers, size_t maxMemory,
41  int priority, int stackSize);
42 
43  //These methods override the virtual methods in the base class
44  void processCallbacks(NDArray *pArray);
45  asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
46  asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value);
47 
48 protected:
49 
50  // Per-plugin parameters
52  #define FIRST_NDPLUGIN_TIME_SERIES_PARAM P_TSAcquire
53  int P_TSRead;
63 
64  // Per-signal parameters
66 
67 private:
68  template <typename epicsType> asynStatus doAddToTimeSeriesT(NDArray *pArray);
69  asynStatus addToTimeSeries(NDArray *pArray);
70  asynStatus clear(epicsUInt32 roi);
71  template <typename epicsType> void doTimeSeriesCallbacksT();
72  asynStatus doTimeSeriesCallbacks();
73  void allocateArrays();
74  void acquireReset();
75  void createAxisArray();
76  void computeNumAverage();
77 
78  int maxSignals_;
79  int numSignals_;
80  int numSignalsIn_;
81  NDDataType_t dataType_;
82  int dataSize_;
83  int numTimePoints_;
84  int currentTimePoint_;
85  int uniqueId_;
86  int numAverage_;
87  int numAveraged_;
88  int acquireMode_;
89  double averagingTimeRequested_;
90  double averagingTimeActual_;
91  double timePerPoint_; /* Actual time between points in input arrays */
92  epicsTimeStamp startTime_;
93  double *averageStore_;
94  double *signalData_;
95  double *timeAxis_;
96  double *timeStamp_;
97  NDArray *pTimeCircular_;
98 };
99 
100 #endif //NDPluginTimeSeries_H
NDDataType_t
Enumeration of NDArray data types.
Definition: NDAttribute.h:30
#define NDPLUGIN_API
Definition: NDPluginAPI.h:41
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:99
Class from which actual plugin drivers are derived; derived from asynNDArrayDriver.
Definition: NDPluginDriver.h:57
virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value)
Called when asyn clients call pasynFloat64->write().
Definition: NDPluginDriver.cpp:769
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Called when asyn clients call pasynInt32->write().
Definition: NDPluginDriver.cpp:678
virtual void processCallbacks(NDArray *pArray)=0
Compute time series on signals.
Definition: NDPluginTimeSeries.h:36
int P_TSTimestamp
Definition: NDPluginTimeSeries.h:62
int P_TSElapsedTime
Definition: NDPluginTimeSeries.h:59
int P_TSCurrentPoint
Definition: NDPluginTimeSeries.h:55
int P_TSAcquireMode
Definition: NDPluginTimeSeries.h:60
int P_TSNumAverage
Definition: NDPluginTimeSeries.h:58
int P_TSNumPoints
Definition: NDPluginTimeSeries.h:54
int P_TSTimeAxis
Definition: NDPluginTimeSeries.h:61
int P_TSTimePerPoint
Definition: NDPluginTimeSeries.h:56
int P_TSAveragingTime
Definition: NDPluginTimeSeries.h:57
int P_TSTimeSeries
Definition: NDPluginTimeSeries.h:65
int P_TSAcquire
Definition: NDPluginTimeSeries.h:51
int P_TSRead
Definition: NDPluginTimeSeries.h:53
list value
Definition: makeDbAndEdl.py:234