commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r11341 - gnuradio/branches/developers/trondeau/qt/gr-q


From: trondeau
Subject: [Commit-gnuradio] r11341 - gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python
Date: Sat, 4 Jul 2009 17:46:20 -0600 (MDT)

Author: trondeau
Date: 2009-07-04 17:46:20 -0600 (Sat, 04 Jul 2009)
New Revision: 11341

Modified:
   gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/pyqt_example.py
   
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/pyqt_example_f.py
   gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/qt_digital.py
   gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/usrp_display.py
Log:
Changing examples for new qtsink constructor with frequency and bandwidth.

Modified: 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/pyqt_example.py
===================================================================
--- 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/pyqt_example.py    
    2009-07-04 23:41:39 UTC (rev 11340)
+++ 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/pyqt_example.py    
    2009-07-04 23:46:20 UTC (rev 11341)
@@ -114,7 +114,7 @@
         channel = gr.channel_model(0.001)
         thr = gr.throttle(gr.sizeof_gr_complex, 100*fftsize)
         self.snk1 = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
-                                 -Rs/2, Rs/2,
+                                 0, Rs,
                                  "Complex Signal Example",
                                  True, True, False, True, False)
 

Modified: 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/pyqt_example_f.py
===================================================================
--- 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/pyqt_example_f.py  
    2009-07-04 23:41:39 UTC (rev 11340)
+++ 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/pyqt_example_f.py  
    2009-07-04 23:46:20 UTC (rev 11341)
@@ -113,7 +113,7 @@
         src  = gr.add_ff()
         thr = gr.throttle(gr.sizeof_float, 100*fftsize)
         self.snk1 = qtgui.sink_f(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
-                                 -Rs/2, Rs/2,
+                                 0, Rs,
                                  "Float Signal Example",
                                  True, True, False, True, False)
 

Modified: 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/qt_digital.py
===================================================================
--- gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/qt_digital.py  
2009-07-04 23:41:39 UTC (rev 11340)
+++ gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/qt_digital.py  
2009-07-04 23:46:20 UTC (rev 11341)
@@ -183,10 +183,10 @@
         self.channel = gr.channel_model(noise, self.fo, self.to)
 
         self.thr = gr.throttle(gr.sizeof_char, 10*fftsize)
-        self.snk_tx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, 
-1/2, 1/2,
+        self.snk_tx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, 0, 
1,
                                    "Tx", True, True, False, True, True)
 
-        self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, 
-1/2, 1/2,
+        self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, 0, 
1,
                                    "Rx", True, True, False, True, True)
 
         self.connect(self.src, self.thr, self.mod, self.channel, self.snk_tx)

Modified: 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/usrp_display.py
===================================================================
--- 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/usrp_display.py    
    2009-07-04 23:41:39 UTC (rev 11340)
+++ 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/python/usrp_display.py    
    2009-07-04 23:46:20 UTC (rev 11341)
@@ -197,8 +197,8 @@
             options.freq = float(f[0]+f[1])/2
         self.set_frequency(options.freq)
 
-        self.snk = qtgui.sink_c(self._fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
-                                -self._bandwidth/2.0, self._bandwidth/2.0,
+        self.snk = qtgui.sink_f(self._fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
+                                self._freq, self._bandwidth,
                                 "USRP Display",
                                 True, True, False, True, False)
 
@@ -207,7 +207,7 @@
         self.set_amplifier_gain(0.001)
 
         # Connect the flow graph
-        self.connect(self.u, self.amp, self.snk)
+        self.connect(self.u, self.amp, gr.complex_to_real(), self.snk)
 
 
         # Get the reference pointer to the SpectrumDisplayForm QWidget
@@ -231,11 +231,21 @@
         self._freq = freq
         self.u.tune(0, self.subdev, self._freq)
 
+        try:
+            self.snk.set_frequency_range(self._freq, self._bandwidth)
+        except:
+            pass
+
     def set_bandwidth(self, bw):
         self._bandwidth = bw
         self._decim = int(self._adc_rate / self._bandwidth)
         self.u.set_decim_rate(self._decim)
 
+        try:
+            self.snk.set_frequency_range(self._freq, self._bandwidth)
+        except:
+            pass
+
     def set_amplifier_gain(self, amp):
             self._amp_value = amp
             self.amp.set_k(self._amp_value)





reply via email to

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