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

The Frame class. More...

#include <Frame.h>

Collaboration diagram for JSON::Frame:
Collaboration graph

Public Member Functions

 ~Frame ()
 
void clear ()
 
QString title () const
 
int groupCount () const
 
QVector< Group > & groups ()
 
bool read (const QJsonObject &object)
 
Q_INVOKABLE const JSON::GroupgetGroup (const int index) const
 
bool isValid () const
 

Private Attributes

QString m_title
 
QVector< Groupm_groups
 

Detailed Description

The Frame class.

The frame class represents a complete frame, including the groups & datasets that compose it. This class allows Serial Studio to build the user interface dinamically from the received data.

The process of building a frame and representing it in Serial Studio is: 1) Physical device sends data 2) I/O driver receives data 3) I/O manager processes the data and separates the frames 4) JSON generator creates a JSON file with the data contained in each frame. 5) UI dashboard class receives the JSON file. 6) TimerEvents class notifies the UI dashboard that the user interface should be re-generated. 7) UI dashboard feeds JSON data to this class. 8) This class creates a model of the JSON data with the values of the latest frame. 9) UI dashboard updates the widgets with the C++ model provided by this class.

Constructor & Destructor Documentation

◆ ~Frame()

JSON::Frame::~Frame ( )

Destructor function, free memory used by the Group objects before destroying an instance of this class.

Member Function Documentation

◆ clear()

void JSON::Frame::clear ( )

Resets the frame title and frees the memory used by the Group objects associated to the instance of the Frame object.

◆ getGroup()

const JSON::Group & JSON::Frame::getGroup ( const int  index) const
Returns
The group at the given index

◆ groupCount()

int JSON::Frame::groupCount ( ) const

Returns the number of groups contained in the frame.

◆ groups()

QVector< JSON::Group > & JSON::Frame::groups ( )

Returns a vector of pointers to the Group objects associated to this frame.

◆ isValid()

bool JSON::Frame::isValid ( ) const
inline

◆ read()

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

Reads the frame information and all its asociated groups (and datatsets) from the given JSON object.

Returns
true on success, false on failure

◆ title()

QString JSON::Frame::title ( ) const

Returns the title of the frame.

Member Data Documentation

◆ m_groups

QVector<Group> JSON::Frame::m_groups
private

◆ m_title

QString JSON::Frame::m_title
private

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