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 };
DataStreamSample::Parameters::A
double A
Definition: datastream_sample.h:47
DataStreamSample::Parameters
Definition: datastream_sample.h:45
DataStreamSample::_notifications_count
int _notifications_count
Definition: datastream_sample.h:62
DataStreamSample::notificationAction
std::pair< QAction *, int > notificationAction() override
Gets the action to execute when clicking the 'notifications' button and the current number of outstan...
Definition: datastream_sample.h:39
DataStreamSample::_thread
std::thread _thread
Definition: datastream_sample.h:52
DataStreamSample::isRunning
virtual bool isRunning() const override
isRunning
Definition: datastream_sample.cpp:72
DataStreamSample::name
virtual const char * name() const override
Name of the plugin type, NOT the particular instance.
Definition: datastream_sample.h:24
DataStreamSample::Parameters::B
double B
Definition: datastream_sample.h:47
PJ::DataStreamer
The DataStreamer base classm used to read streaming of data.
Definition: datastreamer_base.h:25
DataStreamSample::DataStreamSample
DataStreamSample()
Definition: datastream_sample.cpp:14
DataStreamSample::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_sample.cpp:82
DataStreamSample::isDebugPlugin
virtual bool isDebugPlugin() override
Definition: datastream_sample.h:29
DataStreamSample::Parameters::C
double C
Definition: datastream_sample.h:47
DataStreamSample::_dummy_notification
QAction * _dummy_notification
Definition: datastream_sample.h:60
DataStreamSample::pushSingleCycle
void pushSingleCycle()
Definition: datastream_sample.cpp:92
DataStreamSample::_parameters
std::map< std::string, Parameters > _parameters
Definition: datastream_sample.h:56
DataStreamSample::~DataStreamSample
virtual ~DataStreamSample() override
Definition: datastream_sample.cpp:77
DataStreamSample::_running
bool _running
Definition: datastream_sample.h:54
DataStreamSample::start
virtual bool start(QStringList *) override
start streaming.
Definition: datastream_sample.cpp:55
DataStreamSample::shutdown
virtual void shutdown() override
shutdown Stop streaming
Definition: datastream_sample.cpp:63
DataStreamSample::Parameters::D
double D
Definition: datastream_sample.h:47
DataStreamSample
Definition: datastream_sample.h:7
datastreamer_base.h
DataStreamSample::xmlLoadState
virtual bool xmlLoadState(const QDomElement &parent_element) override
Override this method to load the status of the plugin from XML.
Definition: datastream_sample.cpp:87
DataStreamSample::loop
void loop()
Definition: datastream_sample.cpp:129


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