datastream_sample.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QtPlugin>
4 #include <thread>
6 
8 {
9  Q_OBJECT
10  Q_PLUGIN_METADATA(IID "facontidavide.PlotJuggler3.DataStreamer")
11  Q_INTERFACES(PJ::DataStreamer)
12 
13 public:
15 
16  virtual bool start(QStringList*) override;
17 
18  virtual void shutdown() override;
19 
20  virtual bool isRunning() const override;
21 
22  virtual ~DataStreamSample() override;
23 
24  virtual const char* name() const override
25  {
26  return "Dummy Streamer";
27  }
28 
29  virtual bool isDebugPlugin() override
30  {
31  return true;
32  }
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  std::pair<QAction*, int> notificationAction() override
40  {
42  }
43 
44 private:
45  struct Parameters
46  {
47  double A, B, C, D;
48  };
49 
50  void loop();
51 
52  std::thread _thread;
53 
54  bool _running;
55 
56  std::map<std::string, Parameters> _parameters;
57 
58  void pushSingleCycle();
59 
61 
63 };
virtual bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override
Override this method to save the status of the plugin to XML.
virtual ~DataStreamSample() override
virtual bool start(QStringList *) override
start streaming.
The DataStreamer base classm used to read streaming of data.
virtual bool isDebugPlugin() override
virtual const char * name() const override
Name of the plugin type, NOT the particular instance.
virtual void shutdown() override
shutdown Stop streaming
virtual bool isRunning() const override
isRunning
virtual bool xmlLoadState(const QDomElement &parent_element) override
Override this method to load the status of the plugin from XML.
std::map< std::string, Parameters > _parameters
QAction * _dummy_notification
std::pair< QAction *, int > notificationAction() override
Gets the action to execute when clicking the &#39;notifications&#39; button and the current number of outstan...


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