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,
50  zcm_field_type_t type,
51  const void* data, void* usr);
52 
53  std::vector<std::pair<std::string, double>> _numerics;
54  std::vector<std::pair<std::string, std::string>> _strings;
55 
56  void handler(const zcm::ReceiveBuffer* rbuf, const std::string& channel);
57 
58  bool _running;
59  QString _types_library;
61  QString _transport;
62 
63  QDialog* _dialog;
64  Ui::DialogZcm* _ui;
66 };
void on_pushButtonUrl_clicked()
QString _types_library
QString _subscribe_string
std::unique_ptr< zcm::TypeDb > _types
virtual bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override
Override this method to save the status of the plugin to XML.
std::unique_ptr< zcm::ZCM > _zcm
QString _transport
ConfigZCM * _config_widget
The DataStreamer base classm used to read streaming of data.
virtual ~DataStreamZcm()
void handler(const zcm::ReceiveBuffer *rbuf, const std::string &channel)
type
Definition: core.h:1059
zcm::Subscription * _subs
virtual bool isRunning() const override
isRunning
std::vector< std::pair< std::string, std::string > > _strings
virtual void shutdown() override
shutdown Stop streaming
static void processData(const std::string &name, zcm_field_type_t type, const void *data, void *usr)
virtual const char * name() const override
Name of the plugin type, NOT the particular instance.
Ui::DialogZcm * _ui
virtual bool xmlLoadState(const QDomElement &parent_element) override
Override this method to load the status of the plugin from XML.
std::vector< std::pair< std::string, double > > _numerics
QDialog * _dialog
virtual bool start(QStringList *) override
start streaming.
Definition: format.h:895


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:01