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

#include <yocto_api.h>

Public Member Functions

virtual vector< int > _get_calibration (void)
 
int _parse (const string &json)
 
virtual s64 get_endTimeUTC (void)
 
virtual string get_functionId (void)
 
virtual string get_hardwareId (void)
 
virtual vector< YMeasureget_measures (void)
 
virtual vector< YMeasureget_measuresAt (YMeasure measure)
 
virtual vector< YMeasureget_preview (void)
 
virtual vector< YDataStream * > get_privateDataStreams (void)
 
virtual int get_progress (void)
 
virtual s64 get_startTimeUTC (void)
 
virtual YMeasure get_summary (void)
 
virtual string get_unit (void)
 
virtual int loadMore (void)
 
virtual int processMore (int progress, string data)
 
 YDataSet (YFunction *parent, const string &functionId, const string &unit, s64 startTime, s64 endTime)
 
 YDataSet (YFunction *parent)
 

Protected Attributes

vector< int > _calib
 
s64 _endTime
 
string _functionId
 
string _hardwareId
 
vector< YMeasure_measures
 
YFunction_parent
 
vector< YMeasure_preview
 
int _progress
 
s64 _startTime
 
vector< YDataStream * > _streams
 
YMeasure _summary
 
string _unit
 

Detailed Description

YDataSet Class: Recorded data sequence

YDataSet objects make it possible to retrieve a set of recorded measures for a given sensor and a specified time interval. They can be used to load data points with a progress report. When the YDataSet object is instantiated by the get_recordedData() function, no data is yet loaded from the module. It is only when the loadMore() method is called over and over than data will be effectively loaded from the dataLogger.

A preview of available measures is available using the function get_preview() as soon as loadMore() has been called once. Measures themselves are available using function get_measures() when loaded by subsequent calls to loadMore().

This class can only be used on devices that use a recent firmware, as YDataSet objects are not supported by firmwares older than version 13000.

Definition at line 1290 of file yocto_api.h.

Constructor & Destructor Documentation

YDataSet::YDataSet ( YFunction parent,
const string &  functionId,
const string &  unit,
s64  startTime,
s64  endTime 
)

Definition at line 969 of file yocto_api.cpp.

YDataSet::YDataSet ( YFunction parent)

Definition at line 987 of file yocto_api.cpp.

Member Function Documentation

vector< int > YDataSet::_get_calibration ( void  )
virtual

Definition at line 1966 of file yocto_api.cpp.

int YDataSet::_parse ( const string &  json)

Definition at line 1002 of file yocto_api.cpp.

s64 YDataSet::get_endTimeUTC ( void  )
virtual

Returns the end time of the dataset, relative to the Jan 1, 1970. When the YDataSet is created, the end time is the value passed in parameter to the get_dataSet() function. After the very first call to loadMore(), the end time is updated to reflect the timestamp of the last measure actually found in the dataLogger within the specified range.

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

Definition at line 2109 of file yocto_api.cpp.

string YDataSet::get_functionId ( void  )
virtual

Returns the hardware identifier of the function that performed the measure, without reference to the module. For example temperature1.

Returns
a string that identifies the function (ex: temperature1)

Definition at line 2063 of file yocto_api.cpp.

string YDataSet::get_hardwareId ( void  )
virtual

Returns the unique hardware identifier of the function who performed the measures, in the form SERIAL.FUNCTIONID. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the function (for example THRMCPL1-123456.temperature1)

Returns
a string that uniquely identifies the function (ex: THRMCPL1-123456.temperature1)

On failure, throws an exception or returns Y_HARDWAREID_INVALID.

Definition at line 2046 of file yocto_api.cpp.

vector< YMeasure > YDataSet::get_measures ( void  )
virtual

Returns all measured values currently available for this DataSet, as a list of YMeasure objects. Each item includes:

  • the start of the measure time interval
  • the end of the measure time interval
  • the minimal value observed during the time interval
  • the average value observed during the time interval
  • the maximal value observed during the time interval

Before calling this method, you should call loadMore() to load data from the device. You may have to call loadMore() several time until all rows are loaded, but you can start looking at available data rows before the load is complete.

The oldest measures are always loaded first, and the most recent measures will be loaded last. As a result, timestamps are normally sorted in ascending order within the measure table, unless there was an unexpected adjustment of the datalogger UTC clock.

