From 7ae3e985e2a48130e95ae1f8e93268309633cc4c Mon Sep 17 00:00:00 2001 From: Dimitri Stolnikov Date: Sat, 11 Jan 2014 09:06:20 +0100 Subject: [PATCH] osmocom_fft: print the exception thrown in DC/IQ correction setters --- apps/osmocom_fft | 22 ++++++++++++++++------ 1 file 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)