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 options.gain is None:
|
||||||
# if no gain was specified, use the mid-point in dB
|
# if no gain was specified, use the mid-point in dB
|
||||||
r = self.src.get_gain_range()
|
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 options.center_freq is None:
|
||||||
# if no freq was specified, use the mid-point in Hz
|
# if no freq was specified, use the mid-point in Hz
|
||||||
|
@ -241,16 +245,21 @@ class app_top_block(stdgui2.std_top_block, pubsub):
|
||||||
)
|
)
|
||||||
freq_hbox.AddSpacer(5)
|
freq_hbox.AddSpacer(5)
|
||||||
|
|
||||||
forms.slider(
|
try: # range.start() == range.stop() in file= mode
|
||||||
parent=self.panel, sizer=freq_hbox,
|
|
||||||
proportion=3,
|
forms.slider(
|
||||||
ps=self,
|
parent=self.panel, sizer=freq_hbox,
|
||||||
key=CENTER_FREQ_KEY,
|
proportion=3,
|
||||||
minimum=self[FREQ_RANGE_KEY].start(),
|
ps=self,
|
||||||
maximum=self[FREQ_RANGE_KEY].stop(),
|
key=CENTER_FREQ_KEY,
|
||||||
num_steps=101,
|
minimum=self[FREQ_RANGE_KEY].start(),
|
||||||
)
|
maximum=self[FREQ_RANGE_KEY].stop(),
|
||||||
freq_hbox.AddSpacer(3)
|
num_steps=101,
|
||||||
|
)
|
||||||
|
freq_hbox.AddSpacer(3)
|
||||||
|
|
||||||
|
except AssertionError:
|
||||||
|
pass
|
||||||
|
|
||||||
corr_hbox.AddSpacer(3)
|
corr_hbox.AddSpacer(3)
|
||||||
forms.text_box(
|
forms.text_box(
|
||||||
|
|
Loading…
Reference in New Issue