Returns
a table of records, where each record depicts the measured value for a given time interval

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

Definition at line 2302 of file yocto_api.cpp.

vector< YMeasure > YDataSet::get_measuresAt ( YMeasure  measure)
virtual

Returns the detailed set of measures for the time interval corresponding to a given condensed measures previously returned by get_preview(). The result is provided as a list of YMeasure objects.

Parameters
measure: condensed measure from the list previously returned by get_preview().
Returns
a table of records, where each record depicts the measured values during a time interval

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

Definition at line 2221 of file yocto_api.cpp.

vector< YMeasure > YDataSet::get_preview ( void  )
virtual

Returns a condensed version of the measures that can retrieved in this YDataSet, as a list of YMeasure objects. Each item includes:

  • the start of a time interval
  • the end of a time interval
  • the minimal value observed during the time interval
  • the average value observed during the time interval
  • the maximal value observed during the time interval

This preview is available as soon as loadMore() has been called for the first time.

Returns
a table of records, where each record depicts the measured values during a time interval

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

Definition at line 2203 of file yocto_api.cpp.

vector< YDataStream * > YDataSet::get_privateDataStreams ( void  )
virtual

Definition at line 2031 of file yocto_api.cpp.

int YDataSet::get_progress ( void  )
virtual

Returns the progress of the downloads of the measures from the data logger, on a scale from 0 to 100. When the object is instantiated by get_dataSet, the progress is zero. Each time loadMore() is invoked, the progress is updated, to reach the value 100 only once all measures have been loaded.

Returns
an integer in the range 0 to 100 (percentage of completion).

Definition at line 2122 of file yocto_api.cpp.

s64 YDataSet::get_startTimeUTC ( void  )
virtual

Returns the start time of the dataset, relative to the Jan 1, 1970. When the YDataSet is created, the start time is the value passed in parameter to the get_dataSet() function. After the very first call to loadMore(), the start time is updated to reflect the timestamp of the first measure actually found in the dataLogger within the specified range.

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

Definition at line 2092 of file yocto_api.cpp.

YMeasure YDataSet::get_summary ( void  )
virtual

Returns an YMeasure object which summarizes the whole DataSet. In includes the following information:

  • the start of a time interval
  • the end of a time interval
  • the minimal value observed during the time interval
  • the average value observed during the time interval
  • the maximal value observed during the time interval

This summary is available as soon as loadMore() has been called for the first time.

Returns
an YMeasure object

Definition at line 2180 of file yocto_api.cpp.

string YDataSet::get_unit ( void  )
virtual

Returns the measuring unit for the measured value.

Returns
a string that represents a physical unit.

On failure, throws an exception or returns Y_UNIT_INVALID.

Definition at line 2075 of file yocto_api.cpp.

int YDataSet::loadMore ( void  )
virtual

Loads the the next block of measures from the dataLogger, and updates the progress indicator.

Returns
an integer in the range 0 to 100 (percentage of completion), or a negative error code in case of failure.

On failure, throws an exception or returns a negative error code.

Definition at line 2143 of file yocto_api.cpp.

int YDataSet::processMore ( int  progress,
string  data 
)
virtual

Definition at line 1971 of file yocto_api.cpp.

Member Data Documentation

vector<int> YDataSet::_calib
protected

Definition at line 1305 of file yocto_api.h.

s64 YDataSet::_endTime
protected

Definition at line 1303 of file yocto_api.h.

string YDataSet::_functionId
protected

Definition at line 1300 of file yocto_api.h.

string YDataSet::_hardwareId
protected

Definition at line 1299 of file yocto_api.h.

vector<YMeasure> YDataSet::_measures
protected

Definition at line 1309 of file yocto_api.h.

YFunction* YDataSet::_parent
protected

Definition at line 1298 of file yocto_api.h.

vector<YMeasure> YDataSet::_preview
protected

Definition at line 1308 of file yocto_api.h.

int YDataSet::_progress
protected

Definition at line 1304 of file yocto_api.h.

s64 YDataSet::_startTime
protected

Definition at line 1302 of file yocto_api.h.

vector<YDataStream*> YDataSet::_streams
protected

Definition at line 1306 of file yocto_api.h.

YMeasure YDataSet::_summary
protected

Definition at line 1307 of file yocto_api.h.

string YDataSet::_unit
protected

Definition at line 1301 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