commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/04: qtgui: adds menu item to clear max a


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/04: qtgui: adds menu item to clear max and min hold lines on frequency plot.
Date: Wed, 2 Jul 2014 22:12:36 +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 11fd45d36db4f0cb0609534f70b031c937d542a0
Author: Tom Rondeau <address@hidden>
Date:   Wed Jul 2 17:10:53 2014 -0400

    qtgui: adds menu item to clear max and min hold lines on frequency plot.
---
 gr-qtgui/include/gnuradio/qtgui/freq_sink_c.h     |  2 ++
 gr-qtgui/include/gnuradio/qtgui/freq_sink_f.h     |  2 ++
 gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h |  4 +++-
 gr-qtgui/lib/FrequencyDisplayPlot.cc              |  4 ++--
 gr-qtgui/lib/freq_sink_c_impl.cc                  | 12 ++++++++++++
 gr-qtgui/lib/freq_sink_c_impl.h                   |  2 ++
 gr-qtgui/lib/freq_sink_f_impl.cc                  | 12 ++++++++++++
 gr-qtgui/lib/freq_sink_f_impl.h                   |  2 ++
 gr-qtgui/lib/freqdisplayform.cc                   | 23 +++++++++++++++++++++--
 9 files changed, 58 insertions(+), 5 deletions(-)

diff --git a/gr-qtgui/include/gnuradio/qtgui/freq_sink_c.h 
b/gr-qtgui/include/gnuradio/qtgui/freq_sink_c.h
index c2f5068..d47b5e4 100644
--- a/gr-qtgui/include/gnuradio/qtgui/freq_sink_c.h
+++ b/gr-qtgui/include/gnuradio/qtgui/freq_sink_c.h
@@ -127,6 +127,8 @@ namespace gr {
       virtual void enable_menu(bool en=true) = 0;
       virtual void enable_grid(bool en=true) = 0;
       virtual void enable_autoscale(bool en=true) = 0;
+      virtual void clear_max_hold() = 0;
+      virtual void clear_min_hold() = 0;
       virtual void reset() = 0;
 
       QApplication *d_qApplication;
diff --git a/gr-qtgui/include/gnuradio/qtgui/freq_sink_f.h 
b/gr-qtgui/include/gnuradio/qtgui/freq_sink_f.h
index bc7f0a6..98ac018 100644
--- a/gr-qtgui/include/gnuradio/qtgui/freq_sink_f.h
+++ b/gr-qtgui/include/gnuradio/qtgui/freq_sink_f.h
@@ -126,6 +126,8 @@ namespace gr {
       virtual void enable_menu(bool en=true) = 0;
       virtual void enable_grid(bool en=true) = 0;
       virtual void enable_autoscale(bool en=true) = 0;
+      virtual void clear_max_hold() = 0;
+      virtual void clear_min_hold() = 0;
       virtual void reset() = 0;
 
       QApplication *d_qApplication;
diff --git a/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h 
b/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h
index 1fa57c1..c0cd36e 100644
--- a/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h
+++ b/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h
@@ -67,6 +67,8 @@ public slots:
                         const double bandwidth);
   void setYaxis(double min, double max);
   void autoScale(bool en);
+  void clearMaxHold();
+  void clearMinHold();
 
 private slots:
   void newData(const QEvent *updateEvent);
@@ -88,7 +90,7 @@ private:
   FFTSizeMenu *d_sizemenu;
   FFTAverageMenu *d_avgmenu;
   FFTWindowMenu *d_winmenu;
-
+  QAction *d_clearmin_act, *d_clearmax_act;
 };
 
 #endif /* FREQ_DISPLAY_FORM_H */
diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc 
b/gr-qtgui/lib/FrequencyDisplayPlot.cc
index d1d2ef8..19ebac1 100644
--- a/gr-qtgui/lib/FrequencyDisplayPlot.cc
+++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc
@@ -133,7 +133,7 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(int nplots, 
QWidget* parent)
   }
 
   // Create min/max plotter curves
-  d_min_fft_plot_curve = new QwtPlotCurve("Minimum Power");
+  d_min_fft_plot_curve = new QwtPlotCurve("Min Hold");
   d_min_fft_plot_curve->attach(this);
   const QColor default_min_fft_color = Qt::magenta;
   setMinFFTColor(default_min_fft_color);
@@ -145,7 +145,7 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(int nplots, 
QWidget* parent)
   d_min_fft_plot_curve->setVisible(false);
   d_min_fft_plot_curve->setZ(0);
 
