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
5534662c0c
commit
2934d8512b
|
@ -115,7 +115,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()
|
||||
options.gain = float(r.start()+r.stop())/2
|
||||
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
|
||||
|
@ -247,16 +251,21 @@ class app_top_block(stdgui2.std_top_block, pubsub):
|
|||
)
|
||||
freq_hbox.AddSpacer(5)
|
||||
|
||||
forms.slider(
|
||||
parent=self.panel, sizer=freq_hbox,
|
||||
proportion=3,
|
||||
ps=self,
|
||||
key=CENTER_FREQ_KEY,
|
||||
minimum=self[FREQ_RANGE_KEY].start(),
|
||||
maximum=self[FREQ_RANGE_KEY].stop(),
|
||||
num_steps=101,
|
||||
)
|
||||
freq_hbox.AddSpacer(3)
|
||||
try: # range.start() == range.stop() in file= mode
|
||||
|
||||
forms.slider(
|
||||
parent=self.panel, sizer=freq_hbox,
|
||||
proportion=3,
|
||||
ps=self,
|
||||
key=CENTER_FREQ_KEY,
|
||||
minimum=self[FREQ_RANGE_KEY].start(),
|
||||
maximum=self[FREQ_RANGE_KEY].stop(),
|
||||
num_steps=101,
|
||||
)
|
||||
freq_hbox.AddSpacer(3)
|
||||
|
||||
except AssertionError:
|
||||
pass
|
||||
|
||||
corr_hbox.AddSpacer(3)
|
||||
forms.text_box(
|
||||
|
|
Loading…
Reference in New Issue