aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2014-01-11 09:06:20 +0100
committerDimitri Stolnikov <horiz0n@gmx.net>2014-01-11 09:06:20 +0100
commit7ae3e985e2a48130e95ae1f8e93268309633cc4c (patch)
tree378d19f3e47fe61baf3ed7a1c7aba3bf7775eff9
parent49765922da9069b2272481d2621fddf54a082f14 (diff)
osmocom_fft: print the exception thrown in DC/IQ correction setters
-rwxr-xr-xapps/osmocom_fft22
1 files changed, 16 insertions, 6 deletions
diff --git a/apps/osmocom_fft b/apps/osmocom_fft
index 3847d1c..5c2d4f2 100755
--- a/apps/osmocom_fft
+++ b/apps/osmocom_fft
@@ -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)