datastream_zcm.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QtPlugin>
4 #include <thread>
6 
7 #include <zcm/zcm-cpp.hpp>
8 
9 #include <zcm/tools/TypeDb.hpp>
10 #include <zcm/tools/Introspection.hpp>
11 
12 #include "config_zcm.h"
13 #include "ui_datastream_zcm.h"
14 
16 {
17  Q_OBJECT
18  Q_PLUGIN_METADATA(IID "facontidavide.PlotJuggler3.DataStreamer")
19  Q_INTERFACES(PJ::DataStreamer)
20 
21 public:
22  DataStreamZcm();
23 
24  virtual ~DataStreamZcm();
25 
26  virtual const char* name() const override;
27 
28  virtual bool start(QStringList*) override;
29 
30  virtual void shutdown() override;
31 
32  virtual bool isRunning() const override;
33 
34  virtual bool xmlSaveState(QDomDocument& doc,
35  QDomElement& parent_element) const override;
36 
37  virtual bool xmlLoadState(const QDomElement& parent_element) override;
38 
39 private slots:
41 
42 private:
43  std::unique_ptr<zcm::TypeDb> _types;
44 
45  std::unique_ptr<zcm::ZCM> _zcm;
46 
47  zcm::Subscription* _subs = nullptr;
48 
49  static void processData(const std::string& name, zcm_field_type_t type,
50  const void* data, void* usr);
51 
52  std::vector<std::pair<std::string, double>> _numerics;
53  std::vector<std::pair<std::string, std::string>> _strings;
54 
55  void handler(const zcm::ReceiveBuffer* rbuf, const std::string& channel);
56 
57  bool _running;
58  QString _types_library;
60  QString _transport;
61 
62  QDialog* _dialog;
63  Ui::DialogZcm* _ui;
65 };
DataStreamZcm::xmlSaveState
virtual bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override
Override this method to save the status of the plugin to XML.
Definition: datastream_zcm.cpp:160
DataStreamZcm::_numerics
std::vector< std::pair< std::string, double > > _numerics
Definition: datastream_zcm.h:52
DataStreamZcm
Definition: datastream_zcm.h:15
DataStreamZcm::_dialog
QDialog * _dialog
Definition: datastream_zcm.h:62
ConfigZCM
Definition: config_zcm.h:10
DataStreamZcm::_ui
Ui::DialogZcm * _ui
Definition: datastream_zcm.h:63
backward::ColorMode::type
type
Definition: backward.hpp:3600
config_zcm.h
DataStreamZcm::_subscribe_string
QString _subscribe_string
Definition: datastream_zcm.h:59
DataStreamZcm::_running
bool _running
Definition: datastream_zcm.h:57
DataStreamZcm::_types_library
QString _types_library
Definition: datastream_zcm.h:58
DataStreamZcm::~DataStreamZcm
virtual ~DataStreamZcm()
Definition: datastream_zcm.cpp:35
DataStreamZcm::start
virtual bool start(QStringList *) override
start streaming.
Definition: datastream_zcm.cpp:46
PJ::DataStreamer
The DataStreamer base classm used to read streaming of data.
Definition: datastreamer_base.h:25
DataStreamZcm::_types
std::unique_ptr< zcm::TypeDb > _types
Definition: datastream_zcm.h:43
DataStreamZcm::xmlLoadState
virtual bool xmlLoadState(const QDomElement &parent_element) override
Override this method to load the status of the plugin from XML.
Definition: datastream_zcm.cpp:171
DataStreamZcm::handler
void handler(const zcm::ReceiveBuffer *rbuf, const std::string &channel)
Definition: datastream_zcm.cpp:226
DataStreamZcm::processData
static void processData(const std::string &name, zcm_field_type_t type, const void *data, void *usr)
Definition: datastream_zcm.cpp:188
DataStreamZcm::DataStreamZcm
DataStreamZcm()
Definition: datastream_zcm.cpp:25
DataStreamZcm::on_pushButtonUrl_clicked
void on_pushButtonUrl_clicked()
Definition: datastream_zcm.cpp:259
DataStreamZcm::_transport
QString _transport
Definition: datastream_zcm.h:60
DataStreamZcm::_zcm
std::unique_ptr< zcm::ZCM > _zcm
Definition: datastream_zcm.h:45
mqtt_test.data
dictionary data
Definition: mqtt_test.py:22
DataStreamZcm::_subs
zcm::Subscription * _subs
Definition: datastream_zcm.h:47
DataStreamZcm::_strings
std::vector< std::pair< std::string, std::string > > _strings
Definition: datastream_zcm.h:53
DataStreamZcm::_config_widget
ConfigZCM * _config_widget
Definition: datastream_zcm.h:64
DataStreamZcm::shutdown
virtual void shutdown() override
shutdown Stop streaming
Definition: datastream_zcm.cpp:139
datastreamer_base.h
DataStreamZcm::name
virtual const char * name() const override
Name of the plugin type, NOT the particular instance.
Definition: datastream_zcm.cpp:41
DataStreamZcm::isRunning
virtual bool isRunning() const override
isRunning
Definition: datastream_zcm.cpp:155


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