GNU Radio Manual and C++ API Reference  3.8.1.0
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 
26 #include <gnuradio/filter/firdes.h>
29 #include <QtGui/QtGui>
30 #include <vector>
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, const double bandwidth);
76  void setYaxis(double min, double max);
77  void setYLabel(const std::string& label, const std::string& unit = "");
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 signals:
112  void signalFFTSize(int size);
114  void signalClearMaxData();
115  void signalClearMinData();
116  void signalSetMaxFFTVisible(bool en);
117  void signalSetMinFFTVisible(bool en);
119  void signalTriggerLevel(float level);
120  void signalReplot();
121 
122 
123 private slots:
124  void newData(const QEvent* updateEvent);
125  void onPlotPointSelected(const QPointF p);
126 
127 private:
128  uint64_t d_num_real_data_points;
129  QIntValidator* d_int_validator;
130 
131  double d_samp_rate, d_center_freq;
132  int d_fftsize;
133  float d_fftavg;
134  gr::filter::firdes::win_type d_fftwintype;
135  double d_units;
136 
137  bool d_clicked;
138  double d_clicked_freq;
139 
140  FFTSizeMenu* d_sizemenu;
141  FFTAverageMenu* d_avgmenu;
142  FFTWindowMenu* d_winmenu;
143  QAction *d_minhold_act, *d_maxhold_act;
144 
145  QMenu* d_triggermenu;
146  TriggerModeMenu* d_tr_mode_menu;
147  PopupMenu* d_tr_level_act;
148  TriggerChannelMenu* d_tr_channel_menu;
149  PopupMenu* d_tr_tag_key_act;
150 
151  gr::qtgui::trigger_mode d_trig_mode;
152  float d_trig_level;
153  int d_trig_channel;
154  std::string d_trig_tag_key;
155 
156  QAction* d_controlpanelmenu;
157  FreqControlPanel* d_controlpanel;
158 };
159 
160 #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:1086
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:1438
float getTriggerLevel() const
std::string getTriggerTagKey() const
void setYMax(const QString &m)
float min(float a, float b)
void setSampleRate(const QString &samprate)
void customEvent(QEvent *e)
void notifyTriggerMode(const QString &mode)
void signalClearMaxData()
gr::qtgui::trigger_mode getTriggerMode() const
void setTriggerMode(gr::qtgui::trigger_mode mode)
float getFFTAverage() const
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:815
void signalSetMinFFTVisible(bool en)
void autoScaleShot()
Definition: freqcontrolpanel.h:37
int getFFTSize() const
void notifyFFTWindow(const QString &s)
void signalFFTWindow(gr::filter::firdes::win_type win)
Definition: form_menus.h:593
Definition: form_menus.h:829
float getClickedFreq() const
trigger_mode
Definition: trigger_mode.h:29
void setFFTSize(const int)
void signalFFTSize(int size)
gr::filter::firdes::win_type getFFTWindowType() const
void notifyYRangePlus()
QWidget for displaying frequency domain (PSD) plots.
Definition: FrequencyDisplayPlot.h:35
void signalTriggerMode(gr::qtgui::trigger_mode mode)
void notifyMaxHold(bool en)
void signalTriggerLevel(float level)
void notifyMinHold(bool en)
FrequencyDisplayPlot * getPlot()
void setFrequencyRange(const double centerfreq, const double bandwidth)
void setupControlPanel()
int getTriggerChannel() const
DisplayForm child for managing frequency (PSD) plots.
Definition: freqdisplayform.h:40
void notifyYRangeMinus()
void setFFTAverage(const float)
void setYaxis(double min, double max)
Definition: form_menus.h:1231
void setTriggerChannel(int chan)
win_type
Definition: firdes.h:45
void signalClearMinData()
void setTriggerTagKey(QString s)
void notifyTriggerLevelMinus()
void autoScale(bool en)
void notifyTriggerLevelPlus()
void notifyYAxisPlus()