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