diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-08-17 13:06:42 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-08-17 16:23:46 -0500 |
commit | 86ab211b84c132e61becc294acfff87e1751908d (patch) | |
tree | c718f49652434f1c5dedb4aafc90b2816392b198 /host/python | |
parent | b9f9ca2d0fd43f2a55e4ed5301070585cbb1be3c (diff) | |
download | uhd-86ab211b84c132e61becc294acfff87e1751908d.tar.gz uhd-86ab211b84c132e61becc294acfff87e1751908d.tar.bz2 uhd-86ab211b84c132e61becc294acfff87e1751908d.zip |
python: power cal: Minor fixes to power cal code
- Fix some typos
- Fix incorrect arg name for RFSGPowerGenerator.enable()
- Fix case where incorrect args would cause an uncaught TypeError. Now,
if USRP is chose as signal generator, but fails to find one, a proper
error is shown.
Diffstat (limited to 'host/python')
-rw-r--r-- | host/python/uhd/usrp/cal/meas_device.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/host/python/uhd/usrp/cal/meas_device.py b/host/python/uhd/usrp/cal/meas_device.py index 15c82e55f..913096a95 100644 --- a/host/python/uhd/usrp/cal/meas_device.py +++ b/host/python/uhd/usrp/cal/meas_device.py @@ -281,7 +281,11 @@ class USRPPowerGenerator(SignalGeneratorBase): def __init__(self, options): super().__init__(options) - self._usrp = uhd.usrp.MultiUSRP(options.get('args')) + usrp_args = options.get('args') + if not usrp_args: + raise RuntimeError( + "Must specify args for USRP measurement device!") + self._usrp = uhd.usrp.MultiUSRP(usrp_args) self._rate = float(options.get('rate', 5e6)) self._lo_offset = float(options.get('lo_offset', 0)) self._chan = int(options.get('chan', 0)) @@ -305,7 +309,7 @@ class USRPPowerGenerator(SignalGeneratorBase): else: print("[SigGen] Stopping tone generator.") self._tone_gen.stop() - time.sleep(0.1) # Give it some time to spin or down + time.sleep(0.1) # Give it some time to spin down def set_frequency(self, freq): """ @@ -342,11 +346,11 @@ class RFSGPowerGenerator(SignalGeneratorBase): super().__init__(options) self.device = RFSGDevice(options) - def enable(self, enb=True): + def enable(self, enable=True): """ Turn tone generation on and off """ - self.device.enable(enb) + self.device.enable(enable) def set_frequency(self, freq): """ |