diff options
author | Lars Amsel <lars.amsel@ni.com> | 2020-05-23 14:16:34 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-06-17 14:19:26 -0500 |
commit | eeae393ad4b1c0546922eab3c4decb39e5e69f4b (patch) | |
tree | 4f5cd1f40be83caf455c915a7fb61081f0761674 /host/utils | |
parent | 675bec3e3837c09bd10cdf309a1a3b556d94bd0d (diff) | |
download | uhd-eeae393ad4b1c0546922eab3c4decb39e5e69f4b.tar.gz uhd-eeae393ad4b1c0546922eab3c4decb39e5e69f4b.tar.bz2 uhd-eeae393ad4b1c0546922eab3c4decb39e5e69f4b.zip |
cal: Add automated port switch
Current implementation needed manual interaction to calibrate each
antenna. More sophisticated setups are able to switch between channels
and antennas programmatically.
This commit introduces a base class that handle the switch behaviour. The
previous implementation moved to a ManualSwitch class which is the
default switch. Without any options the previous flow remains unchanged.
A new class is able to handle NI switch models. The switch port can
be given via options parameter (comA is default). The channels are connected
in ascending order. The user has to ensure that the cable setup matches
the order given for channels and antennas.
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Diffstat (limited to 'host/utils')
-rw-r--r-- | host/utils/uhd_power_cal.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/host/utils/uhd_power_cal.py b/host/utils/uhd_power_cal.py index b71e8f3ab..c598c1058 100644 --- a/host/utils/uhd_power_cal.py +++ b/host/utils/uhd_power_cal.py @@ -84,6 +84,12 @@ def parse_args(): '-o', '--meas-option', default=[], action='append', help='Options that are passed to the measurement device') parser.add_argument( + '--switch', default='manual', + help='Type of switch to be used to connect antennas') + parser.add_argument( + '--switch-option', default=[], action='append', + help='Options that are passed to the switch') + parser.add_argument( '-r', '--rate', type=float, help='Sampling rate at which the calibration is performed') parser.add_argument( @@ -194,6 +200,8 @@ def main(): # not transmitting at full scale if args.dir == 'tx': meas_dev.power_offset -= 20 * math.log10(args.amplitude) + print("=== Initializing port connector...") + switch = uhd.usrp.cal.get_switch(args.dir, args.switch, args.switch_option) print("=== Initializing USRP calibration object...") usrp_cal = uhd.usrp.cal.get_usrp_calibrator( usrp, meas_dev, args.dir, @@ -220,7 +228,7 @@ def main(): .format(chan, ant)) # Set up all the objects getattr(usrp, 'set_{}_antenna'.format(args.dir))(ant, chan) - meas_dev.update_port(chan, ant) + switch.connect(chan, ant) usrp_cal.update_port(chan, ant) freqs = usrp_cal.init_frequencies(args.start, args.stop, args.step) usrp_cal.start() # This will activate siggen |