GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 class FreqControlPanel;
35 
36 /*!
37  * \brief DisplayForm child for managing frequency (PSD) plots.
38  * \ingroup qtgui_blk
39  */
41 {
42  Q_OBJECT
43 
44  public:
45  FreqDisplayForm(int nplots=1, QWidget* parent = 0);
47 
49 
50  int getFFTSize() const;
51  float getFFTAverage() const;
53 
54  // Trigger methods
56  float getTriggerLevel() const;
57  int getTriggerChannel() const;
58  std::string getTriggerTagKey() const;
59 
60 
61  // returns the frequency that was last double-clicked on by the user
62  float getClickedFreq() const;
63 
64  // checks if there was a double-click event; reset if there was
65  bool checkClicked();
66 
67 public slots:
68  void customEvent(QEvent *e);
69 
70  void setSampleRate(const QString &samprate);
71  void setFFTSize(const int);
72  void setFFTAverage(const float);
74 
75  void setFrequencyRange(const double centerfreq,
76  const double bandwidth);
77  void setYaxis(double min, double max);
78  void setYMax(const QString &m);
79  void setYMin(const QString &m);
80  void autoScale(bool en);
81  void autoScaleShot();
82  void setPlotPosHalf(bool half);
83  void clearMaxHold();
84  void clearMinHold();
85 
86  // Trigger slots
89  void setTriggerLevel(QString s);
90  void setTriggerLevel(float level);
91  void setTriggerChannel(int chan);
92  void setTriggerTagKey(QString s);
93  void setTriggerTagKey(const std::string &s);
94 
95  void setupControlPanel(bool en);
96  void setupControlPanel();
97  void teardownControlPanel();
98 
99  void notifyYAxisPlus();
100  void notifyYAxisMinus();
101  void notifyYRangePlus();
102  void notifyYRangeMinus();
103  void notifyFFTSize(const QString &s);
104  void notifyFFTWindow(const QString &s);
105  void notifyMaxHold(bool en);
106  void notifyMinHold(bool en);
107  void notifyTriggerMode(const QString &mode);
108  void notifyTriggerLevelPlus();
110 
111 
112 signals:
113  void signalFFTSize(int size);
115  void signalClearMaxData();
116  void signalClearMinData();
117  void signalSetMaxFFTVisible(bool en);
118  void signalSetMinFFTVisible(bool en);
120  void signalTriggerLevel(float level);
121  void signalReplot();
122 
123 
124 private slots:
125  void newData(const QEvent *updateEvent);
126  void onPlotPointSelected(const QPointF p);
127 
128 private:
129  uint64_t d_num_real_data_points;
130  QIntValidator* d_int_validator;
131 
132  double d_samp_rate, d_center_freq;
133  int d_fftsize;
134  float d_fftavg;
135  gr::filter::firdes::win_type d_fftwintype;
136  double d_units;
137 
138  bool d_clicked;
139  double d_clicked_freq;
140 
141  FFTSizeMenu *d_sizemenu;
142  FFTAverageMenu *d_avgmenu;
143  FFTWindowMenu *d_winmenu;
144  QAction *d_minhold_act, *d_maxhold_act;
145 
146  QMenu *d_triggermenu;
147  TriggerModeMenu *d_tr_mode_menu;
148  PopupMenu *d_tr_level_act;
149  TriggerChannelMenu *d_tr_channel_menu;
150  PopupMenu *d_tr_tag_key_act;
151 
152  gr::qtgui::trigger_mode d_trig_mode;
153  float d_trig_level;
154  int d_trig_channel;
155  std::string d_trig_tag_key;
156 
157  QAction *d_controlpanelmenu;
158  FreqControlPanel *d_controlpanel;
159 };
160 
161 #endif /* FREQ_DISPLAY_FORM_H */
Base class for setting up and managing QTGUI plot forms.
Definition: displayform.h:41
void notifyYAxisMinus()
Definition: form_menus.h:1125
void setPlotPosHalf(bool half)
void teardownControlPanel()
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)
void notifyTriggerMode(const QString &mode)
void signalClearMaxData()
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)
void signalSetMaxFFTVisible(bool en)
void notifyFFTSize(const QString &s)
Definition: form_menus.h:864
void signalSetMinFFTVisible(bool en)
void autoScaleShot()
Definition: freqcontrolpanel.h:37
void notifyFFTWindow(const QString &s)
gr::qtgui::trigger_mode getTriggerMode() const
void signalFFTWindow(gr::filter::firdes::win_type win)
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)
void signalFFTSize(int size)
void notifyYRangePlus()
QWidget for displaying frequency domain (PSD) plots.
Definition: FrequencyDisplayPlot.h:35
void signalTriggerMode(gr::qtgui::trigger_mode mode)
void notifyMaxHold(bool en)
win_type
Definition: firdes.h:45
float getFFTAverage() const
void signalTriggerLevel(float level)
void notifyMinHold(bool en)
FrequencyDisplayPlot * getPlot()
float getTriggerLevel() const
void setFrequencyRange(const double centerfreq, const double bandwidth)
void setupControlPanel()
DisplayForm child for managing frequency (PSD) plots.
Definition: freqdisplayform.h:40
int getFFTSize() const
void notifyYRangeMinus()
float getClickedFreq() const
void setFFTAverage(const float)
void setYaxis(double min, double max)
Definition: form_menus.h:1277
void setTriggerChannel(int chan)
void signalClearMinData()
void setTriggerTagKey(QString s)
void notifyTriggerLevelMinus()
void autoScale(bool en)
gr::filter::firdes::win_type getFFTWindowType() const
void notifyTriggerLevelPlus()
void notifyYAxisPlus()