delphyne_gui
|
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.
<topic>ignition_topic_name</topic>
to configure the topic name.<hide>attribute0::attribute1::attribute2</hide>
to omit displaying that specific element and all its descendants.<title>My fancy title</title>
to select the widget display title. #include <visualizer/topic_interface_plugin/topic_interface_plugin.h>
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... | |
QStandardItemModel * | Model () |
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.
|
override |
Loads the plugin configuration.
See class description for the expected configuration.
_pluginElem | The XML configuration of this plugin. |
|
signal |
Triggered from OnMessage() to synchronize the UI update.
QStandardItemModel * Model | ( | ) |
Get the model of msgs & fields.
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.
_msg | The received message. |
|
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.