diff options
author | Nicholas Corgan | 2012-04-05 11:29:31 -0700 |
---|---|---|
committer | Nicholas Corgan | 2012-04-05 11:29:31 -0700 |
commit | a69f26230680fa177c53cf75a3a5c6f469b8afb3 (patch) | |
tree | 7b79cfcfc9e48b592d2f560abf375ab0de4b5214 /gr-uhd | |
parent | 11d61c53c7ea781f474c6e34155139b0b2bb0df6 (diff) | |
download | gnuradio-a69f26230680fa177c53cf75a3a5c6f469b8afb3.tar.gz gnuradio-a69f26230680fa177c53cf75a3a5c6f469b8afb3.tar.bz2 gnuradio-a69f26230680fa177c53cf75a3a5c6f469b8afb3.zip |
gr-uhd: uhd_fft and uhd_siggen account for cases where mboard/dboard has no serial
Diffstat (limited to 'gr-uhd')
-rwxr-xr-x | gr-uhd/apps/uhd_fft.py | 14 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_siggen.py | 24 |
2 files changed, 26 insertions, 12 deletions
diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft.py index 5637c24a7..2f2b0ebfa 100755 --- a/gr-uhd/apps/uhd_fft.py +++ b/gr-uhd/apps/uhd_fft.py @@ -197,8 +197,18 @@ class app_top_block(stdgui2.std_top_block): callback=self.set_gain) try: - usrp_config_val = "%s (%s), %s (%s, %s, %s)" % (self.u.get_usrp_info().get("mboard_id").split(" ")[0], self.u.get_usrp_info().get("mboard_serial"), - self.u.get_usrp_info().get("rx_id").split(" ")[0].split(",")[0], self.u.get_usrp_info().get("rx_serial"), self.u.get_subdev_spec(), self.u.get_antenna()) + mboard_id = self.u.get_usrp_info().get("mboard_id").split(" ")[0] + mboard_serial = self.u.get_usrp_info().get("mboard_serial") + if mboard_serial == "": + mboard_serial = "no serial" + dboard_id = self.u.get_usrp_info().get("rx_id").split(" ")[0].split(",")[0] + dboard_serial = self.u.get_usrp_info().get("rx_serial") + if dboard_serial == "": + dboard_serial = "no serial" + subdev = self.u.get_subdev_spec() + antenna = self.u.get_antenna() + + usrp_config_val = "%s (%s), %s (%s, %s, %s)" % (mboard_id, mboard_serial, dboard_id, dboard_serial, subdev, antenna) except: usrp_config_val = "Not implemented in this version." diff --git a/gr-uhd/apps/uhd_siggen.py b/gr-uhd/apps/uhd_siggen.py index 095b7dcf0..add8d1bf3 100755 --- a/gr-uhd/apps/uhd_siggen.py +++ b/gr-uhd/apps/uhd_siggen.py @@ -110,17 +110,21 @@ class top_block(gr.top_block, pubsub): # Setup USRP Configuration value try: usrp_info = self._u.get_usrp_info() - usrp_mb = usrp_info.get("mboard_id").split(" ")[0] - usrp_mbs = usrp_info.get("mboard_serial") - usrp_db = usrp_info.get("tx_id").split(" ")[0] - usrp_dbs = usrp_info.get("tx_serial") - usrp_sd = self._u.get_subdev_spec() - usrp_ant = self._u.get_antenna() + mboard_id = usrp_info.get("mboard_id").split(" ")[0] + mboard_serial = usrp_info.get("mboard_serial") + if mboard_serial == "": + mboard_serial = "no serial" + dboard_id = usrp_info.get("tx_id").split(" ")[0].split(",")[0] + dboard_serial = usrp_info.get("tx_serial") + if dboard_serial == "": + dboard_serial = "no serial" + subdev = self._u.get_subdev_spec() + antenna = self._u.get_antenna() - desc_key_str = "Motherboard: %s [%s]\n" % (usrp_mb, usrp_mbs) - desc_key_str += "Daughterboard: %s [%s]\n" % (usrp_db, usrp_dbs) - desc_key_str += "Subdev: %s\n" % usrp_sd - desc_key_str += "Antenna: %s" % usrp_ant + desc_key_str = "Motherboard: %s [%s]\n" % (mboard_id, mboard_serial) + desc_key_str += "Daughterboard: %s [%s]\n" % (dboard_id, dboard_serial) + desc_key_str += "Subdev: %s\n" % subdev + desc_key_str += "Antenna: %s" % antenna except: desc_key_str = "USRP configuration output not implemented in this version" |