timeseries_qwt.h
Go to the documentation of this file.
1 #ifndef PLOTDATA_QWT_H
2 #define PLOTDATA_QWT_H
3 
4 #include "PlotJuggler/plotdata.h"
5 #include "qwt_series_data.h"
7 
8 using namespace PJ;
9 
10 
11 // wrapper to PlotData inclduing a time offset
12 class QwtSeriesWrapper: public QwtSeriesData<QPointF>
13 {
14 private:
16  double _time_offset;
17 
18 public:
19  QwtSeriesWrapper(const PlotDataBase<double>* data): _data(data), _time_offset(0.0) {}
20 
21  QPointF sample(size_t i) const override;
22 
23  void setTimeOffset(double offset);
24 
25  virtual bool updateCache(bool reset_old_data) = 0;
26 
27  size_t size() const override;
28 
29  QRectF boundingRect() const override;
30 
31  const PlotDataBase<double>* plotData() const;
32 
33  virtual RangeOpt getVisualizationRangeX();
34 
35  virtual RangeOpt getVisualizationRangeY(Range range_X) = 0;
36 
37  virtual nonstd::optional<QPointF> sampleFromTime(double t) = 0;
38 
39 };
40 
41 
43 {
44 public:
46  QwtSeriesWrapper(data),
47  _ts_data(data)
48  {
49  }
50 
51  virtual RangeOpt getVisualizationRangeY(Range range_X) override;
52 
53  virtual nonstd::optional<QPointF> sampleFromTime(double t) override;
54 
55 protected:
57 };
58 
59 //------------------------------------
60 
62 {
63 public:
64  TransformedTimeseries(const PlotData* source_data);
65 
66  TimeSeriesTransformPtr transform();
67 
68  void setTransform(QString transform_ID);
69 
70  virtual bool updateCache(bool reset_old_data) override;
71 
72  QString transformName();
73 
74 protected:
78 };
79 
80 //---------------------------------------------------------
81 
82 
83 
84 #endif // PLOTDATA_H
const PlotData * _source_data
TimeSeriesTransformPtr _transform
Abstract interface for iterating over samples.
const PlotData * _ts_data
std::shared_ptr< TimeSeriesTransform > TimeSeriesTransformPtr
const PlotDataBase< double > * _data
QwtSeriesWrapper(const PlotDataBase< double > *data)
QwtTimeseries(const PlotData *data)
dictionary data
Definition: mqtt_test.py:22


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:48