commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r9767 - gnuradio/trunk/gr-wxgui/src/python


From: jblum
Subject: [Commit-gnuradio] r9767 - gnuradio/trunk/gr-wxgui/src/python
Date: Fri, 10 Oct 2008 15:13:34 -0600 (MDT)

Author: jblum
Date: 2008-10-10 15:13:33 -0600 (Fri, 10 Oct 2008)
New Revision: 9767

Modified:
   gnuradio/trunk/gr-wxgui/src/python/fft_window.py
   gnuradio/trunk/gr-wxgui/src/python/waterfall_window.py
Log:
check for samples before autoscale, avoids potential error condition

Modified: gnuradio/trunk/gr-wxgui/src/python/fft_window.py
===================================================================
--- gnuradio/trunk/gr-wxgui/src/python/fft_window.py    2008-10-10 04:08:12 UTC 
(rev 9766)
+++ gnuradio/trunk/gr-wxgui/src/python/fft_window.py    2008-10-10 21:13:33 UTC 
(rev 9767)
@@ -149,6 +149,7 @@
                #ensure y_per_div
                if y_per_div not in DIV_LEVELS: y_per_div = DIV_LEVELS[0]
                #setup
+               self.samples = list()
                self.ext_controller = controller
                self.real = real
                self.fft_size = fft_size
@@ -197,6 +198,7 @@
                Autoscale the fft plot to the last frame.
                Set the dynamic range and reference level.
                """
+               if not len(self.samples): return
                #get the peak level (max of the samples)
                peak_level = numpy.max(self.samples)
                #get the noise floor (averge the smallest samples)

Modified: gnuradio/trunk/gr-wxgui/src/python/waterfall_window.py
===================================================================
--- gnuradio/trunk/gr-wxgui/src/python/waterfall_window.py      2008-10-10 
04:08:12 UTC (rev 9766)
+++ gnuradio/trunk/gr-wxgui/src/python/waterfall_window.py      2008-10-10 
21:13:33 UTC (rev 9767)
@@ -168,6 +168,7 @@
        ):
                pubsub.pubsub.__init__(self)
                #setup
+               self.samples = list()
                self.ext_controller = controller
                self.real = real
                self.fft_size = fft_size
@@ -220,6 +221,7 @@
                Set the dynamic range and reference level.
                Does not affect the current data in the waterfall.
                """
+               if not len(self.samples): return
                #get the peak level (max of the samples)
                peak_level = numpy.max(self.samples)
                #get the noise floor (averge the smallest samples)





reply via email to

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