EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
AverageReader Class Reference

Reads data from storage, averaging over the raw samples. More...

#include <AverageReader.h>

Inheritance diagram for AverageReader:
DataReader LinearReader

Public Member Functions

 AverageReader (Index &index, double delta)
 Create a reader for an index. More...
 
const RawValue::Datafind (const std::string &channel_name, const epicsTime *start)
 Returns sample of the specified channel.
 
const std::string & getName () const
 Returns the channel name.
 
const RawValue::Datanext ()
 Returns the next sample.
 
const RawValue::Dataget () const
 Returns the present sample.
 
DbrType getType () const
 Return the value type.
 
DbrCount getCount () const
 Returns the count of the sample value.
 
const CtrlInfogetInfo () const
 Returns CtrlInfo.
 
bool changedType ()
 Checks if type changed.
 
bool changedInfo ()
 Checks if CtrlInfo changed.
 
bool isRaw () const
 
double getMinimum () const
 
double getMaximum () const
 
- Public Member Functions inherited from DataReader
virtual const RawValue::Datafind (const stdString &channel_name, const epicsTime *start)=0
 Locate data. More...
 
void toString (stdString &text) const
 Convert current value to string. More...
 

Detailed Description

Reads data from storage, averaging over the raw samples.

The AverageReader is an implementaion of a DataReader that returns the average value of the raw values within each 'bin' of 'delta' seconds on the time axis.

Assume the averaging delta is 10.0 seconds. In order to get nice-looking time stamps like 01:30:00, 01:30:10, 01:30:10, ..., the averaging reader creates bins ending at 01:30:05, 01:30:15, 01:30:15, ....

The averaged data from 01:30:05 to just before 01:30:15 is then time-stamped 01:30:10. In addition, the minimum and maximum value for the bin is available.

On the other hand, if a bin only contains a single value, that original value is returned. And if the bin contains special values like "Archive Off", that special value is returned.

Constructor & Destructor Documentation

AverageReader::AverageReader ( Index index,
double  delta 
)

Create a reader for an index.

Parameters
indexindex file
deltaThe averaging time interval in seconds.

Member Function Documentation

double AverageReader::getMaximum ( ) const
inline
Returns
minimum value in the current bin (if isRaw).
See Also
isRaw()
double AverageReader::getMinimum ( ) const
inline
Returns
minimum value in the current bin (if isRaw).
See Also
isRaw()
bool AverageReader::isRaw ( ) const
inline
Returns
true if the current value is a raw sample without min/max info

The documentation for this class was generated from the following file: