Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
YDataStream Class Reference

#include <yocto_api.h>

Inheritance diagram for YDataStream:
Inheritance graph
[legend]

Public Member Functions

virtual double _decodeAvg (int dw, int count)
 
virtual double _decodeVal (int w)
 
virtual string _get_url (void)
 
virtual int _initFromDataSet (YDataSet *dataset, vector< int > encoded)
 
virtual int _parseStream (string sdata)
 
virtual double get_averageValue (void)
 
virtual int get_columnCount (void)
 
virtual vector< string > get_columnNames (void)
 
virtual double get_data (int row, int col)
 
virtual vector< vector< double > > get_dataRows (void)
 
virtual double get_dataSamplesInterval (void)
 
virtual int get_dataSamplesIntervalMs (void)
 
virtual int get_duration (void)
 
virtual double get_maxValue (void)
 
virtual double get_minValue (void)
 
virtual int get_rowCount (void)
 
virtual int get_runIndex (void)
 
virtual int get_startTime (void)
 
virtual s64 get_startTimeUTC (void)
 
virtual bool isClosed (void)
 
virtual int loadStream (void)
 
 YDataStream (YFunction *parent)
 
 YDataStream (YFunction *parent, YDataSet &dataset, const vector< int > &encoded)
 
virtual ~YDataStream ()
 

Static Public Attributes

static const double DATA_INVALID = Y_DATA_INVALID
 
static const int DURATION_INVALID = -1
 

Protected Attributes

double _avgVal
 
yCalibrationHandler _calhdl
 
vector< int > _calpar
 
vector< double > _calraw
 
vector< double > _calref
 
int _caltyp
 
vector< string > _columnNames
 
double _decexp
 
int _decimals
 
int _duration
 
string _functionId
 
bool _isAvg
 
bool _isClosed
 
bool _isScal
 
bool _isScal32
 
double _maxVal
 
double _minVal
 
int _nCols
 
int _nRows
 
double _offset
 
YFunction_parent
 
int _runNo
 
int _samplesPerHour
 
double _scale
 
s64 _utcStamp
 
vector< vector< double > > _values
 

Detailed Description

YDataStream Class: Unformatted data sequence

YDataStream objects represent bare recorded measure sequences, exactly as found within the data logger present on Yoctopuce sensors.

In most cases, it is not necessary to use YDataStream objects directly, as the YDataSet objects (returned by the get_recordedData() method from sensors and the get_dataSets() method from the data logger) provide a more convenient interface.

Definition at line 940 of file yocto_api.h.

Constructor & Destructor Documentation

YDataStream::YDataStream ( YFunction parent)

Definition at line 902 of file yocto_api.cpp.

YDataStream::YDataStream ( YFunction parent,
YDataSet dataset,
const vector< int > &  encoded 
)

Definition at line 931 of file yocto_api.cpp.

YDataStream::~YDataStream ( )
virtual

Definition at line 959 of file yocto_api.cpp.

Member Function Documentation

double YDataStream::_decodeAvg ( int  dw,
int  count 
)
virtual

Definition at line 1576 of file yocto_api.cpp.

double YDataStream::_decodeVal ( int  w)
virtual

Definition at line 1555 of file yocto_api.cpp.

string YDataStream::_get_url ( void  )
virtual

Definition at line 1542 of file yocto_api.cpp.

int YDataStream::_initFromDataSet ( YDataSet dataset,
vector< int >  encoded 
)
virtual

Definition at line 1367 of file yocto_api.cpp.

int YDataStream::_parseStream ( string  sdata)
virtual

Definition at line 1491 of file yocto_api.cpp.

double YDataStream::get_averageValue ( void  )
virtual

Returns the average of all measures observed within this stream. If the device uses a firmware older than version 13000, this method will always return Y_DATA_INVALID.

Returns
a floating-point number corresponding to the average value, or Y_DATA_INVALID if the stream is not yet complete (still recording).

On failure, throws an exception or returns Y_DATA_INVALID.

Definition at line 1756 of file yocto_api.cpp.

int YDataStream::get_columnCount ( void  )
virtual

Returns the number of data columns present in this stream. The meaning of the values present in each column can be obtained using the method get_columnNames().

If the device uses a firmware older than version 13000, this method fetches the whole data stream from the device if not yet done, which can cause a little delay.

Returns
an unsigned number corresponding to the number of columns.

On failure, throws an exception or returns zero.

Definition at line 1696 of file yocto_api.cpp.

vector< string > YDataStream::get_columnNames ( void  )
virtual

Returns the title (or meaning) of each data column present in this stream. In most case, the title of the data column is the hardware identifier of the sensor that produced the data. For streams recorded at a lower recording rate, the dataLogger stores the min, average and max value during each measure interval into three columns with suffixes _min, _avg and _max respectively.

If the device uses a firmware older than version 13000, this method fetches the whole data stream from the device if not yet done, which can cause a little delay.

Returns
a list containing as many strings as there are columns in the data stream.

On failure, throws an exception or returns an empty array.

Definition at line 1722 of file yocto_api.cpp.

double YDataStream::get_data ( int  row,
int  col 
)
virtual

Returns a single measure from the data stream, specified by its row and column index. The meaning of the values present in each column can be obtained using the method get_columnNames().

This method fetches the whole data stream from the device, if not yet done.

Parameters
row: row index
col: column index
Returns
a floating-point number

On failure, throws an exception or returns Y_DATA_INVALID.

Definition at line 1830 of file yocto_api.cpp.

vector< vector< double > > YDataStream::get_dataRows ( void  )
virtual

Returns the whole data set contained in the stream, as a bidimensional table of numbers. The meaning of the values present in each column can be obtained using the method get_columnNames().

This method fetches the whole data stream from the device, if not yet done.

Returns
a list containing as many elements as there are rows in the data stream. Each row itself is a list of floating-point numbers.

On failure, throws an exception or returns an empty array.

Definition at line 1806 of file yocto_api.cpp.

double YDataStream::get_dataSamplesInterval ( void  )
virtual

Reimplemented in YOldDataStream.

Definition at line 1658 of file yocto_api.cpp.

int YDataStream::get_dataSamplesIntervalMs ( void  )
virtual

Returns the number of milliseconds between two consecutive rows of this data stream. By default, the data logger records one row per second, but the recording frequency can be changed for each device function

Returns
an unsigned number corresponding to a number of milliseconds.

Definition at line 1653 of file yocto_api.cpp.

int YDataStream::get_duration ( void  )
virtual

Returns the approximate duration of this stream, in seconds.

Returns
the number of seconds covered by this stream.

On failure, throws an exception or returns Y_DURATION_INVALID.

Definition at line 1783 of file yocto_api.cpp.

double YDataStream::get_maxValue ( void  )
virtual

Returns the largest measure observed within this stream. If the device uses a firmware older than version 13000, this method will always return Y_DATA_INVALID.

Returns
a floating-point number corresponding to the largest value, or Y_DATA_INVALID if the stream is not yet complete (still recording).

On failure, throws an exception or returns Y_DATA_INVALID.

Definition at line 1771 of file yocto_api.cpp.

double YDataStream::get_minValue ( void  )
virtual

Returns the smallest measure observed within this stream. If the device uses a firmware older than version 13000, this method will always return Y_DATA_INVALID.

Returns
a floating-point number corresponding to the smallest value, or Y_DATA_INVALID if the stream is not yet complete (still recording).

On failure, throws an exception or returns Y_DATA_INVALID.

Definition at line 1741 of file yocto_api.cpp.

int YDataStream::get_rowCount ( void  )
virtual

Returns the number of data rows present in this stream.

If the device uses a firmware older than version 13000, this method fetches the whole data stream from the device if not yet done, which can cause a little delay.

Returns
an unsigned number corresponding to the number of rows.

On failure, throws an exception or returns zero.

Definition at line 1674 of file yocto_api.cpp.

int YDataStream::get_runIndex ( void  )
virtual

Returns the run index of the data stream. A run can be made of multiple datastreams, for different time intervals.

Returns
an unsigned number corresponding to the run index.

Definition at line 1608 of file yocto_api.cpp.

int YDataStream::get_startTime ( void  )
virtual

Returns the relative start time of the data stream, measured in seconds. For recent firmwares, the value is relative to the present time, which means the value is always negative. If the device uses a firmware older than version 13000, value is relative to the start of the time the device was powered on, and is always positive. If you need an absolute UTC timestamp, use get_startTimeUTC().

Returns
an unsigned number corresponding to the number of seconds between the start of the run and the beginning of this data stream.

Reimplemented in YOldDataStream.

Definition at line 1626 of file yocto_api.cpp.

s64 YDataStream::get_startTimeUTC ( void  )
virtual

Returns the start time of the data stream, relative to the Jan 1, 1970. If the UTC time was not set in the datalogger at the time of the recording of this data stream, this method returns 0.

Returns
an unsigned number corresponding to the number of seconds between the Jan 1, 1970 and the beginning of this data stream (i.e. Unix time representation of the absolute time).

Definition at line 1640 of file yocto_api.cpp.

bool YDataStream::isClosed ( void  )
virtual

Definition at line 1597 of file yocto_api.cpp.

int YDataStream::loadStream ( void  )
virtual

Reimplemented in YOldDataStream.

Definition at line 1550 of file yocto_api.cpp.

Member Data Documentation

double YDataStream::_avgVal
protected

Definition at line 965 of file yocto_api.h.

yCalibrationHandler YDataStream::_calhdl
protected

Definition at line 975 of file yocto_api.h.

vector<int> YDataStream::_calpar
protected

Definition at line 969 of file yocto_api.h.

vector<double> YDataStream::_calraw
protected

Definition at line 970 of file yocto_api.h.

vector<double> YDataStream::_calref
protected

Definition at line 971 of file yocto_api.h.

int YDataStream::_caltyp
protected

Definition at line 968 of file yocto_api.h.

vector<string> YDataStream::_columnNames
protected

Definition at line 954 of file yocto_api.h.

double YDataStream::_decexp
protected

Definition at line 967 of file yocto_api.h.

int YDataStream::_decimals
protected

Definition at line 960 of file yocto_api.h.

int YDataStream::_duration
protected

Definition at line 953 of file yocto_api.h.

string YDataStream::_functionId
protected

Definition at line 955 of file yocto_api.h.

bool YDataStream::_isAvg
protected

Definition at line 957 of file yocto_api.h.

bool YDataStream::_isClosed
protected

Definition at line 956 of file yocto_api.h.

bool YDataStream::_isScal
protected

Definition at line 958 of file yocto_api.h.

bool YDataStream::_isScal32
protected

Definition at line 959 of file yocto_api.h.

double YDataStream::_maxVal
protected

Definition at line 966 of file yocto_api.h.

double YDataStream::_minVal
protected

Definition at line 964 of file yocto_api.h.

int YDataStream::_nCols
protected

Definition at line 951 of file yocto_api.h.

int YDataStream::_nRows
protected

Definition at line 952 of file yocto_api.h.

double YDataStream::_offset
protected

Definition at line 961 of file yocto_api.h.

YFunction* YDataStream::_parent
protected

Definition at line 948 of file yocto_api.h.

int YDataStream::_runNo
protected

Definition at line 949 of file yocto_api.h.

int YDataStream::_samplesPerHour
protected

Definition at line 963 of file yocto_api.h.

double YDataStream::_scale
protected

Definition at line 962 of file yocto_api.h.

s64 YDataStream::_utcStamp
protected

Definition at line 950 of file yocto_api.h.

vector< vector<double> > YDataStream::_values
protected

Definition at line 972 of file yocto_api.h.

const double YDataStream::DATA_INVALID = Y_DATA_INVALID
static

Definition at line 983 of file yocto_api.h.

const int YDataStream::DURATION_INVALID = -1
static

Definition at line 984 of file yocto_api.h.


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


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:13