GNU Radio Manual and C++ API Reference  3.7.13.4
The Free & Open Software Radio Ecosystem
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 setYLabel(const std::string &label,
79  const std::string &unit="");
80  void setYMax(const QString &m);
81  void setYMin(const QString &m);
82  void autoScale(bool en);
83  void autoScaleShot();
84  void setPlotPosHalf(bool half);
85  void clearMaxHold();
86  void clearMinHold();
87 
88  // Trigger slots
91  void setTriggerLevel(QString s);
92  void setTriggerLevel(float level);
93  void setTriggerChannel(int chan);
94  void setTriggerTagKey(QString s);
95  void setTriggerTagKey(const std::string &s);
96 
97  void setupControlPanel(bool en);
98  void setupControlPanel();
99  void teardownControlPanel();
100 
101  void notifyYAxisPlus();
102  void notifyYAxisMinus();
103  void notifyYRangePlus();
104  void notifyYRangeMinus();
105  void notifyFFTSize(const QString &s);
106  void notifyFFTWindow(const QString &s);
107  void notifyMaxHold(bool en);
108  void notifyMinHold(bool en);
109  void notifyTriggerMode(const QString &mode);
110  void notifyTriggerLevelPlus();
112 
113 signals:
114  void signalFFTSize(int size);
116  void signalClearMaxData();
117  void signalClearMinData();
118  void signalSetMaxFFTVisible(bool en);
119  void signalSetMinFFTVisible(bool en);
121  void signalTriggerLevel(float level);
122  void signalReplot();
123 
124 
125 private slots:
126  void newData(const QEvent *updateEvent);
127  void onPlotPointSelected(const QPointF p);
128 
129 private:
130  uint64_t d_num_real_data_points;
131  QIntValidator* d_int_validator;
132 
133  double d_samp_rate, d_center_freq;
134  int d_fftsize;
135  float d_fftavg;
136  gr::filter::firdes::win_type d_fftwintype;
137  double d_units;
138 
139  bool d_clicked;
140  double d_clicked_freq;
141 
142  FFTSizeMenu *d_sizemenu;
143  FFTAverageMenu *d_avgmenu;
144  FFTWindowMenu *d_winmenu;
145  QAction *d_minhold_act, *d_maxhold_act;
146 
147  QMenu *d_triggermenu;
148  TriggerModeMenu *d_tr_mode_menu;
149  PopupMenu *d_tr_level_act;
150  TriggerChannelMenu *d_tr_channel_menu;
151  PopupMenu *d_tr_tag_key_act;
152 
153  gr::qtgui::trigger_mode d_trig_mode;
154  float d_trig_level;
155  int d_trig_channel;
156  std::string d_trig_tag_key;
157 
158  QAction *d_controlpanelmenu;
159  FreqControlPanel *d_controlpanel;
160 };
161 
162 #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)
void setYLabel(const std::string &label, const std::string &unit="")
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)
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)
win_type
Definition: firdes.h:45
void signalClearMinData()
void setTriggerTagKey(QString s)
void notifyTriggerLevelMinus()
void autoScale(bool en)
gr::filter::firdes::win_type getFFTWindowType() const
void notifyTriggerLevelPlus()
void notifyYAxisPlus()