GNU Radio Manual and C++ API Reference 3.7.14.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
29#include <QtGui/QtGui>
30#include <vector>
31
33
35
36/*!
37 * \brief DisplayForm child for managing frequency (PSD) plots.
38 * \ingroup qtgui_blk
39 */
41{
42 Q_OBJECT
43
44public:
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
66
67public 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);
82 void setPlotPosHalf(bool half);
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);
98
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);
110
111signals:
112 void signalFFTSize(int size);
119 void signalTriggerLevel(float level);
121
122
123private slots:
124 void newData(const QEvent* updateEvent);
125 void onPlotPointSelected(const QPointF p);
126
127private:
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:42
Definition: form_menus.h:813
Definition: form_menus.h:589
Definition: form_menus.h:827
Definition: freqcontrolpanel.h:38
DisplayForm child for managing frequency (PSD) plots.
Definition: freqdisplayform.h:41
void notifyYRangeMinus()
void setTriggerLevel(QString s)
void setupControlPanel()
void setYaxis(double min, double max)
void signalFFTSize(int size)
int getFFTSize() const
FrequencyDisplayPlot * getPlot()
void setPlotPosHalf(bool half)
void setYMax(const QString &m)
void signalClearMaxData()
void signalSetMaxFFTVisible(bool en)
void customEvent(QEvent *e)
std::string getTriggerTagKey() const
void notifyMaxHold(bool en)
void notifyYRangePlus()
void notifyTriggerMode(const QString &mode)
void setTriggerTagKey(const std::string &s)
void setTriggerChannel(int chan)
void autoScaleShot()
void setYMin(const QString &m)
void teardownControlPanel()
float getTriggerLevel() const
void setTriggerTagKey(QString s)
void updateTrigger(gr::qtgui::trigger_mode mode)
void setYLabel(const std::string &label, const std::string &unit="")
void setFFTAverage(const float)
float getClickedFreq() const
void signalTriggerMode(gr::qtgui::trigger_mode mode)
void signalFFTWindow(gr::filter::firdes::win_type win)
void setSampleRate(const QString &samprate)
void notifyFFTWindow(const QString &s)
void notifyFFTSize(const QString &s)
void setTriggerLevel(float level)
FreqDisplayForm(int nplots=1, QWidget *parent=0)
void autoScale(bool en)
void notifyYAxisPlus()
int getTriggerChannel() const
void setFrequencyRange(const double centerfreq, const double bandwidth)
void signalClearMinData()
void setFFTWindowType(const gr::filter::firdes::win_type)
void signalTriggerLevel(float level)
float getFFTAverage() const
gr::qtgui::trigger_mode getTriggerMode() const
void notifyTriggerLevelPlus()
gr::filter::firdes::win_type getFFTWindowType() const
void signalSetMinFFTVisible(bool en)
void setupControlPanel(bool en)
void notifyYAxisMinus()
void setTriggerMode(gr::qtgui::trigger_mode mode)
void notifyTriggerLevelMinus()
void notifyMinHold(bool en)
void setFFTSize(const int)
QWidget for displaying frequency domain (PSD) plots.
Definition: FrequencyDisplayPlot.h:36
Definition: form_menus.h:1436
Definition: form_menus.h:1230
Definition: form_menus.h:1085
win_type
Definition: firdes.h:45
trigger_mode
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:29
float min(float a, float b)