timeseries_qwt.h
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef TIMESERIES_QWT_H
8 #define TIMESERIES_QWT_H
9 
10 #include "qwt_series_data.h"
11 #include "PlotJuggler/plotdata.h"
13 
14 using namespace PJ;
15 
16 // wrapper to Timeseries inclduing a time offset
17 class QwtSeriesWrapper : public QwtSeriesData<QPointF>
18 {
19 private:
20  const PlotDataXY* _data;
21 
22 public:
24  {
25  }
26 
27  QPointF sample(size_t i) const override;
28 
29  size_t size() const override;
30 
31  QRectF boundingRect() const override;
32 
33  virtual const PlotDataXY* plotData() const;
34 
35  virtual RangeOpt getVisualizationRangeX();
36 
37  virtual RangeOpt getVisualizationRangeY(Range range_X);
38 
39  virtual void updateCache(bool reset_old_data)
40  {
41  }
42 };
43 
45 {
46 public:
48  {
49  }
50 
51  QPointF sample(size_t i) const override;
52 
53  QRectF boundingRect() const override;
54 
55  void setTimeOffset(double offset);
56 
57  virtual RangeOpt getVisualizationRangeX() override;
58 
59  virtual RangeOpt getVisualizationRangeY(Range range_X) override;
60 
61  virtual std::optional<QPointF> sampleFromTime(double t);
62 
63  void updateCache(bool) override
64  {
65  }
66 
67 protected:
69  double _time_offset = 0.0;
70 };
71 
72 //------------------------------------
73 
75 {
76 public:
77  TransformedTimeseries(const PlotData* source_data);
78 
79  TransformFunction::Ptr transform();
80 
81  void setTransform(QString transform_ID);
82 
83  virtual void updateCache(bool reset_old_data) override;
84 
85  QString transformName();
86 
87  QString alias() const;
88 
89  void setAlias(QString alias);
90 
91 protected:
92  QString _alias;
96 };
97 
98 //---------------------------------------------------------
99 
100 #endif // PLOTDATA_H
PJ::TimeseriesBase
Definition: timeseries.h:16
QwtSeriesWrapper
Definition: timeseries_qwt.h:17
TransformedTimeseries::_transform
TransformFunction_SISO::Ptr _transform
Definition: timeseries_qwt.h:95
TransformedTimeseries::_dst_data
PlotData _dst_data
Definition: timeseries_qwt.h:93
QwtSeriesWrapper::updateCache
virtual void updateCache(bool reset_old_data)
Definition: timeseries_qwt.h:39
PJ::TransformFunction::Ptr
std::shared_ptr< TransformFunction > Ptr
Definition: transform_function.h:27
QwtSeriesWrapper::QwtSeriesWrapper
QwtSeriesWrapper(const PlotDataXY *data)
Definition: timeseries_qwt.h:23
TransformedTimeseries
Definition: timeseries_qwt.h:74
transform_function.h
nonstd::span_lite::size
span_constexpr std::size_t size(span< T, Extent > const &spn)
Definition: span.hpp:1554
TransformedTimeseries::_alias
QString _alias
Definition: timeseries_qwt.h:92
TransformedTimeseries::_src_data
const PlotData * _src_data
Definition: timeseries_qwt.h:94
QwtSeriesData
Abstract interface for iterating over samples.
Definition: qwt_plot_barchart.h:18
QwtTimeseries::QwtTimeseries
QwtTimeseries(const PlotData *data)
Definition: timeseries_qwt.h:47
PJ::Range
Definition: plotdatabase.h:24
QwtTimeseries
Definition: timeseries_qwt.h:44
plotdata.h
QwtTimeseries::updateCache
void updateCache(bool) override
Definition: timeseries_qwt.h:63
QwtSeriesWrapper::_data
const PlotDataXY * _data
Definition: timeseries_qwt.h:20
PJ::RangeOpt
std::optional< Range > RangeOpt
Definition: plotdatabase.h:36
PJ
Definition: dataloader_base.h:16
mqtt_test.data
dictionary data
Definition: mqtt_test.py:22
PJ::PlotDataBase
Definition: plotdatabase.h:122
QwtTimeseries::_ts_data
const PlotData * _ts_data
Definition: timeseries_qwt.h:68
qwt_series_data.h


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