diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2017-06-22 18:02:20 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2017-06-22 18:02:20 -0700 |
commit | 1e02521a72304f898b3523148f35038f53bbb056 (patch) | |
tree | 3d5ea9b14603cf9b1875327a1915bad345b83bde /gr-uhd | |
parent | b63e8cf03236257730680adfd75378daf3f5c153 (diff) | |
parent | 99ee660ce3701a33efa1737ae341e5360661f900 (diff) |
Merge branch 'next' into python3
Conflicts:
gr-uhd/apps/uhd_app.py
Diffstat (limited to 'gr-uhd')
-rw-r--r-- | gr-uhd/apps/uhd_app.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/gr-uhd/apps/uhd_app.py b/gr-uhd/apps/uhd_app.py index a238ebcf4c..5a8290fe52 100644 --- a/gr-uhd/apps/uhd_app.py +++ b/gr-uhd/apps/uhd_app.py @@ -123,6 +123,8 @@ class UHDApp(object): if arg is None: return None args = [x.strip() for x in arg.split(",")] + if len(args) == 1: + args = args * num if len(args) != num: raise ValueError("Invalid {m} setting for {n} {b}: {a}".format( m=arg_name, n=num, a=arg, b=num_name @@ -164,27 +166,18 @@ class UHDApp(object): self.usrp.get_num_mboards(), args.spec) if self.spec: for mb_idx in range(self.usrp.get_num_mboards()): - if len(self.spec) == 1: - self.usrp.set_subdev_spec(self.spec, mb_idx) - else: - self.usrp.set_subdev_spec(self.spec[mb_idx], mb_idx) + self.usrp.set_subdev_spec(self.spec[mb_idx], mb_idx) # Set the clock and/or time source: if args.clock_source is not None: self.clock_source = self.normalize_sel("mboards", "clock-source", self.usrp.get_num_mboards(), args.clock_source) for mb_idx in range(self.usrp.get_num_mboards()): - if len(self.clock_source) == 1: - self.usrp.set_clock_source(self.clock_source[0], mb_idx) - else: - self.usrp.set_clock_source(self.clock_source[mb_idx], mb_idx) + self.usrp.set_clock_source(self.clock_source[mb_idx], mb_idx) if args.time_source is not None: self.time_source = self.normalize_sel("mboards", "time-source", self.usrp.get_num_mboards(), args.time_source) for mb_idx in range(self.usrp.get_num_mboards()): - if len(self.time_source) == 1: - self.usrp.set_time_source(self.time_source[0], mb_idx) - else: - self.usrp.set_time_source(self.time_source[mb_idx], mb_idx) + self.usrp.set_time_source(self.time_source[mb_idx], mb_idx) # Sampling rate: self.usrp.set_samp_rate(args.samp_rate) self.samp_rate = self.usrp.get_samp_rate() @@ -192,8 +185,6 @@ class UHDApp(object): # Set the antenna: self.antenna = self.normalize_sel("channels", "antenna", len(args.channels), args.antenna) if self.antenna is not None: - if len(self.antenna) == 1: - self.antenna = self.antenna * len(args.channels) for i, chan in enumerate(self.channels): if not self.antenna[i] in self.usrp.get_antennas(i): print("[ERROR] {} is not a valid antenna name for this USRP device!".format(self.antenna[i])) |