commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 03/06: qtgui: fixed issue #801 with control


From: git
Subject: [Commit-gnuradio] [gnuradio] 03/06: qtgui: fixed issue #801 with controlpanel in the frequency display.
Date: Mon, 22 Jun 2015 14:32:23 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit c7d9bd3297f58f40c597f5beee8ca67f8f556290
Author: Tom Rondeau <address@hidden>
Date:   Fri Jun 19 15:05:19 2015 -0400

    qtgui: fixed issue #801 with controlpanel in the frequency display.
    
    The logf calculation might produce a value slightly less than the even
    number it should, so casting it to an integer would round it
    down. Using round() to fix the problem.
---
 gr-qtgui/lib/freqcontrolpanel.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gr-qtgui/lib/freqcontrolpanel.cc b/gr-qtgui/lib/freqcontrolpanel.cc
index 269b88a..5840989 100644
--- a/gr-qtgui/lib/freqcontrolpanel.cc
+++ b/gr-qtgui/lib/freqcontrolpanel.cc
@@ -21,6 +21,7 @@
  */
 
 #include <gnuradio/qtgui/freqcontrolpanel.h>
+#include <cmath>
 
 FreqControlPanel::FreqControlPanel(FreqDisplayForm *form)
   : QVBoxLayout(),
@@ -245,7 +246,7 @@ FreqControlPanel::notifyAvgSlider(int val)
 void
 FreqControlPanel::toggleFFTSize(int val)
 {
-  int index = static_cast<int>(logf(static_cast<float>(val))/logf(2.0f)) - 5;
+  int index = 
static_cast<int>(round(logf(static_cast<float>(val))/logf(2.0f))) - 5;
   d_fft_size_combo->setCurrentIndex(index);
 }
 



reply via email to

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