GNU Radio 3.7.2 C++ API
spectrumdisplayform.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008-2011 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef SPECTRUM_DISPLAY_FORM_H
24 #define SPECTRUM_DISPLAY_FORM_H
25 
26 #include <spectrumdisplayform.ui.h>
27 
28 class SpectrumGUIClass;
30 
36 #include <QValidator>
37 #include <QTimer>
38 #include <vector>
39 
40 class SpectrumDisplayForm : public QWidget, public Ui::SpectrumDisplayForm
41 {
42  Q_OBJECT
43 
44  public:
45  SpectrumDisplayForm(QWidget* parent = 0);
47 
48  void setSystem(SpectrumGUIClass * newSystem, const uint64_t numFFTDataPoints,
49  const uint64_t numTimeDomainDataPoints);
50 
51  int getAverageCount();
52  void setAverageCount(const int newCount);
53  void reset();
54  void averageDataReset();
55  void resizeBuffers(const uint64_t numFFTDataPoints,
56  const uint64_t numTimeDomainDataPoints);
57 
58 public slots:
59  void resizeEvent(QResizeEvent * e);
60  void customEvent(QEvent * e);
61  void avgLineEdit_valueChanged(int valueString);
62  void maxHoldCheckBox_toggled(bool newState);
63  void minHoldCheckBox_toggled(bool newState);
66  void tabChanged(int index);
67 
68  void setFrequencyRange(const double newCenterFrequency,
69  const double newStartFrequency,
70  const double newStopFrequency);
71  void closeEvent(QCloseEvent * e);
72  void windowTypeChanged(int newItem);
73  void useRFFrequenciesCB(bool useRFFlag);
78  void fftComboBoxSelectedCB(const QString&);
79 
80  void toggleTabFrequency(const bool state);
81  void toggleTabWaterfall(const bool state);
82  void toggleTabTime(const bool state);
83  void toggleTabConstellation(const bool state);
84 
85  void setTimeDomainAxis(double min, double max);
86  void setConstellationAxis(double xmin, double xmax,
87  double ymin, double ymax);
88  void setConstellationPenSize(int size);
89  void setFrequencyAxis(double min, double max);
90  void setUpdateTime(double t);
91 
92 private slots:
93  void newFrequencyData(const SpectrumUpdateEvent*);
94  void updateGuiTimer();
95 
96  void onFFTPlotPointSelected(const QPointF p);
97  void onWFallPlotPointSelected(const QPointF p);
98  void onTimePlotPointSelected(const QPointF p);
99  void onConstPlotPointSelected(const QPointF p);
100 
101 signals:
102  void plotPointSelected(const QPointF p, int type);
103 
104 private:
105  void _averageHistory(const double * newBuffer);
106 
107  int _historyEntryCount;
108  int _historyEntry;
109  std::vector<double*>* _historyVector;
110  double* _averagedValues;
111  uint64_t _numRealDataPoints;
112  double* _realFFTDataPoints;
113  QIntValidator* _intValidator;
114  FrequencyDisplayPlot* _frequencyDisplayPlot;
115  WaterfallDisplayPlot* _waterfallDisplayPlot;
116  TimeDomainDisplayPlot* _timeDomainDisplayPlot;
117  ConstellationDisplayPlot* _constellationDisplayPlot;
118  SpectrumGUIClass* _system;
119  bool _systemSpecifiedFlag;
120  double _centerFrequency;
121  double _startFrequency;
122  double _noiseFloorAmplitude;
123  double _peakFrequency;
124  double _peakAmplitude;
125  double _stopFrequency;
126 
127  //SpectrumUpdateEvent _lastSpectrumEvent;
128 
129  // whether or not to use a particular display
130  int d_plot_fft;
131  int d_plot_waterfall;
132  int d_plot_time;
133  int d_plot_constellation;
134 
135  QTimer *displayTimer;
136  double d_update_time;
137 };
138 
139 #endif /* SPECTRUM_DISPLAY_FORM_H */
QWidget for displaying waterfall (spectrogram) plots.
Definition: WaterfallDisplayPlot.h:44
void waterfallIntensityColorTypeChanged(int)
float min(float a, float b)
void waterfallMaximumIntensityChangedCB(double)
void tabChanged(int index)
Definition: spectrumdisplayform.h:40
void setConstellationAxis(double xmin, double xmax, double ymin, double ymax)
void minHoldResetBtn_clicked()
void resizeEvent(QResizeEvent *e)
void toggleTabTime(const bool state)
void setConstellationPenSize(int size)
void resizeBuffers(const uint64_t numFFTDataPoints, const uint64_t numTimeDomainDataPoints)
void useRFFrequenciesCB(bool useRFFlag)
void setFrequencyAxis(double min, double max)
void toggleTabConstellation(const bool state)
void fftComboBoxSelectedCB(const QString &)
void windowTypeChanged(int newItem)
void waterfallAutoScaleBtnCB()
void setFrequencyRange(const double newCenterFrequency, const double newStartFrequency, const double newStopFrequency)
void avgLineEdit_valueChanged(int valueString)
void setAverageCount(const int newCount)
unsigned __int64 uint64_t
Definition: stdint.h:90
QWidget for displaying frequency domain (PSD) plots.
Definition: FrequencyDisplayPlot.h:35
void setTimeDomainAxis(double min, double max)
Definition: spectrumUpdateEvents.h:40
void closeEvent(QCloseEvent *e)
void maxHoldCheckBox_toggled(bool newState)
void plotPointSelected(const QPointF p, int type)
void toggleTabFrequency(const bool state)
void maxHoldResetBtn_clicked()
void waterfallMinimumIntensityChangedCB(double)
QWidget for displaying time domain plots.
Definition: TimeDomainDisplayPlot.h:36
QWidget for displaying constellaton (I&Q) plots.
Definition: ConstellationDisplayPlot.h:35
void toggleTabWaterfall(const bool state)
void customEvent(QEvent *e)
QWidget class for controlling plotting.
Definition: SpectrumGUIClass.h:46
SpectrumDisplayForm(QWidget *parent=0)
void setUpdateTime(double t)
void setSystem(SpectrumGUIClass *newSystem, const uint64_t numFFTDataPoints, const uint64_t numTimeDomainDataPoints)
void minHoldCheckBox_toggled(bool newState)