Public Member Functions | Private Slots | Private Attributes | List of all members
DataStreamMQTT Class Reference

#include <datastream_mqtt.h>

Inheritance diagram for DataStreamMQTT:
Inheritance graph
[legend]

Public Member Functions

 DataStreamMQTT ()
 
virtual bool isDebugPlugin () override
 
virtual bool isRunning () const override
 isRunning More...
 
virtual const char * name () const override
 Name of the plugin type, NOT the particular instance. More...
 
std::pair< QAction *, int > notificationAction () override
 Gets the action to execute when clicking the 'notifications' button and the current number of outstanding notifications. More...
 
virtual void shutdown () override
 shutdown Stop streaming More...
 
virtual bool start (QStringList *) override
 start streaming. More...
 
 ~DataStreamMQTT () override
 
- Public Member Functions inherited from PJ::DataStreamer
PlotDataMapRefdataMap ()
 
const PlotDataMapRefdataMap () const
 
 DataStreamer ()=default
 
std::mutex & mutex ()
 
const ParserFactoriesparserFactories () const
 
void setMaximumRangeX (double range)
 
void setParserFactories (ParserFactories *parsers)
 
virtual ~DataStreamer ()=default
 
- Public Member Functions inherited from PJ::PlotJugglerPlugin
virtual const std::vector< QAction * > & availableActions ()
 
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 Slots

void onComboProtocolChanged (const QString &)
 
void onMessageReceived (const mosquitto_message *message)
 

Private Attributes

ParserFactoryPlugin::Ptr _current_parser_creator
 
MQTT_Dialog_dialog
 
int _failed_parsing = 0
 
MQTTClient::Ptr _mosq
 
std::thread _mqtt_thread
 
QAction * _notification_action
 
std::unordered_map< std::string, PJ::MessageParserPtr_parsers
 
QString _protocol
 
bool _running
 
QString _topic_to_parse
 

Additional Inherited Members

- Signals inherited from PJ::DataStreamer
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...
 

Detailed Description

Definition at line 15 of file datastream_mqtt.h.

Constructor & Destructor Documentation

◆ DataStreamMQTT()

DataStreamMQTT::DataStreamMQTT ( )

Definition at line 10 of file datastream_mqtt.cpp.

◆ ~DataStreamMQTT()

DataStreamMQTT::~DataStreamMQTT ( )
override

Definition at line 30 of file datastream_mqtt.cpp.

Member Function Documentation

◆ isDebugPlugin()

virtual bool DataStreamMQTT::isDebugPlugin ( )
inlineoverridevirtual

Override this to return true, if you want this plugin to be loaded only when the command line option [-t] is used.

Reimplemented from PJ::PlotJugglerPlugin.

Definition at line 37 of file datastream_mqtt.h.

◆ isRunning()

bool DataStreamMQTT::isRunning ( ) const
overridevirtual

isRunning

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

Implements PJ::DataStreamer.

Definition at line 120 of file datastream_mqtt.cpp.

◆ name()

virtual const char* DataStreamMQTT::name ( ) const
inlineoverridevirtual

Name of the plugin type, NOT the particular instance.

Implements PJ::PlotJugglerPlugin.

Definition at line 32 of file datastream_mqtt.h.

◆ notificationAction()

std::pair<QAction*, int> DataStreamMQTT::notificationAction ( )
inlineoverridevirtual

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

Reimplemented from PJ::DataStreamer.

Definition at line 42 of file datastream_mqtt.h.

◆ onComboProtocolChanged

void DataStreamMQTT::onComboProtocolChanged ( const QString &  selected_protocol)
privateslot

Definition at line 125 of file datastream_mqtt.cpp.

◆ onMessageReceived

void DataStreamMQTT::onMessageReceived ( const mosquitto_message *  message)
privateslot

Definition at line 142 of file datastream_mqtt.cpp.

◆ shutdown()

void DataStreamMQTT::shutdown ( )
overridevirtual

shutdown Stop streaming

Implements PJ::DataStreamer.

Definition at line 109 of file datastream_mqtt.cpp.

◆ start()

bool DataStreamMQTT::start ( QStringList *  pre_selected_sources)
overridevirtual

start streaming.

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

Implements PJ::DataStreamer.

Definition at line 36 of file datastream_mqtt.cpp.

Member Data Documentation

◆ _current_parser_creator

ParserFactoryPlugin::Ptr DataStreamMQTT::_current_parser_creator
private

Definition at line 69 of file datastream_mqtt.h.

◆ _dialog

MQTT_Dialog* DataStreamMQTT::_dialog
private

Definition at line 68 of file datastream_mqtt.h.

◆ _failed_parsing

int DataStreamMQTT::_failed_parsing = 0
private

Definition at line 66 of file datastream_mqtt.h.

◆ _mosq

MQTTClient::Ptr DataStreamMQTT::_mosq
private

Definition at line 58 of file datastream_mqtt.h.

◆ _mqtt_thread

std::thread DataStreamMQTT::_mqtt_thread
private

Definition at line 60 of file datastream_mqtt.h.

◆ _notification_action

QAction* DataStreamMQTT::_notification_action
private

Definition at line 65 of file datastream_mqtt.h.

◆ _parsers

std::unordered_map<std::string, PJ::MessageParserPtr> DataStreamMQTT::_parsers
private

Definition at line 56 of file datastream_mqtt.h.

◆ _protocol

QString DataStreamMQTT::_protocol
private

Definition at line 61 of file datastream_mqtt.h.

◆ _running

bool DataStreamMQTT::_running
private

Definition at line 54 of file datastream_mqtt.h.

◆ _topic_to_parse

QString DataStreamMQTT::_topic_to_parse
private

Definition at line 63 of file datastream_mqtt.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:50