osmocom_fft: print the exception thrown in DC/IQ correction setters

This commit is contained in:
Dimitri Stolnikov 2014-01-11 09:06:20 +01:00
parent 49765922da
commit 7ae3e985e2
1 changed files with 16 additions and 6 deletions

View File

@ -625,9 +625,14 @@ class app_top_block(stdgui2.std_top_block, pubsub):
def set_dc_offset(self, value):
correction = complex( self['dc_offset_real'], self['dc_offset_imag'] )
if self._verbose:
print "Set DC offset to", correction
self.src.set_dc_offset( correction )
try:
self.src.set_dc_offset( correction )
if self._verbose:
print "Set DC offset to", correction
except RuntimeError as ex:
print ex
def set_iq_balance_mode(self, iq_balance_mode):
if iq_balance_mode == 1:
@ -649,9 +654,14 @@ class app_top_block(stdgui2.std_top_block, pubsub):
def set_iq_balance(self, value):
correction = complex( self['iq_balance_mag'], self['iq_balance_pha'] )
if self._verbose:
print "Set IQ balance to", correction
self.src.set_iq_balance( correction )
try:
self.src.set_iq_balance( correction )
if self._verbose:
print "Set IQ balance to", correction
except RuntimeError as ex:
print ex
def set_sample_rate(self, samp_rate):
samp_rate = self.src.set_sample_rate(samp_rate)