-  d_max_fft_plot_curve = new QwtPlotCurve("Maximum Power");
+  d_max_fft_plot_curve = new QwtPlotCurve("Max Hold");
   d_max_fft_plot_curve->attach(this);
   QColor default_max_fft_color = Qt::darkYellow;
   setMaxFFTColor(default_max_fft_color);
diff --git a/gr-qtgui/lib/freq_sink_c_impl.cc b/gr-qtgui/lib/freq_sink_c_impl.cc
index a95814e..cfff3ee 100644
--- a/gr-qtgui/lib/freq_sink_c_impl.cc
+++ b/gr-qtgui/lib/freq_sink_c_impl.cc
@@ -359,6 +359,18 @@ namespace gr {
     }
 
     void
+    freq_sink_c_impl::clear_max_hold()
+    {
+      d_main_gui->clearMaxHold();
+    }
+
+    void
+    freq_sink_c_impl::clear_min_hold()
+    {
+      d_main_gui->clearMinHold();
+    }
+
+    void
     freq_sink_c_impl::reset()
     {
       d_index = 0;
diff --git a/gr-qtgui/lib/freq_sink_c_impl.h b/gr-qtgui/lib/freq_sink_c_impl.h
index 4beea57..e435cc6 100644
--- a/gr-qtgui/lib/freq_sink_c_impl.h
+++ b/gr-qtgui/lib/freq_sink_c_impl.h
@@ -129,6 +129,8 @@ namespace gr {
       void enable_menu(bool en);
       void enable_grid(bool en);
       void enable_autoscale(bool en);
+      void clear_max_hold();
+      void clear_min_hold();
       void reset();
 
       int work(int noutput_items,
diff --git a/gr-qtgui/lib/freq_sink_f_impl.cc b/gr-qtgui/lib/freq_sink_f_impl.cc
index 80a09a1..d653057 100644
--- a/gr-qtgui/lib/freq_sink_f_impl.cc
+++ b/gr-qtgui/lib/freq_sink_f_impl.cc
@@ -359,6 +359,18 @@ namespace gr {
     }
 
     void
+    freq_sink_f_impl::clear_max_hold()
+    {
+      d_main_gui->clearMaxHold();
+    }
+
+    void
+    freq_sink_f_impl::clear_min_hold()
+    {
+      d_main_gui->clearMinHold();
+    }
+
+    void
     freq_sink_f_impl::reset()
     {
       d_index = 0;
diff --git a/gr-qtgui/lib/freq_sink_f_impl.h b/gr-qtgui/lib/freq_sink_f_impl.h
index 74b95c5..8a821f8 100644
--- a/gr-qtgui/lib/freq_sink_f_impl.h
+++ b/gr-qtgui/lib/freq_sink_f_impl.h
@@ -128,6 +128,8 @@ namespace gr {
       void enable_menu(bool en);
       void enable_grid(bool en);
       void enable_autoscale(bool en);
+      void clear_max_hold();
+      void clear_min_hold();
       void reset();
 
       int work(int noutput_items,
diff --git a/gr-qtgui/lib/freqdisplayform.cc b/gr-qtgui/lib/freqdisplayform.cc
index 537325f..ae62136 100644
--- a/gr-qtgui/lib/freqdisplayform.cc
+++ b/gr-qtgui/lib/freqdisplayform.cc
@@ -55,6 +55,15 @@ 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)));
 
+  d_clearmax_act = new QAction("Clear Max", this);
+  d_menu->addAction(d_clearmax_act);
+  connect(d_clearmax_act, SIGNAL(triggered()),
+         this, SLOT(clearMaxHold()));
+  d_clearmin_act = new QAction("Clear Min", this);
+  d_menu->addAction(d_clearmin_act);
+  connect(d_clearmin_act, SIGNAL(triggered()),
+         this, SLOT(clearMinHold()));
+
   Reset();
 
   connect(d_display_plot, SIGNAL(plotPointSelected(const QPointF)),
@@ -159,8 +168,6 @@ FreqDisplayForm::setFrequencyRange(const double centerfreq,
   d_center_freq = centerfreq;
   d_samp_rate = bandwidth;
 
-  std::cerr << "FDISP NEW FREQ: " << centerfreq << std::endl;
-
   getPlot()->setFrequencyRange(centerfreq, bandwidth,
                               d_units, strunits[iunit]);
 }
@@ -187,6 +194,18 @@ FreqDisplayForm::autoScale(bool en)
 }
 
 void
+FreqDisplayForm::clearMaxHold()
+{
+  getPlot()->clearMaxData();
+}
+
+void
+FreqDisplayForm::clearMinHold()
+{
+  getPlot()->clearMinData();
+}
+
+void
 FreqDisplayForm::onPlotPointSelected(const QPointF p)
 {
   d_clicked = true;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]