datastream_zmq.h
Go to the documentation of this file.
1 #pragma once
2 #include <QDialog>
3 
4 #include <QtPlugin>
5 #include <thread>
8 #include "ui_datastream_zmq.h"
9 #include "zmq.hpp"
10 
11 class StreamZMQDialog : public QDialog
12 {
13  Q_OBJECT
14 
15 public:
16  explicit StreamZMQDialog(QWidget *parent = nullptr);
18 
19  Ui::DataStreamZMQ *ui;
20 
21 };
22 
23 
25 {
26  Q_OBJECT
27  Q_PLUGIN_METADATA(IID "facontidavide.PlotJuggler3.DataStreamer")
28  Q_INTERFACES(PJ::DataStreamer)
29 
30 public:
31  DataStreamZMQ();
32 
33  virtual ~DataStreamZMQ() override;
34 
35  virtual bool start(QStringList*) override;
36 
37  virtual void shutdown() override;
38 
39  virtual bool isRunning() const override
40  {
41  return _running;
42  }
43 
44  virtual const char* name() const override
45  {
46  return "ZMQ Subscriber";
47  }
48 
49  virtual bool isDebugPlugin() override
50  {
51  return false;
52  }
53 
54 private:
55  bool _running;
59  std::string _socket_address;
60  std::thread _receive_thread;
61 
62  void receiveLoop();
63 };
zmq::socket_t _zmq_socket
The DataStreamer base class to create your own plugin.
std::shared_ptr< MessageParser > MessageParserPtr
Ui::DataStreamZMQ * ui
std::thread _receive_thread
PJ::MessageParserPtr _parser
std::string _socket_address
zmq::context_t _zmq_context
StreamZMQDialog(QWidget *parent=nullptr)
virtual const char * name() const override
virtual bool isDebugPlugin() override
virtual bool isRunning() const override


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:47:34