commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 10/23: qtgui: allows toggling rf frequencie


From: git
Subject: [Commit-gnuradio] [gnuradio] 10/23: qtgui: allows toggling rf frequencies on/off in GRC options box.
Date: Thu, 26 Jun 2014 19:54:44 +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 e27945c7c25bca5e9dd2e98cee4ba7dce2303e99
Author: Tom Rondeau <address@hidden>
Date:   Tue Jun 24 22:40:50 2014 -0400

    qtgui: allows toggling rf frequencies on/off in GRC options box.
    
    Addresses Issue #673.
---
 gr-qtgui/grc/qtgui_sink_x.xml                       | 21 ++++++++++++++++++++-
 gr-qtgui/include/gnuradio/qtgui/SpectrumGUIClass.h  |  2 ++
 gr-qtgui/include/gnuradio/qtgui/sink_c.h            |  1 +
 .../include/gnuradio/qtgui/spectrumdisplayform.h    |  1 +
 gr-qtgui/lib/SpectrumGUIClass.cc                    |  9 ++++++++-
 gr-qtgui/lib/sink_c_impl.cc                         |  7 +++++++
 gr-qtgui/lib/sink_c_impl.h                          |  1 +
 gr-qtgui/lib/spectrumdisplayform.cc                 |  6 ++++++
 8 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml
index 6e13481..ea14947 100644
--- a/gr-qtgui/grc/qtgui_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_sink_x.xml
@@ -27,10 +27,12 @@ self.$(id).set_update_time(1.0/$rate)
 self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget)
 $(gui_hint()($win))
 
+self.$(id).enable_rf_freq($showrf)
+
 #if $freqchangevar() is not None
 def $(id)_callback(p, num):
        if num == 1 or num == 2: self.set_$(freqchangevar)(p.x())
