frequency.hpp
Go to the documentation of this file.
1 
4 /*****************************************************************************
5 ** Ifdefs
6 *****************************************************************************/
7 
8 #ifndef ecl_time_TIME_FREQUENCY_DIAGNOSTICS_HPP_
9 #define ecl_time_TIME_FREQUENCY_DIAGNOSTICS_HPP_
10 
11 /*****************************************************************************
12 ** Includes
13 *****************************************************************************/
14 
15 #include "timestamp.hpp"
16 
17 /*****************************************************************************
18 ** Namespaces
19 *****************************************************************************/
20 
21 namespace ecl {
22 
23 /*****************************************************************************
24 ** Interfaces
25 *****************************************************************************/
32 
34  : has_connection(false)
35  , hz(-1.0)
36  , std_dev(-1.0)
37  , minimum_interval(-1.0)
38  , maximum_interval(-1.0)
39  , last_incoming()
40  {}
41 
43  float hz;
44  float std_dev;
48 
49 };
50 
84 public:
92  const float& window_period = 2.0,
93  const bool& use_realtime_clock=false
94  );
100  void update();
107  const FrequencyDiagnostics& analyse();
108 
113  const FrequencyDiagnostics& diagnostics() const { return current_diagnostics; };
114 
115 protected:
116  FrequencyDiagnostics current_diagnostics;
117  unsigned int incoming_counter;
118  ecl::TimeStamp last_anyalsed;
119  ecl::TimeStamp period;
120  ecl::TimeStamp minimum_interval;
121  ecl::TimeStamp maximum_interval;
123  ecl::TimeStamp last_incoming;
124 };
125 
126 /*****************************************************************************
127 ** Trailers
128 *****************************************************************************/
129 
130 } // namespace ecl
131 
132 #endif /* ecl_time_TIME_FREQUENCY_DIAGNOSTICS_HPP_ */
ecl::TimeStamp last_incoming
Definition: frequency.hpp:123
Embedded control libraries.
Data relevant to frequencies of an incoming stream.
Definition: frequency.hpp:31
ecl::TimeStamp minimum_interval
Definition: frequency.hpp:120
ecl::TimeStamp maximum_interval
Definition: frequency.hpp:121
ecl::TimeStamp period
Definition: frequency.hpp:119
ecl::TimeStamp last_anyalsed
Definition: frequency.hpp:118
Lightweight and fast frequency monitor.
Definition: frequency.hpp:83
const FrequencyDiagnostics & diagnostics() const
Diagnostics getter function.
Definition: frequency.hpp:113
unsigned int incoming_counter
Definition: frequency.hpp:117
Cross-platform header inclusions for the timestamp class.


ecl_time
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:08:15