dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
scatterplotdata.h
Go to the documentation of this file.
1 
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
27 #ifndef SCATTERPLOTDATA_H
28 #define SCATTERPLOTDATA_H
29 
30 #include "scopes2d/plotdata2d.h"
31 #include "uavobjects/uavobject.h"
32 #include "qwt/src/qwt_plot_curve.h"
33 
34 #include <QTimer>
35 #include <QTime>
36 #include <QVector>
37 
42 {
43  Q_OBJECT
44 public:
45  ScatterplotData(QString uavObject, QString uavField)
46  : Plot2dData(uavObject, uavField)
47  {
48  curve = nullptr;
49  }
51 
52  virtual void deletePlots(PlotData *);
53  void clearPlots();
54 
55  void setCurve(QwtPlotCurve *val) { curve = val; }
56 
57 protected:
58  QwtPlotCurve *curve;
59 };
60 
66 {
67  Q_OBJECT
68 public:
69  SeriesPlotData(QString uavObject, QString uavField)
70  : ScatterplotData(uavObject, uavField)
71  {
72  }
74 
78  bool append(UAVObject *obj);
79 
83  virtual void removeStaleData() {}
84  virtual void plotNewData(PlotData *, ScopeConfig *, ScopeGadgetWidget *);
85 };
86 
92 {
93  Q_OBJECT
94 public:
95  TimeSeriesPlotData(QString uavObject, QString uavField)
96  : ScatterplotData(uavObject, uavField)
97  {
98  scalePower = 1;
99  }
101 
102  bool append(UAVObject *obj);
103 
104  virtual void removeStaleData();
105  virtual void plotNewData(PlotData *, ScopeConfig *, ScopeGadgetWidget *);
106 
107 private slots:
108  void removeStaleDataTimeout();
109 };
110 
111 #endif // SCATTERPLOTDATA_H
virtual void deletePlots(PlotData *)
ScatterplotData::deletePlots Delete all plot data.
bool append(UAVObject *obj)
TimeSeriesPlotData::append Appends data to time series data.
virtual void plotNewData(PlotData *, ScopeConfig *, ScopeGadgetWidget *)
Scatterplot2dScopeConfig::plotNewData Update plot with new data.
virtual void removeStaleData()
Removes the old data from the buffer.
virtual void removeStaleData()
TimeSeriesPlotData::removeStaleData Removes stale data from time series plot.
The Plot2dData class Base class that keeps the data for each curve in the plot.
Definition: plotdata2d.h:39
ScatterplotData(QString uavObject, QString uavField)
void clearPlots()
ScatterplotData::clearPlots Clear all plot data.
SeriesPlotData(QString uavObject, QString uavField)
The TimeSeriesPlotData class The chrono plot has a variable sized buffer of data, where the data is f...
The SeriesPlotData class The sequential plot have a fixed size buffer of data. All the curves in one ...
virtual void plotNewData(PlotData *, ScopeConfig *, ScopeGadgetWidget *)
Scatterplot2dScopeConfig::plotNewData Update plot with new data.
bool append(UAVObject *obj)
Append new data to the plot.
The ScopeConfig class The parent class for scope configuration classes data sources.
Definition: scopesconfig.h:56
int scalePower
Definition: plotdata.h:104
void setCurve(QwtPlotCurve *val)
TimeSeriesPlotData(QString uavObject, QString uavField)
The Scatterplot2dData class Base class that keeps the data for each curve in the plot.
QwtPlotCurve * curve