Signals | Public Member Functions | Private Attributes | List of all members
PJ::DataStreamer Class Referenceabstract

The DataStreamer base classm used to read streaming of data. More...

#include <datastreamer_base.h>

Inheritance diagram for PJ::DataStreamer:
Inheritance graph
[legend]

Signals

void clearBuffers ()
 Request the main application to clear previous data points. More...
 
void closed ()
 
void dataReceived ()
 
void notificationsChanged (int active_notification_count)
 
void removeGroup (std::string group_name)
 All the series which share this group, will be deleted. More...
 

Public Member Functions

PlotDataMapRefdataMap ()
 
const PlotDataMapRefdataMap () const
 
 DataStreamer ()=default
 
virtual bool isRunning () const =0
 isRunning More...
 
std::mutex & mutex ()
 
virtual std::pair< QAction *, int > notificationAction ()
 Gets the action to execute when clicking the 'notifications' button and the current number of outstanding notifications. More...
 
const ParserFactoriesparserFactories () const
 
void setMaximumRangeX (double range)
 
void setParserFactories (ParserFactories *parsers)
 
virtual void shutdown ()=0
 shutdown Stop streaming More...
 
virtual bool start (QStringList *pre_selected_sources)=0
 start streaming. More...
 
virtual ~DataStreamer ()=default
 
- Public Member Functions inherited from PJ::PlotJugglerPlugin
virtual const std::vector< QAction * > & availableActions ()
 
virtual bool isDebugPlugin ()
 
virtual const char * name () const =0
 Name of the plugin type, NOT the particular instance. More...
 
virtual QWidget * optionsWidget ()
 optionsWidget pointer to a persistent widget used to set the plugin options . More...
 
 PlotJugglerPlugin ()=default
 
virtual bool xmlLoadState (const QDomElement &parent_element)
 Override this method to load the status of the plugin from XML. More...
 
QDomElement xmlSaveState (QDomDocument &doc) const
 
virtual bool xmlSaveState (QDomDocument &doc, QDomElement &parent_element) const
 Override this method to save the status of the plugin to XML. More...
 

Private Attributes

PlotDataMapRef _data_map
 
std::mutex _mutex
 
ParserFactories_parser_factories = nullptr
 
QAction * _start_streamer
 

Detailed Description

The DataStreamer base classm used to read streaming of data.

Important. To avoid problems with thread safety, ANY update to dataMap(), which share its elements with the main application, must be protected using the mutex().

Definition at line 25 of file datastreamer_base.h.

Constructor & Destructor Documentation

◆ DataStreamer()

PJ::DataStreamer::DataStreamer ( )
default

◆ ~DataStreamer()

virtual PJ::DataStreamer::~DataStreamer ( )
virtualdefault

Member Function Documentation

◆ clearBuffers

void PJ::DataStreamer::clearBuffers ( )
signal

Request the main application to clear previous data points.

◆ closed

void PJ::DataStreamer::closed ( )
signal

The method shutdown () is used by the main app to stop streaming. When the plugin stops itself, this signal must be emitted.

◆ dataMap() [1/2]

PlotDataMapRef& PJ::DataStreamer::dataMap ( )
inline

Definition at line 69 of file datastreamer_base.h.

◆ dataMap() [2/2]

const PlotDataMapRef& PJ::DataStreamer::dataMap ( ) const
inline

Definition at line 74 of file datastreamer_base.h.

◆ dataReceived

void PJ::DataStreamer::dataReceived ( )
signal

Signal to be published periodically to notify to the main app that new data is available.

◆ isRunning()

virtual bool PJ::DataStreamer::isRunning ( ) const
pure virtual

isRunning

Returns
true if start() called, false after shutwodn()

Implemented in WebsocketServer, UDP_Server, DataStreamZMQ, DataStreamZcm, DataStreamMQTT, and DataStreamSample.

◆ mutex()

std::mutex& PJ::DataStreamer::mutex ( )
inline

Definition at line 62 of file datastreamer_base.h.

◆ notificationAction()

virtual std::pair<QAction*, int> PJ::DataStreamer::notificationAction ( )
inlinevirtual

Gets the action to execute when clicking the 'notifications' button and the current number of outstanding notifications.

Reimplemented in DataStreamMQTT, and DataStreamSample.

Definition at line 57 of file datastreamer_base.h.

◆ notificationsChanged

void PJ::DataStreamer::notificationsChanged ( int  active_notification_count)
signal

◆ parserFactories()

const ParserFactories * PJ::DataStreamer::parserFactories ( ) const

Definition at line 34 of file datastreamer_base.cpp.

◆ removeGroup

void PJ::DataStreamer::removeGroup ( std::string  group_name)
signal

All the series which share this group, will be deleted.

◆ setMaximumRangeX()

void PJ::DataStreamer::setMaximumRangeX ( double  range)

Definition at line 12 of file datastreamer_base.cpp.

◆ setParserFactories()

void PJ::DataStreamer::setParserFactories ( ParserFactories parsers)

Definition at line 29 of file datastreamer_base.cpp.

◆ shutdown()

virtual void PJ::DataStreamer::shutdown ( )
pure virtual

shutdown Stop streaming

Implemented in WebsocketServer, UDP_Server, DataStreamZMQ, DataStreamZcm, DataStreamMQTT, and DataStreamSample.

◆ start()

virtual bool PJ::DataStreamer::start ( QStringList *  pre_selected_sources)
pure virtual

start streaming.

Parameters
optionallist of pre selected sources.
Returns
true if started correctly.

Implemented in WebsocketServer, UDP_Server, DataStreamZMQ, DataStreamZcm, DataStreamMQTT, and DataStreamSample.

Member Data Documentation

◆ _data_map

PlotDataMapRef PJ::DataStreamer::_data_map
private

Definition at line 105 of file datastreamer_base.h.

◆ _mutex

std::mutex PJ::DataStreamer::_mutex
private

Definition at line 104 of file datastreamer_base.h.

◆ _parser_factories

ParserFactories* PJ::DataStreamer::_parser_factories = nullptr
private

Definition at line 107 of file datastreamer_base.h.

◆ _start_streamer

QAction* PJ::DataStreamer::_start_streamer
private

Definition at line 106 of file datastreamer_base.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:31