delphyne_gui
TopicInterfacePlugin Class Reference

Detailed Description

Implements a topic interface plugin.

The plugin subscribes to an ignition topic and updates in the UI the value of the message when it is received. Note that this plugin would subscribe to a topic in particular but will use Google protobuf's introspection and reflection API to parse the message and get its fields.

  • Use <topic>ignition_topic_name</topic> to configure the topic name.
  • Via the xml plugin configuration one can generate a blacklist of types. Use multiple nodes like <hide>attribute0::attribute1::attribute2</hide> to omit displaying that specific element and all its descendants.
  • Use <title>My fancy title</title> to select the widget display title.

#include <visualizer/topic_interface_plugin/topic_interface_plugin.h>

Inheritance diagram for TopicInterfacePlugin:
[legend]

Public Slots

void OnMessageReceived ()
 Updates the UI with the values of messageModel. More...
 

Signals

void MessageReceived ()
 Triggered from OnMessage() to synchronize the UI update. More...
 

Public Member Functions

 TopicInterfacePlugin ()
 Constructor. More...
 
void LoadConfig (const tinyxml2::XMLElement *_pluginElem) override
 Loads the plugin configuration. More...
 
QStandardItemModelModel ()
 Get the model of msgs & fields. More...
 
void OnMessage (const google::protobuf::Message &_msg)
 Callback executed when there is a new message from the topic. More...
 

Constructor & Destructor Documentation

◆ TopicInterfacePlugin()

Constructor.

Member Function Documentation

◆ LoadConfig()

void LoadConfig ( const tinyxml2::XMLElement *  _pluginElem)
override

Loads the plugin configuration.

See class description for the expected configuration.

Parameters
_pluginElemThe XML configuration of this plugin.

◆ MessageReceived

void MessageReceived ( )
signal

Triggered from OnMessage() to synchronize the UI update.

◆ Model()

QStandardItemModel * Model ( )

Get the model of msgs & fields.

Returns
Pointer to the model of msgs & fields

◆ OnMessage()

void OnMessage ( const google::protobuf::Message &  _msg)

Callback executed when there is a new message from the topic.

Update the message.

_msg is converted into a Message and set to be displayed.

Parameters
_msgThe received message.

◆ OnMessageReceived

void OnMessageReceived ( )
slot

Updates the UI with the values of messageModel.

Visits nodes in messageModel and creates / updates QStandardItems which are nested as a tree. New nodes in the tree are also registered in a dictionary for future quick reference when repeatedly calling this method.


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