datastream_sample.h
Go to the documentation of this file.
00001 #ifndef DATASTREAM_SAMPLE_CSV_H
00002 #define DATASTREAM_SAMPLE_CSV_H
00003 
00004 #include <QtPlugin>
00005 #include <thread>
00006 #include "PlotJuggler/datastreamer_base.h"
00007 
00008 
00009 class  DataStreamSample: public QObject, DataStreamer
00010 {
00011     Q_OBJECT
00012     Q_PLUGIN_METADATA(IID "com.icarustechnology.PlotJuggler.DataStreamer" "../datastreamer.json")
00013     Q_INTERFACES(DataStreamer)
00014 
00015 public:
00016 
00017     DataStreamSample();
00018 
00019     virtual PlotDataMap& getDataMap() override { return _plot_data; }
00020 
00021     virtual bool start(QString& default_configuration) override;
00022 
00023     virtual void shutdown() override;
00024 
00025     virtual void enableStreaming(bool enable) override;
00026 
00027     virtual bool isStreamingEnabled() const override;
00028 
00029     virtual ~DataStreamSample();
00030 
00031     virtual const char* name() const override { return "DataStreamer Dummy"; }
00032 
00033     virtual bool isDebugPlugin() override { return true; }
00034 
00035 private:
00036 
00037     struct Parameters{
00038         double A,B,C,D;
00039     };
00040 
00041     void loop();
00042 
00043     PlotDataMap _plot_data;
00044     bool _enabled;
00045 
00046     std::thread _thread;
00047 
00048     bool _running;
00049 
00050 
00051     std::map<std::string,Parameters> _parameters;
00052 
00053 
00054     void pushSingleCycle();
00055 };
00056 
00057 #endif // DATALOAD_CSV_H


plotjuggler
Author(s): Davide Faconti
autogenerated on Fri Sep 1 2017 02:41:56