diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2016-10-13 14:42:43 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2016-10-13 14:42:43 -0700 |
commit | 15a8a39c9acb1eca7ed2fb29868eaaa1e1e3d5a9 (patch) | |
tree | a607cd746c89c0d62a0e50d9824d302c84017fca | |
parent | 1c584bff478c0699658ef8435aeef127468dbf40 (diff) | |
parent | 9f1b59586e7e8991d3648a3a2965d59bb32e6d6d (diff) |
Merge remote-tracking branch 'mbr0wn/uhd/uhd_fft_multi_spec'
-rw-r--r-- | gr-uhd/apps/uhd_app.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gr-uhd/apps/uhd_app.py b/gr-uhd/apps/uhd_app.py index 652a9fbab6..8e377f0b4d 100644 --- a/gr-uhd/apps/uhd_app.py +++ b/gr-uhd/apps/uhd_app.py @@ -121,6 +121,20 @@ class UHDApp(object): antennas = [antennas[0],] * len(args.channels) return antennas + def normalize_subdev_sel(self, spec): + """ + """ + if spec is None: + return None + specs = [x.strip() for x in spec.split(",")] + if len(specs) == 1: + return spec + elif len(specs) != self.usrp.get_num_mboards(): + raise ValueError("Invalid subdev setting for {n} mboards: {a}".format( + n=len(self.usrp.get_num_mboards()), a=spec + )) + return specs + def async_callback(self, msg): """ Call this when USRP async metadata needs printing. @@ -151,9 +165,13 @@ class UHDApp(object): ) ) # Set the subdevice spec: + args.spec = self.normalize_subdev_sel(args.spec) if args.spec: for mb_idx in xrange(self.usrp.get_num_mboards()): - self.usrp.set_subdev_spec(args.spec, mb_idx) + if isinstance(args.spec, list): + self.usrp.set_subdev_spec(args.spec[mb_idx], mb_idx) + else: + self.usrp.set_subdev_spec(args.spec, mb_idx) # Set the clock and/or time source: if args.clock_source is not None: for mb_idx in xrange(self.usrp.get_num_mboards()): @@ -298,8 +316,8 @@ class UHDApp(object): tx_or_rx = tx_or_rx.strip() + " " group = parser.add_argument_group('USRP Arguments') group.add_argument("-a", "--args", default="", help="UHD device address args") - group.add_argument("--spec", help="Subdevice of UHD device where appropriate") - group.add_argument("-A", "--antenna", help="Select {xx}Antenna(s) where appropriate".format(xx=tx_or_rx)) + group.add_argument("--spec", help="Subdevice(s) of UHD device where appropriate. Use a comma-separated list to set different boards to different specs.") + group.add_argument("-A", "--antenna", help="Select {xx}antenna(s) where appropriate".format(xx=tx_or_rx)) group.add_argument("-s", "--samp-rate", type=eng_arg.eng_float, default=1e6, help="Sample rate") group.add_argument("-g", "--gain", type=eng_arg.eng_float, default=None, |