forked from sdr/gr-osmosdr
apps: catch corner cases for file= mode in osmocom_fft
verified for gqrx and sdrangerlove as well: file=/tmp/lte.cfile,rate=40e6,freq=1815e6,repeat=true,throttle=true
This commit is contained in:
parent
6f4e16ff28
commit
0851071ba2
|
@ -113,7 +113,11 @@ class app_top_block(stdgui2.std_top_block, pubsub):
|
|||
if options.gain is None:
|
||||
# if no gain was specified, use the mid-point in dB
|
||||
r = self.src.get_gain_range()
|
||||
try: # empty gain range returned in file= mode
|
||||
options.gain = float(r.start()+r.stop())/2
|
||||
except RuntimeError:
|
||||
options.gain = 0
|
||||
pass
|
||||
|
||||
if options.center_freq is None:
|
||||
# if no freq was specified, use the mid-point in Hz
|
||||
|
@ -241,6 +245,8 @@ class app_top_block(stdgui2.std_top_block, pubsub):
|
|||
)
|
||||
freq_hbox.AddSpacer(5)
|
||||
|
||||
try: # range.start() == range.stop() in file= mode
|
||||
|
||||
forms.slider(
|
||||
parent=self.panel, sizer=freq_hbox,
|
||||
proportion=3,
|
||||
|
@ -252,6 +258,9 @@ class app_top_block(stdgui2.std_top_block, pubsub):
|
|||
)
|
||||
freq_hbox.AddSpacer(3)
|
||||
|
||||
except AssertionError:
|
||||
pass
|
||||
|
||||
corr_hbox.AddSpacer(3)
|
||||
forms.text_box(
|
||||
parent=self.panel, sizer=corr_hbox,
|
||||
|
|
Loading…
Reference in New Issue