GNU Radio Manual and C++ API Reference  3.7.6.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
freqdisplayform.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2012 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 FREQ_DISPLAY_FORM_H
24 #define FREQ_DISPLAY_FORM_H
25 
28 #include <QtGui/QtGui>
29 #include <vector>
30 #include <gnuradio/filter/firdes.h>
31 
33 
34 /*!
35  * \brief DisplayForm child for managing frequency (PSD) plots.
36  * \ingroup qtgui_blk
37  */
39 {
40  Q_OBJECT
41 
42  public:
43  FreqDisplayForm(int nplots=1, QWidget* parent = 0);
45 
47 
48  int getFFTSize() const;
49  float getFFTAverage() const;
51 
52  // Trigger methods
54  float getTriggerLevel() const;
55  int getTriggerChannel() const;
56  std::string getTriggerTagKey() const;
57 
58 
59  // returns the frequency that was last double-clicked on by the user
60  float getClickedFreq() const;
61 
62  // checks if there was a double-click event; reset if there was
63  bool checkClicked();
64 
65 public slots:
66  void customEvent(QEvent *e);
67 
68  void setSampleRate(const QString &samprate);
69  void setFFTSize(const int);
70  void setFFTAverage(const float);
72 
73  void setFrequencyRange(const double centerfreq,
74  const double bandwidth);
75  void setYaxis(double min, double max);
76  void setYMax(const QString &m);
77  void setYMin(const QString &m);
78  void autoScale(bool en);
79  void setPlotPosHalf(bool half);
80  void clearMaxHold();
81  void clearMinHold();
82 
83  // Trigger slots
86  void setTriggerLevel(QString s);
87  void setTriggerLevel(float level);
88  void setTriggerChannel(int chan);
89  void setTriggerTagKey(QString s);
90  void setTriggerTagKey(const std::string &s);
91 
92 private slots:
93  void newData(const QEvent *updateEvent);
94  void onPlotPointSelected(const QPointF p);
95 
96 private:
97  uint64_t d_num_real_data_points;
98  QIntValidator* d_int_validator;
99 
100  double d_samp_rate, d_center_freq;
101  int d_fftsize;
102  float d_fftavg;
103  gr::filter::firdes::win_type d_fftwintype;
104  double d_units;
105 
106  bool d_clicked;
107  double d_clicked_freq;
108 
109  FFTSizeMenu *d_sizemenu;
110  FFTAverageMenu *d_avgmenu;
111  FFTWindowMenu *d_winmenu;
112  QAction *d_clearmin_act, *d_clearmax_act;
113 
114  QMenu *d_triggermenu;
115  TriggerModeMenu *d_tr_mode_menu;
116  PopupMenu *d_tr_level_act;
117  TriggerChannelMenu *d_tr_channel_menu;
118  PopupMenu *d_tr_tag_key_act;
119 
120  gr::qtgui::trigger_mode d_trig_mode;
121  float d_trig_level;
122  int d_trig_channel;
123  std::string d_trig_tag_key;
124 };
125 
126 #endif /* FREQ_DISPLAY_FORM_H */
Base class for setting up and managing QTGUI plot forms.
Definition: displayform.h:41
Definition: form_menus.h:1125
void setPlotPosHalf(bool half)
void setTriggerLevel(QString s)
FreqDisplayForm(int nplots=1, QWidget *parent=0)
Definition: form_menus.h:1494
void setYMax(const QString &m)
float min(float a, float b)
int getTriggerChannel() const
void setSampleRate(const QString &samprate)
void customEvent(QEvent *e)
std::string getTriggerTagKey() const
void setTriggerMode(gr::qtgui::trigger_mode mode)
void updateTrigger(gr::qtgui::trigger_mode mode)
void setYMin(const QString &m)
void setFFTWindowType(const gr::filter::firdes::win_type)
Definition: form_menus.h:864
gr::qtgui::trigger_mode getTriggerMode() const
Definition: form_menus.h:627
Definition: form_menus.h:878
trigger_mode
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:29
void setFFTSize(const int)
QWidget for displaying frequency domain (PSD) plots.
Definition: FrequencyDisplayPlot.h:35
float getFFTAverage() const
FrequencyDisplayPlot * getPlot()
float getTriggerLevel() const
void setFrequencyRange(const double centerfreq, const double bandwidth)
DisplayForm child for managing frequency (PSD) plots.
Definition: freqdisplayform.h:38
int getFFTSize() const
float getClickedFreq() const
void setFFTAverage(const float)
void setYaxis(double min, double max)
Definition: form_menus.h:1277
void setTriggerChannel(int chan)
win_type
Definition: firdes.h:45
void setTriggerTagKey(QString s)
void autoScale(bool en)
gr::filter::firdes::win_type getFFTWindowType() const