Serial Studio 1.1.6
A dashboard software for your embedded projects
JSON::Dataset Class Reference

The Dataset class. More...

#include <Dataset.h>

Collaboration diagram for JSON::Dataset:
Collaboration graph

Public Member Functions

 Dataset ()
 
bool fft () const
 
bool led () const
 
bool log () const
 
int index () const
 
bool graph () const
 
double min () const
 
double max () const
 
double alarm () const
 
QString title () const
 
QString value () const
 
QString units () const
 
QString widget () const
 
int fftSamples () const
 
QJsonObject jsonData () const
 
bool read (const QJsonObject &object)
 

Private Attributes

bool m_fft
 
bool m_led
 
bool m_log
 
bool m_graph
 
QString m_title
 
QString m_value
 
QString m_units
 
QString m_widget
 
QJsonObject m_jsonData
 
int m_index
 
double m_max
 
double m_min
 
double m_alarm
 
int m_fftSamples
 

Friends

class Editor
 

Detailed Description

The Dataset class.

The dataset class represents the properties and values of an individual data unit.

For example, supose that you are reading the values of a temperature sensor. In this case, the dataset could have the following values:

  • Value: 21
  • Units: °C
  • Title: External temperature
  • Widget: "bar"
  • Graph: true
  • Max: 100
  • Min: -15
  • Alarm: 45

Description for each field of the dataset class:

  • Value: represents the current sensor reading/value.
  • Units: represents the measurement units of the reading.
  • Title: description of the dataset.
  • Widget: widget that shall be used to represents the value, for example, a level widget, a gauge, a compass, etc.
  • Graph: if set to true, Serial Studio shall plot the value in realtime.
  • Max: maximum value of the dataset, used for gauges & bars.
  • Min: minimum value of the dataset, used for gauges & bars.
  • Alarm: if the value exceeds the alarm level, bar widgets shall be rendered with a dark-red background.
Note
All of the dataset fields are optional, except the "value" field and the "title" field.

Constructor & Destructor Documentation

◆ Dataset()

JSON::Dataset::Dataset ( )

Member Function Documentation

◆ alarm()

double JSON::Dataset::alarm ( ) const

Returns the alarm level of the dataset

◆ fft()

bool JSON::Dataset::fft ( ) const
Returns
true if the UI should generate a FFT plot of this dataset

◆ fftSamples()

int JSON::Dataset::fftSamples ( ) const

Returns the maximum freq. for the FFT transform

◆ graph()

bool JSON::Dataset::graph ( ) const
Returns
true if the UI should graph this dataset

◆ index()

int JSON::Dataset::index ( ) const
Returns
the field index represented by the current dataset

◆ jsonData()

QJsonObject JSON::Dataset::jsonData ( ) const

Returns the JSON data that represents this widget

◆ led()

bool JSON::Dataset::led ( ) const
Returns
true if the UI should generate a LED of this dataset

◆ log()

bool JSON::Dataset::log ( ) const
Returns
true if the UI should generate a logarithmic plot of this dataset

◆ max()

double JSON::Dataset::max ( ) const

Returns the maximum value of the dataset

◆ min()

double JSON::Dataset::min ( ) const

Returns the minimum value of the dataset

◆ read()

bool JSON::Dataset::read ( const QJsonObject &  object)

Reads dataset information from the given object and evaluates any JS code in the "value" field of the dataset.

Returns
true on read success, false on failure

◆ title()

QString JSON::Dataset::title ( ) const
Returns
The title/description of this dataset

◆ units()

QString JSON::Dataset::units ( ) const
Returns
The units of this dataset

◆ value()

QString JSON::Dataset::value ( ) const
Returns
The value/reading of this dataset

◆ widget()

QString JSON::Dataset::widget ( ) const
Returns
The widget value of this dataset

Friends And Related Function Documentation

◆ Editor

friend class Editor
friend

Member Data Documentation

◆ m_alarm

double JSON::Dataset::m_alarm
private

◆ m_fft

bool JSON::Dataset::m_fft
private

◆ m_fftSamples

int JSON::Dataset::m_fftSamples
private

◆ m_graph

bool JSON::Dataset::m_graph
private

◆ m_index

int JSON::Dataset::m_index
private

◆ m_jsonData

QJsonObject JSON::Dataset::m_jsonData
private

◆ m_led

bool JSON::Dataset::m_led
private

◆ m_log

bool JSON::Dataset::m_log
private

◆ m_max

double JSON::Dataset::m_max
private

◆ m_min

double JSON::Dataset::m_min
private

◆ m_title

QString JSON::Dataset::m_title
private

◆ m_units

QString JSON::Dataset::m_units
private

◆ m_value

QString JSON::Dataset::m_value
private

◆ m_widget

QString JSON::Dataset::m_widget
private

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