GNU Radio C++ API Reference: freqdisplayform.h Source File

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
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 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef FREQ_DISPLAY_FORM_H
12#define FREQ_DISPLAY_FORM_H
13
14#include <gnuradio/fft/window.h>
15#include <gnuradio/qtgui/FrequencyDisplayPlot.h>
16#include <gnuradio/qtgui/spectrumUpdateEvents.h>
17#include <QtGui/QtGui>
18#include <vector>
19
20#include <gnuradio/qtgui/displayform.h>
21
22class FreqControlPanel;
23
24/*!
25 * \brief DisplayForm child for managing frequency (PSD) plots.
26 * \ingroup qtgui_blk
27 */
28 class FreqDisplayForm : public DisplayForm
29{
30 Q_OBJECT
31
32public:
33 FreqDisplayForm(int nplots = 1, QWidget* parent = 0);
34 ~FreqDisplayForm() override;
35
36 FrequencyDisplayPlot* getPlot() override;
37
38 int getFFTSize() const;
39 float getFFTAverage() const;
40 gr::fft::window::win_type getFFTWindowType() const;
41
42 // Trigger methods
43 gr::qtgui::trigger_mode getTriggerMode() const;
44 float getTriggerLevel() const;
45 int getTriggerChannel() const;
46 std::string getTriggerTagKey() const;
47
48
49 // returns the frequency that was last double-clicked on by the user
50 float getClickedFreq() const;
51
52 // checks if there was a double-click event; reset if there was
53 bool checkClicked();
54
55 const int MIN_FFT_SIZE = 32;
56 const int MAX_FFT_SIZE = 32768;
57 const int FFT_DEFAULT_SIZE = 1024;
58
59public slots:
60 void customEvent(QEvent* e) override;
61
62 void setSampleRate(const QString& samprate) override;
63 void setFFTSize(const int);
64 void setFFTAverage(const float);
65 void setFFTWindowType(const gr::fft::window::win_type);
66
67 void setFrequencyRange(const double centerfreq, const double bandwidth);
68 void setYaxis(double min, double max);
69 void setYLabel(const std::string& label, const std::string& unit = "");
70 void setYMax(const QString& m);
71 void setYMin(const QString& m);
72 void autoScale(bool en) override;
73 void autoScaleShot();
74 void setPlotPosHalf(bool half);
75 void clearMaxHold();
76 void clearMinHold();
77
78 // Trigger slots
79 void updateTrigger(gr::qtgui::trigger_mode mode);
80 void setTriggerMode(gr::qtgui::trigger_mode mode);
81 void setTriggerLevel(QString s);
82 void setTriggerLevel(float level);
83 void setTriggerChannel(int chan);
84 void setTriggerTagKey(QString s);
85 void setTriggerTagKey(const std::string& s);
86
87 void setupControlPanel(bool en);
88 void setupControlPanel();
89 void teardownControlPanel();
90
91 void notifyYAxisPlus();
92 void notifyYAxisMinus();
93 void notifyYRangePlus();
94 void notifyYRangeMinus();
95 void notifyFFTSize(const QString& s);
96 void notifyFFTWindow(const QString& s);
97 void notifyMaxHold(bool en);
98 void notifyMinHold(bool en);
99 void notifyTriggerMode(const QString& mode);
100 void notifyTriggerLevelPlus();
101 void notifyTriggerLevelMinus();
102
103signals:
104 void signalFFTSize(int size);
105 void signalFFTWindow(gr::fft::window::win_type win);
106 void signalClearMaxData();
107 void signalClearMinData();
108 void signalSetMaxFFTVisible(bool en);
109 void signalSetMinFFTVisible(bool en);
110 void signalTriggerMode(gr::qtgui::trigger_mode mode);
111 void signalTriggerLevel(float level);
112 void signalReplot();
113
114
115private slots:
116 void newData(const QEvent* updateEvent) override;
117 void onPlotPointSelected(const QPointF p) override;
118
119private:
120 QIntValidator* d_int_validator;
121
122 double d_samp_rate, d_center_freq;
123 int d_fftsize;
124 float d_fftavg;
125 gr::fft::window::win_type d_fftwintype;
126 double d_units;
127
128 bool d_clicked;
129 double d_clicked_freq;
130
131 FFTAverageMenu* d_avgmenu;
132 FFTWindowMenu* d_winmenu;
133 QAction *d_minhold_act, *d_maxhold_act;
134
135 QMenu* d_triggermenu;
136 TriggerModeMenu* d_tr_mode_menu;
137 PopupMenu* d_tr_level_act;
138 TriggerChannelMenu* d_tr_channel_menu;
139 PopupMenu* d_tr_tag_key_act;
140
141 gr::qtgui::trigger_mode d_trig_mode;
142 float d_trig_level;
143 int d_trig_channel;
144 std::string d_trig_tag_key;
145
146 QAction* d_controlpanelmenu;
147 FreqControlPanel* d_controlpanel;
148};
149
150#endif /* FREQ_DISPLAY_FORM_H */
FrequencyDisplayPlot.h
DisplayForm::DisplayForm
DisplayForm(int nplots=1, QWidget *parent=0)
FFTAverageMenu
Definition form_menus.h:561
FFTWindowMenu
Definition form_menus.h:575
FreqControlPanel
Definition freqcontrolpanel.h:27
FreqDisplayForm::customEvent
void customEvent(QEvent *e) override
FreqDisplayForm::notifyYRangeMinus
void notifyYRangeMinus()
FreqDisplayForm::FFT_DEFAULT_SIZE
const int FFT_DEFAULT_SIZE
Definition freqdisplayform.h:57
FreqDisplayForm::setTriggerLevel
void setTriggerLevel(QString s)
FreqDisplayForm::signalReplot
void signalReplot()
FreqDisplayForm::setupControlPanel
void setupControlPanel()
FreqDisplayForm::setSampleRate
void setSampleRate(const QString &samprate) override
FreqDisplayForm::setYaxis
void setYaxis(double min, double max)
FreqDisplayForm::signalFFTSize
void signalFFTSize(int size)
FreqDisplayForm::getFFTSize
int getFFTSize() const
FreqDisplayForm::setPlotPosHalf
void setPlotPosHalf(bool half)
FreqDisplayForm::setYMax
void setYMax(const QString &m)
FreqDisplayForm::signalClearMaxData
void signalClearMaxData()
FreqDisplayForm::signalSetMaxFFTVisible
void signalSetMaxFFTVisible(bool en)
FreqDisplayForm::getTriggerTagKey
std::string getTriggerTagKey() const
FreqDisplayForm::notifyMaxHold
void notifyMaxHold(bool en)
FreqDisplayForm::notifyYRangePlus
void notifyYRangePlus()
FreqDisplayForm::notifyTriggerMode
void notifyTriggerMode(const QString &mode)
FreqDisplayForm::setTriggerTagKey
void setTriggerTagKey(const std::string &s)
FreqDisplayForm::setTriggerChannel
void setTriggerChannel(int chan)
FreqDisplayForm::autoScaleShot
void autoScaleShot()
FreqDisplayForm::setYMin
void setYMin(const QString &m)
FreqDisplayForm::teardownControlPanel
void teardownControlPanel()
FreqDisplayForm::getTriggerLevel
float getTriggerLevel() const
FreqDisplayForm::setTriggerTagKey
void setTriggerTagKey(QString s)
FreqDisplayForm::updateTrigger
void updateTrigger(gr::qtgui::trigger_mode mode)
FreqDisplayForm::setYLabel
void setYLabel(const std::string &label, const std::string &unit="")
FreqDisplayForm::setFFTWindowType
void setFFTWindowType(const gr::fft::window::win_type)
FreqDisplayForm::autoScale
void autoScale(bool en) override
FreqDisplayForm::setFFTAverage
void setFFTAverage(const float)
FreqDisplayForm::getClickedFreq
float getClickedFreq() const
FreqDisplayForm::MIN_FFT_SIZE
const int MIN_FFT_SIZE
Definition freqdisplayform.h:55
FreqDisplayForm::signalTriggerMode
void signalTriggerMode(gr::qtgui::trigger_mode mode)
FreqDisplayForm::getFFTWindowType
gr::fft::window::win_type getFFTWindowType() const
FreqDisplayForm::notifyFFTWindow
void notifyFFTWindow(const QString &s)
FreqDisplayForm::notifyFFTSize
void notifyFFTSize(const QString &s)
FreqDisplayForm::setTriggerLevel
void setTriggerLevel(float level)
FreqDisplayForm::clearMaxHold
void clearMaxHold()
FreqDisplayForm::FreqDisplayForm
FreqDisplayForm(int nplots=1, QWidget *parent=0)
FreqDisplayForm::signalFFTWindow
void signalFFTWindow(gr::fft::window::win_type win)
FreqDisplayForm::notifyYAxisPlus
void notifyYAxisPlus()
FreqDisplayForm::getTriggerChannel
int getTriggerChannel() const
FreqDisplayForm::setFrequencyRange
void setFrequencyRange(const double centerfreq, const double bandwidth)
FreqDisplayForm::~FreqDisplayForm
~FreqDisplayForm() override
FreqDisplayForm::signalClearMinData
void signalClearMinData()
FreqDisplayForm::getPlot
FrequencyDisplayPlot * getPlot() override
FreqDisplayForm::signalTriggerLevel
void signalTriggerLevel(float level)
FreqDisplayForm::getFFTAverage
float getFFTAverage() const
FreqDisplayForm::getTriggerMode
gr::qtgui::trigger_mode getTriggerMode() const
FreqDisplayForm::notifyTriggerLevelPlus
void notifyTriggerLevelPlus()
FreqDisplayForm::clearMinHold
void clearMinHold()
FreqDisplayForm::signalSetMinFFTVisible
void signalSetMinFFTVisible(bool en)
FreqDisplayForm::setupControlPanel
void setupControlPanel(bool en)
FreqDisplayForm::checkClicked
bool checkClicked()
FreqDisplayForm::notifyYAxisMinus
void notifyYAxisMinus()
FreqDisplayForm::setTriggerMode
void setTriggerMode(gr::qtgui::trigger_mode mode)
FreqDisplayForm::MAX_FFT_SIZE
const int MAX_FFT_SIZE
Definition freqdisplayform.h:56
FreqDisplayForm::notifyTriggerLevelMinus
void notifyTriggerLevelMinus()
FreqDisplayForm::notifyMinHold
void notifyMinHold(bool en)
FreqDisplayForm::setFFTSize
void setFFTSize(const int)
FrequencyDisplayPlot
QWidget for displaying frequency domain (PSD) plots.
Definition FrequencyDisplayPlot.h:24
PopupMenu
Definition form_menus.h:1191
TriggerChannelMenu
Definition form_menus.h:986
TriggerModeMenu
Definition form_menus.h:843
gr::fft::window::win_type
win_type
Definition window.h:28
displayform.h
gr::qtgui::trigger_mode
trigger_mode
Definition trigger_mode.h:17
spectrumUpdateEvents.h
window.h