NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dataAcquisition.h
Go to the documentation of this file.
1 /*
2  * Nominal Device Support v3 (NDS3)
3  *
4  * Copyright (c) 2015 Cosylab d.d.
5  *
6  * For more information about the license please refer to the license.txt
7  * file included in the distribution.
8  */
9 
10 #ifndef NDSDATAACQUISITION_H
11 #define NDSDATAACQUISITION_H
12 
22 #include "nds3/definitions.h"
23 #include "nds3/node.h"
24 
25 namespace nds
26 {
27 
52 template <typename T>
53 class NDS3_API DataAcquisition: public Node
54 {
55 public:
62 
69  DataAcquisition(const DataAcquisition<T>& right);
70 
71  DataAcquisition& operator=(const DataAcquisition<T>& right);
72 
77  DataAcquisition(const std::string& name,
78  size_t maxElements,
79  stateChange_t switchOnFunction,
80  stateChange_t switchOffFunction,
81  stateChange_t startFunction,
82  stateChange_t stopFunction,
83  stateChange_t recoverFunction,
84  allowChange_t allowStateChangeFunction
85  );
86 
94  void setStartTimestampDelegate(getTimestampPlugin_t timestampDelegate);
95 
106  void push(const timespec& timestamp, const T& data);
107 
113  double getFrequencyHz();
114 
120  double getDurationSeconds();
121 
127  double getAmplitude();
128 
134  double getOffset();
135 
142  size_t getMaxElements();
143 
149  size_t getDecimation();
150 
156  size_t getSamplingMode();
157 
163  size_t getGround();
164 
174  timespec getStartTimestamp() const;
175 };
176 
177 }
178 #endif // NDSDATAACQUISITION_H
179 
Defines the nds::Node class, a class that can contain other device's nodes, ports or PVs...
std::function< timespec()> getTimestampPlugin_t
Definition for a function called to retrieve a time.
Definition: definitions.h:279
A node object that can contain other nodes or PVs as children.
Definition: node.h:38
std::function< bool(const state_t, const state_t, const state_t)> allowChange_t
Definition for a function called to allow or deny a state transition.
Definition: definitions.h:271
std::function< void()> stateChange_t
Definition for the function executed during the state transition.
Definition: definitions.h:254
Defines all the enumeration and common types used across the NDS library.
Definition: dataAcquisition.h:53