summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-02-01 17:18:19 -0500
committerTom Rondeau <trondeau@vt.edu>2012-02-01 17:18:19 -0500
commit8349e172965f67c08937c3c93f3772c55c892935 (patch)
treec679e6b353acc9f79e74e35a1acf5c2fb09dbe6d
parent3901b0b7025a66ae04748e65b2bdd59e59e574df (diff)
parent23f191c0a6cedece938d7daedaf7582694eab47d (diff)
Merge branch 'uhd_fft_rxbasic'
-rwxr-xr-xgr-uhd/apps/uhd_fft.py25
1 files changed, 16 insertions, 9 deletions
diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft.py
index f311a903bb..7314c47599 100755
--- a/gr-uhd/apps/uhd_fft.py
+++ b/gr-uhd/apps/uhd_fft.py
@@ -169,17 +169,24 @@ class app_top_block(stdgui2.std_top_block):
g = self.u.get_gain_range()
# some configurations don't have gain control
- if g.stop() > g.start():
- myform['gain'] = form.slider_field(parent=self.panel,
- sizer=hbox, label="Gain",
- weight=3,
- min=int(g.start()), max=int(g.stop()),
- callback=self.set_gain)
+ if g.stop() <= g.start():
+ glow = 0.0
+ ghigh = 1.0
+
+ else:
+ glow = g.start()
+ ghigh = g.stop()
+
+ myform['gain'] = form.slider_field(parent=self.panel,
+ sizer=hbox, label="Gain",
+ weight=3,
+ min=int(glow), max=int(ghigh),
+ callback=self.set_gain)
- hbox.Add((5,0), 0, 0)
- vbox.Add(hbox, 0, wx.EXPAND)
+ hbox.Add((5,0), 0, 0)
+ vbox.Add(hbox, 0, wx.EXPAND)
- self._build_subpanel(vbox)
+ self._build_subpanel(vbox)
def _build_subpanel(self, vbox_arg):
# build a secondary information panel (sometimes hidden)