dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
histogramplotdata.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 HISTOGRAMDATA_H
28 #define HISTOGRAMDATA_H
29 
30 #include "scopes2d/plotdata2d.h"
31 #include "uavobjects/uavobject.h"
32 
33 #include "qwt/src/qwt_plot_histogram.h"
34 
35 #include <QTimer>
36 #include <QTime>
37 #include <QVector>
38 
43 class HistogramData : public Plot2dData
44 {
45  Q_OBJECT
46 public:
47  HistogramData(QString uavObject, QString uavField, double binWidth, uint numberOfBins);
49 
50  bool append(UAVObject *obj);
51 
52  virtual void removeStaleData() {}
53  virtual void plotNewData(PlotData *, ScopeConfig *, ScopeGadgetWidget *);
54  virtual void deletePlots(PlotData *);
55  void clearPlots();
56 
57  QwtIntervalSeriesData *getIntervalSeriesData() { return intervalSeriesData; }
58  void setHistogram(QwtPlotHistogram *val) { histogram = val; }
59 
60 private:
61  QwtPlotHistogram *histogram;
62  QVector<QwtIntervalSample> *histogramBins; // Used for histograms
63  QVector<QwtInterval> *histogramInterval;
64  QwtIntervalSeriesData *intervalSeriesData;
65 
66  double binWidth;
67  uint numberOfBins;
68 
69 private slots:
70 };
71 
72 #endif // HISTOGRAMDATA_H
void setHistogram(QwtPlotHistogram *val)
The Plot2dData class Base class that keeps the data for each curve in the plot.
Definition: plotdata2d.h:39
virtual void deletePlots(PlotData *)
HistogramScopeConfig::deletePlots Delete all plot data.
QwtIntervalSeriesData * getIntervalSeriesData()
virtual void plotNewData(PlotData *, ScopeConfig *, ScopeGadgetWidget *)
HistogramScopeConfig::plotNewData Update plot with new data.
The ScopeConfig class The parent class for scope configuration classes data sources.
Definition: scopesconfig.h:56
The HistogramData class The histogram plot has a variable sized buffer of data, where the data is for...
virtual void removeStaleData()
HistogramData(QString uavObject, QString uavField, double binWidth, uint numberOfBins)
HistogramData::HistogramData.
void clearPlots()
HistogramScopeConfig::clearPlots Clear all plot data.
bool append(UAVObject *obj)
HistogramData::append Appends data to histogram.