-       
+
 Qt.QObject.connect(self._$(id)_win, Qt.SIGNAL("plotPointSelected(QPointF, 
int)"), $(id)_callback )
 #end if
 
@@ -105,6 +107,23 @@ Qt.QObject.connect(self._$(id)_win, 
Qt.SIGNAL("plotPointSelected(QPointF, int)")
                <value>10</value>
                <type>real</type>
        </param>
+
+        <param>
+          <name>Show RF Freq</name>
+          <key>showrf</key>
+          <value>False</value>
+          <type>enum</type>
+          <hide>part</hide>
+          <option>
+            <name>Yes</name>
+            <key>True</key>
+          </option>
+          <option>
+            <name>No</name>
+            <key>False</key>
+          </option>
+        </param>
+
        <param>
                <name>Plot Frequency</name>
                <key>plotfreq</key>
diff --git a/gr-qtgui/include/gnuradio/qtgui/SpectrumGUIClass.h 
b/gr-qtgui/include/gnuradio/qtgui/SpectrumGUIClass.h
index f95ab64..68a7201 100644
--- a/gr-qtgui/include/gnuradio/qtgui/SpectrumGUIClass.h
+++ b/gr-qtgui/include/gnuradio/qtgui/SpectrumGUIClass.h
@@ -103,6 +103,8 @@ public:
 
   void setUpdateTime(double t);
 
+  void enableRFFreq(bool en);
+
 protected:
 
 private:
diff --git a/gr-qtgui/include/gnuradio/qtgui/sink_c.h 
b/gr-qtgui/include/gnuradio/qtgui/sink_c.h
index e0c7700..c9cb48b 100644
--- a/gr-qtgui/include/gnuradio/qtgui/sink_c.h
+++ b/gr-qtgui/include/gnuradio/qtgui/sink_c.h
@@ -91,6 +91,7 @@ namespace gr {
       virtual void set_frequency_range(const double centerfreq,
                                       const double bandwidth) = 0;
       virtual void set_fft_power_db(double min, double max) = 0;
+      virtual void enable_rf_freq(bool en) = 0;
 
       //void set_time_domain_axis(double min, double max);
       //void set_constellation_axis(double xmin, double xmax,
diff --git a/gr-qtgui/include/gnuradio/qtgui/spectrumdisplayform.h 
b/gr-qtgui/include/gnuradio/qtgui/spectrumdisplayform.h
index 6b43661..50cbc58 100644
--- a/gr-qtgui/include/gnuradio/qtgui/spectrumdisplayform.h
+++ b/gr-qtgui/include/gnuradio/qtgui/spectrumdisplayform.h
@@ -71,6 +71,7 @@ public slots:
   void closeEvent(QCloseEvent * e);
   void windowTypeChanged(int newItem);
   void useRFFrequenciesCB(bool useRFFlag);
+  void toggleRFFrequencies(bool en);
   void waterfallMaximumIntensityChangedCB(double);
   void waterfallMinimumIntensityChangedCB(double);
   void waterfallIntensityColorTypeChanged(int);
diff --git a/gr-qtgui/lib/SpectrumGUIClass.cc b/gr-qtgui/lib/SpectrumGUIClass.cc
index 8098018..b7c5883 100644
--- a/gr-qtgui/lib/SpectrumGUIClass.cc
+++ b/gr-qtgui/lib/SpectrumGUIClass.cc
@@ -93,7 +93,7 @@ SpectrumGUIClass::openSpectrumWindow(QWidget* parent,
       _realTimeDomainPoints = new double[_dataPoints];
       _imagTimeDomainPoints = new double[_dataPoints];
       _fftBuffersCreatedFlag = true;
-      
+
       memset(_fftPoints, 0x0, _dataPoints*sizeof(float));
       memset(_realTimeDomainPoints, 0x0, _dataPoints*sizeof(double));
       memset(_imagTimeDomainPoints, 0x0, _dataPoints*sizeof(double));
@@ -470,5 +470,12 @@ SpectrumGUIClass::setUpdateTime(double t)
   _spectrumDisplayForm->setUpdateTime(_updateTime);
 }
 
+void
+SpectrumGUIClass::enableRFFreq(bool en)
+{
+  gr::thread::scoped_lock lock(d_mutex);
+  _spectrumDisplayForm->toggleRFFrequencies(en);
+}
+
 
 #endif /* SPECTRUM_GUI_CLASS_CPP */
diff --git a/gr-qtgui/lib/sink_c_impl.cc b/gr-qtgui/lib/sink_c_impl.cc
index 992512a..5d1c33e 100644
--- a/gr-qtgui/lib/sink_c_impl.cc
+++ b/gr-qtgui/lib/sink_c_impl.cc
@@ -218,6 +218,13 @@ namespace gr {
       d_main_gui->setFrequencyAxis(min, max);
     }
 
+    void
+    sink_c_impl::enable_rf_freq(bool en)
+    {
+      std::cerr << "ENABLE RF: " << en << std::endl;
+      d_main_gui->enableRFFreq(en);
+    }
+
     /*
     void
     sink_c_impl::set_time_domain_axis(double min, double max)
diff --git a/gr-qtgui/lib/sink_c_impl.h b/gr-qtgui/lib/sink_c_impl.h
index 18508d3..d303c05 100644
--- a/gr-qtgui/lib/sink_c_impl.h
+++ b/gr-qtgui/lib/sink_c_impl.h
@@ -95,6 +95,7 @@ namespace gr {
       void set_frequency_range(const double centerfreq,
                               const double bandwidth);
       void set_fft_power_db(double min, double max);
+      void enable_rf_freq(bool en);
 
       //void set_time_domain_axis(double min, double max);
       //void set_constellation_axis(double xmin, double xmax,
diff --git a/gr-qtgui/lib/spectrumdisplayform.cc 
b/gr-qtgui/lib/spectrumdisplayform.cc
index 0b5f630..aaaae63 100644
--- a/gr-qtgui/lib/spectrumdisplayform.cc
+++ b/gr-qtgui/lib/spectrumdisplayform.cc
@@ -572,6 +572,12 @@ SpectrumDisplayForm::useRFFrequenciesCB(bool useRFFlag)
   setFrequencyRange(_centerFrequency, _startFrequency, _stopFrequency);
 }
 
+void
+SpectrumDisplayForm::toggleRFFrequencies(bool en)
+{
+  UseRFFrequenciesCheckBox->setChecked(en);
+}
+
 
 void
 SpectrumDisplayForm::waterfallMaximumIntensityChangedCB(double newValue)



reply via email to

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