[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 25/37: qtgui: adding menu item to frequency
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 25/37: qtgui: adding menu item to frequency sink to set y min/max. |
Date: |
Thu, 17 Jul 2014 20:23:42 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit 127710c4604a1cbd0592d4ffa7d3c520ce03b693
Author: Tom Rondeau <address@hidden>
Date: Sat Jul 12 11:07:24 2014 -0400
qtgui: adding menu item to frequency sink to set y min/max.
---
.../include/gnuradio/qtgui/FrequencyDisplayPlot.h | 2 ++
gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h | 2 ++
gr-qtgui/lib/FrequencyDisplayPlot.cc | 16 ++++++++++++-
gr-qtgui/lib/freqdisplayform.cc | 28 ++++++++++++++++++++++
4 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/gr-qtgui/include/gnuradio/qtgui/FrequencyDisplayPlot.h
b/gr-qtgui/include/gnuradio/qtgui/FrequencyDisplayPlot.h
index f5e8f0f..ac7dfe8 100644
--- a/gr-qtgui/include/gnuradio/qtgui/FrequencyDisplayPlot.h
+++ b/gr-qtgui/include/gnuradio/qtgui/FrequencyDisplayPlot.h
@@ -76,6 +76,8 @@ public:
void replot();
void setYaxis(double min, double max);
+ double getYMin() const;
+ double getYMax() const;
void setTraceColour (QColor);
void setBGColour (QColor c);
diff --git a/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h
b/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h
index c0cd36e..7cd077e 100644
--- a/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h
+++ b/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h
@@ -66,6 +66,8 @@ public slots:
void setFrequencyRange(const double centerfreq,
const double bandwidth);
void setYaxis(double min, double max);
+ void setYMax(const QString &m);
+ void setYMin(const QString &m);
void autoScale(bool en);
void clearMaxHold();
void clearMinHold();
diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc
b/gr-qtgui/lib/FrequencyDisplayPlot.cc
index 19ebac1..12835bc 100644
--- a/gr-qtgui/lib/FrequencyDisplayPlot.cc
+++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc
@@ -262,6 +262,18 @@ FrequencyDisplayPlot::setYaxis(double min, double max)
d_zoomer->setZoomBase();
}
+double
+FrequencyDisplayPlot::getYMin() const
+{
+ return d_ymin;
+}
+
+double
+FrequencyDisplayPlot::getYMax() const
+{
+ return d_ymax;
+}
+
void
FrequencyDisplayPlot::setFrequencyRange(const double centerfreq,
const double bandwidth,
@@ -438,7 +450,9 @@ void
FrequencyDisplayPlot::_autoScale(double bottom, double top)
{
// Auto scale the y-axis with a margin of 10 dB on either side.
- setYaxis(bottom - 10, top + 10);
+ d_ymin = bottom-10;
+ d_ymax = top+10;
+ setYaxis(d_ymin, d_ymax);
}
void
diff --git a/gr-qtgui/lib/freqdisplayform.cc b/gr-qtgui/lib/freqdisplayform.cc
index e9968df..ccc7fe9 100644
--- a/gr-qtgui/lib/freqdisplayform.cc
+++ b/gr-qtgui/lib/freqdisplayform.cc
@@ -55,6 +55,16 @@ FreqDisplayForm::FreqDisplayForm(int nplots, QWidget* parent)
connect(d_winmenu, SIGNAL(whichTrigger(gr::filter::firdes::win_type)),
this, SLOT(setFFTWindowType(const gr::filter::firdes::win_type)));
+ PopupMenu *maxymenu = new PopupMenu("Y Max", this);
+ d_menu->addAction(maxymenu);
+ connect(maxymenu, SIGNAL(whichTrigger(QString)),
+ this, SLOT(setYMax(QString)));
+
+ PopupMenu *minymenu = new PopupMenu("Y Min", this);
+ d_menu->addAction(minymenu);
+ connect(minymenu, SIGNAL(whichTrigger(QString)),
+ this, SLOT(setYMin(QString)));
+
d_clearmax_act = new QAction("Clear Max", this);
d_menu->addAction(d_clearmax_act);
connect(d_clearmax_act, SIGNAL(triggered()),
@@ -179,6 +189,24 @@ FreqDisplayForm::setYaxis(double min, double max)
}
void
+FreqDisplayForm::setYMax(const QString &m)
+{
+ double new_max = m.toDouble();
+ double cur_ymin = getPlot()->getYMin();
+ if(new_max > cur_ymin)
+ setYaxis(cur_ymin, new_max);
+}
+
+void
+FreqDisplayForm::setYMin(const QString &m)
+{
+ double new_min = m.toDouble();
+ double cur_ymax = getPlot()->getYMax();
+ if(new_min < cur_ymax)
+ setYaxis(new_min, cur_ymax);
+}
+
+void
FreqDisplayForm::autoScale(bool en)
{
if(en) {
- [Commit-gnuradio] [gnuradio] 12/37: Merge remote-tracking branch 'gnuradio-wg-grc/grc_variable_blocks', (continued)
- [Commit-gnuradio] [gnuradio] 12/37: Merge remote-tracking branch 'gnuradio-wg-grc/grc_variable_blocks', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 22/37: Merge remote-tracking branch 'gnuradio-wg-grc/grc_port_view_options', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 09/37: uhd: Added example for re-tuning through messages, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 06/37: uhd: Refactored common stuff from usrp sink and source, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 23/37: qtgui: time raster display updates., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 11/37: build: missed gnuradio-uhd in static libs build., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 15/37: grc: fixing some spacing issues in various xml files., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 13/37: Merge remote-tracking branch 'gnuradio-wg-grc/grc_hide_ports', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 18/37: Merge branch 'maint', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 24/37: qtgui: fixes waterfall plots., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 25/37: qtgui: adding menu item to frequency sink to set y min/max.,
git <=
- [Commit-gnuradio] [gnuradio] 14/37: grc: fixing xml files of some blocks with message control ports to be able to hide/show them as wanted., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 21/37: qtgui: updates number sink behavor., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 20/37: grc: toogle action to disable auto-hiding port labels, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 19/37: grc: auto-hide port labels, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 34/37: Merge remote-tracking branch 'mbant/uhd/msg_format' into qt_the_things, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 30/37: qtgui: minor fix to how number sink handles autoscale., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 37/37: Merge branch 'qt_the_things', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 29/37: Merge remote-tracking branch 'mbant/qtify-examples', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 28/37: qtgui: adding a formatter to qtgui label widget to behave like formatter in the wxgui static text widget., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 32/37: zeromq: updated zeromq examples to use qtgui., git, 2014/07/17