GNU Radio Manual and C++ API Reference  3.7.4
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  // returns the frequency that was last double-clicked on by the user
59  float getClickedFreq() const;
60 
61  // checks if there was a double-click event; reset if there was
62  bool checkClicked();
63 
64 public slots:
65  void resizeEvent(QResizeEvent * e);
66  void customEvent(QEvent * e);
67  void avgLineEdit_valueChanged(int valueString);
68  void maxHoldCheckBox_toggled(bool newState);
69  void minHoldCheckBox_toggled(bool newState);
72  void tabChanged(int index);
73 
74  void setFrequencyRange(const double newCenterFrequency,
75  const double newStartFrequency,
76  const double newStopFrequency);
77  void closeEvent(QCloseEvent * e);
78  void windowTypeChanged(int newItem);
79  void useRFFrequenciesCB(bool useRFFlag);
80  void toggleRFFrequencies(bool en);
85  void fftComboBoxSelectedCB(const QString&);
86 
87  void toggleTabFrequency(const bool state);
88  void toggleTabWaterfall(const bool state);
89  void toggleTabTime(const bool state);
90  void toggleTabConstellation(const bool state);
91 
92  void setTimeDomainAxis(double min, double max);
93  void setConstellationAxis(double xmin, double xmax,
94  double ymin, double ymax);
95  void setConstellationPenSize(int size);
96  void setFrequencyAxis(double min, double max);
97  void setUpdateTime(double t);
98 
99 private slots:
100  void newFrequencyData(const SpectrumUpdateEvent*);
101  void updateGuiTimer();
102 
103  void onFFTPlotPointSelected(const QPointF p);
104  void onWFallPlotPointSelected(const QPointF p);
105  void onTimePlotPointSelected(const QPointF p);
106  void onConstPlotPointSelected(const QPointF p);
107 
108 signals:
109  void plotPointSelected(const QPointF p, int type);
110 
111 private:
112  void _averageHistory(const double * newBuffer);
113 
114  int _historyEntryCount;
115  int _historyEntry;
116  std::vector<double*>* _historyVector;
117  double* _averagedValues;
118  uint64_t _numRealDataPoints;
119  double* _realFFTDataPoints;
120  QIntValidator* _intValidator;
121  FrequencyDisplayPlot* _frequencyDisplayPlot;
122  WaterfallDisplayPlot* _waterfallDisplayPlot;
123  TimeDomainDisplayPlot* _timeDomainDisplayPlot;
124  ConstellationDisplayPlot* _constellationDisplayPlot;
125  SpectrumGUIClass* _system;
126  bool _systemSpecifiedFlag;
127  double _centerFrequency;
128  double _startFrequency;
129  double _noiseFloorAmplitude;
130  double _peakFrequency;
131  double _peakAmplitude;
132  double _stopFrequency;
133 
134  double d_units;
135  bool d_clicked;
136  double d_clicked_freq;
137 
138  //SpectrumUpdateEvent _lastSpectrumEvent;
139 
140  // whether or not to use a particular display
141  int d_plot_fft;
142  int d_plot_waterfall;
143  int d_plot_time;
144  int d_plot_constellation;
145 
146  QTimer *displayTimer;
147  double d_update_time;
148 };
149 
150 #endif /* SPECTRUM_DISPLAY_FORM_H */
QWidget for displaying waterfall (spectrogram) plots.
Definition: WaterfallDisplayPlot.h:44
void toggleRFFrequencies(bool en)
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)
float getClickedFreq() const
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)