dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
spectrogramplotdata.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 SPECTROGRAMDATA_H
28 #define SPECTROGRAMDATA_H
29 
30 #include "scopes3d/plotdata3d.h"
31 #include "uavobjects/uavobject.h"
32 #include "qwt/src/qwt_plot_spectrogram.h"
33 #include "qwt/src/qwt_matrix_raster_data.h"
34 
35 #include <QTimer>
36 #include <QTime>
37 #include <QVector>
38 
39 #include "ffft/FFTReal.h"
40 
46 {
47  Q_OBJECT
48 public:
49  SpectrogramData(QString uavObject, QString uavField, double samplingFrequency,
50  unsigned int windowWidth, double timeHorizon);
52 
56  bool append(UAVObject *obj);
57 
61  virtual void removeStaleData() {}
62 
68  {
69  double tmpVal = autoscaleValueUpdated;
70  autoscaleValueUpdated = 0;
71  return tmpVal;
72  }
73 
74  virtual void plotNewData(PlotData *, ScopeConfig *, ScopeGadgetWidget *);
75  virtual void deletePlots(PlotData *);
76  virtual void setXMaximum(double val);
77  virtual void setYMaximum(double val);
78  virtual void setZMaximum(double val);
79  void clearPlots();
80 
81  QwtMatrixRasterData *getRasterData() { return rasterData; }
82  void setSpectrogram(QwtPlotSpectrogram *val) { spectrogram = val; }
83 
84 private:
85  void resetAxisRanges();
86 
87  QwtPlotSpectrogram *spectrogram;
88  QwtMatrixRasterData *rasterData;
89 
90  double samplingFrequency;
91  double timeHorizon;
92  unsigned int windowWidth;
93  double autoscaleValueUpdated;
94  ffft::FFTReal<double> *fft_object;
95  QVector<double> plotData;
96  int lastInstanceIndex;
97 };
98 
99 #endif // SPECTROGRAMDATA_H
SpectrogramData(QString uavObject, QString uavField, double samplingFrequency, unsigned int windowWidth, double timeHorizon)
SpectrogramData.
bool append(UAVObject *obj)
Append new data to the plot.
virtual void setXMaximum(double val)
void clearPlots()
SpectrogramScopeConfig::clearPlots Clear all plot data.
The Plot3dData class Base class that keeps the data for each curve in the plot.
Definition: plotdata3d.h:39
QwtMatrixRasterData * getRasterData()
virtual void plotNewData(PlotData *, ScopeConfig *, ScopeGadgetWidget *)
SpectrogramScopeConfig::plotNewData Update plot with new data.
The ScopeConfig class The parent class for scope configuration classes data sources.
Definition: scopesconfig.h:56
virtual void setYMaximum(double val)
double readAndResetAutoscaleValue()
readAndResetAutoscaleFlag reads the flag value and resets it
virtual void setZMaximum(double val)
virtual void deletePlots(PlotData *)
SpectrogramScopeConfig::deletePlots Delete all plot data.
The SpectrogramData class The spectrogram plot has a fixed size data buffer. All the curves in one pl...
void setSpectrogram(QwtPlotSpectrogram *val)
virtual void removeStaleData()
Removes the old data from the buffer.