summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--grc/data/platforms/python/blocks/Makefile.am2
-rw-r--r--grc/data/platforms/python/blocks/usrp_diagnostics.xml54
-rw-r--r--grc/data/platforms/python/blocks/usrp_probe.xml39
-rw-r--r--grc/freedesktop/Makefile.am2
-rw-r--r--grc/freedesktop/gnuradio-usrp_probe.desktop (renamed from grc/freedesktop/gnuradio-usrp_diagnostics.desktop)4
-rw-r--r--grc/freedesktop/grc_setup_freedesktop.in4
-rw-r--r--grc/scripts/Makefile.am2
-rwxr-xr-xgrc/scripts/usrp_probe (renamed from grc/scripts/usrp_diagnostics)45
8 files changed, 68 insertions, 84 deletions
diff --git a/grc/data/platforms/python/blocks/Makefile.am b/grc/data/platforms/python/blocks/Makefile.am
index 7938e7684..badc6dc97 100644
--- a/grc/data/platforms/python/blocks/Makefile.am
+++ b/grc/data/platforms/python/blocks/Makefile.am
@@ -192,9 +192,9 @@ dist_ourdata_DATA = \
trellis_siso_f.xml \
trellis_viterbi_combined_xx.xml \
trellis_viterbi_x.xml \
- usrp_diagnostics.xml \
usrp_dual_sink_x.xml \
usrp_dual_source_x.xml \
+ usrp_probe.xml \
usrp_simple_sink_x.xml \
usrp_simple_source_x.xml \
usrp2_sink_xxxx.xml \
diff --git a/grc/data/platforms/python/blocks/usrp_diagnostics.xml b/grc/data/platforms/python/blocks/usrp_diagnostics.xml
deleted file mode 100644
index 52dd885a4..000000000
--- a/grc/data/platforms/python/blocks/usrp_diagnostics.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##USRP Diagnostics:
-## This block should not appear in the tree.
-###################################################
- -->
-<block>
- <name>USRP Diagnostics</name>
- <key>usrp_diagnostics</key>
- <make></make>
- <param>
- <name>USRP Number</name>
- <key>usrp_number</key>
- <value>0</value>
- <type>int</type>
- </param>
- <param>
- <name>USRP Type</name>
- <key>usrp_type</key>
- <value>rx</value>
- <type>enum</type>
- <option>
- <name>Receive</name>
- <key>rx</key>
- </option>
- <option>
- <name>Transmit</name>
- <key>tx</key>
- </option>
- </param>
- <param>
- <name>Side:Subdevice</name>
- <key>side_subdev</key>
- <value>(0, 0)</value>
- <type>enum</type>
- <option>
- <name>Side A:0</name>
- <key>(0, 0)</key>
- </option>
- <option>
- <name>Side B:0</name>
- <key>(1, 0)</key>
- </option>
- <option>
- <name>Side A:1</name>
- <key>(0, 1)</key>
- </option>
- <option>
- <name>Side B:0</name>
- <key>(1, 1)</key>
- </option>
- </param>
-</block>
diff --git a/grc/data/platforms/python/blocks/usrp_probe.xml b/grc/data/platforms/python/blocks/usrp_probe.xml
new file mode 100644
index 000000000..11a83584c
--- /dev/null
+++ b/grc/data/platforms/python/blocks/usrp_probe.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##USRP Probe:
+## This block should not appear in the tree.
+###################################################
+ -->
+<block>
+ <name>USRP Probe</name>
+ <key>usrp_probe</key>
+ <make></make>
+ <param>
+ <name>USRP Number</name>
+ <key>number</key>
+ <value>0</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Daughter Board</name>
+ <key>dboard</key>
+ <type>enum</type>
+ <option>
+ <name>RX A</name>
+ <key>rx_a</key>
+ </option>
+ <option>
+ <name>RX B</name>
+ <key>rx_b</key>
+ </option>
+ <option>
+ <name>TX A</name>
+ <key>tx_a</key>
+ </option>
+ <option>
+ <name>TX B</name>
+ <key>tx_b</key>
+ </option>
+ </param>
+</block>
diff --git a/grc/freedesktop/Makefile.am b/grc/freedesktop/Makefile.am
index b8e084d86..36a88de75 100644
--- a/grc/freedesktop/Makefile.am
+++ b/grc/freedesktop/Makefile.am
@@ -31,7 +31,7 @@ dist_ourdata_DATA = \
grc-icon-32.png \
gnuradio-grc.xml \
gnuradio-grc.desktop \
- gnuradio-usrp_diagnostics.desktop
+ gnuradio-usrp_probe.desktop
dist_bin_SCRIPTS = grc_setup_freedesktop
diff --git a/grc/freedesktop/gnuradio-usrp_diagnostics.desktop b/grc/freedesktop/gnuradio-usrp_probe.desktop
index 9a5000bb7..136321994 100644
--- a/grc/freedesktop/gnuradio-usrp_diagnostics.desktop
+++ b/grc/freedesktop/gnuradio-usrp_probe.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Version=1.0
Type=Application
-Name=USRP Diagnostics
-Exec=usrp_diagnostics
+Name=USRP Probe
+Exec=usrp_probe
Categories=Development;
Icon=gnuradio-grc
diff --git a/grc/freedesktop/grc_setup_freedesktop.in b/grc/freedesktop/grc_setup_freedesktop.in
index 526cc27e4..2714356a2 100644
--- a/grc/freedesktop/grc_setup_freedesktop.in
+++ b/grc/freedesktop/grc_setup_freedesktop.in
@@ -28,7 +28,7 @@ case "$1" in
xdg-mime install ${SRCDIR}/gnuradio-grc.xml
echo "Install menu items"
xdg-desktop-menu install ${SRCDIR}/gnuradio-grc.desktop
- xdg-desktop-menu install ${SRCDIR}/gnuradio-usrp_diagnostics.desktop
+ xdg-desktop-menu install ${SRCDIR}/gnuradio-usrp_probe.desktop
echo "Done!"
echo ""
;;
@@ -45,7 +45,7 @@ case "$1" in
xdg-mime uninstall ${SRCDIR}/gnuradio-grc.xml
echo "Uninstall menu items"
xdg-desktop-menu uninstall gnuradio-grc.desktop
- xdg-desktop-menu uninstall gnuradio-usrp_diagnostics.desktop
+ xdg-desktop-menu uninstall gnuradio-usrp_probe.desktop
echo "Done!"
echo ""
;;
diff --git a/grc/scripts/Makefile.am b/grc/scripts/Makefile.am
index d3c08eb70..27ffabc53 100644
--- a/grc/scripts/Makefile.am
+++ b/grc/scripts/Makefile.am
@@ -21,4 +21,4 @@
include $(top_srcdir)/grc/Makefile.inc
-dist_bin_SCRIPTS = grc usrp_diagnostics
+dist_bin_SCRIPTS = grc usrp_probe
diff --git a/grc/scripts/usrp_diagnostics b/grc/scripts/usrp_probe
index b8e316399..eab57677d 100755
--- a/grc/scripts/usrp_diagnostics
+++ b/grc/scripts/usrp_probe
@@ -28,20 +28,19 @@ import gtk
from gnuradio.grc.gui.Dialogs import TextDisplay
from gnuradio.grc.platforms.python.Platform import Platform
-platform = Platform(block_paths_internal_only=['usrp_diagnostics.xml'])
+platform = Platform(block_paths_internal_only=['usrp_probe.xml'])
from gnuradio.grc.platforms.gui.Platform import Platform
platform = Platform(platform)
flow_graph = platform.get_new_flow_graph()
-block = flow_graph.get_new_block('usrp_diagnostics')
+block = flow_graph.get_new_block('usrp_probe')
##all params
-usrp_number_param = block.get_param('usrp_number')
-usrp_type_param = block.get_param('usrp_type')
-side_subdev_param = block.get_param('side_subdev')
+usrp_number_param = block.get_param('number')
+usrp_dboard_param = block.get_param('dboard')
-class USRPDiagnosticsWindow(gtk.Window):
+class USRPProbeWindow(gtk.Window):
"""
The main window for USRP Dignostics.
"""
@@ -52,7 +51,7 @@ class USRPDiagnosticsWindow(gtk.Window):
def __init__(self):
"""
- USRPDiagnosticsWindow contructor.
+ USRPProbeWindow contructor.
Create a new gtk Dialog with a close button, USRP input paramaters, and output labels.
"""
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
@@ -60,7 +59,7 @@ class USRPDiagnosticsWindow(gtk.Window):
self.connect("delete_event", self.delete_event)
self.connect("destroy", self.destroy)
#set the title
- self.set_title('USRP Diagnostics')
+ self.set_title('USRP Probe')
#create decorative frame
frame = gtk.Frame()
self.add(frame)
@@ -68,31 +67,31 @@ class USRPDiagnosticsWindow(gtk.Window):
vbox = gtk.VBox()
frame.add(vbox)
vbox.pack_start(usrp_number_param.get_input_object(), False)
- vbox.pack_start(usrp_type_param.get_input_object(), False)
- vbox.pack_start(side_subdev_param.get_input_object(), False)
- self.diagnose_button = gtk.Button('Query')
- self.diagnose_button.connect('clicked', self._diagnose_usrp)
+ vbox.pack_start(usrp_dboard_param.get_input_object(), False)
+ self.diagnose_button = gtk.Button('Probe')
+ self.diagnose_button.connect('clicked', self._probe_usrp)
vbox.pack_start(self.diagnose_button, False)
#Create a text box for USRP queries
self.query_buffer = TextDisplay()
- self.query_buffer.set_text('Press "Query" to retrieve USRP information...')
+ self.query_buffer.set_text('Press "Probe" to retrieve USRP information...')
vbox.pack_start(self.query_buffer)
self.show_all()
- def _diagnose_usrp(self, widget=None):
- """Query the USRP device and copy the results into the query text box."""
- type = usrp_type_param.evaluate()
- if type == 'rx': #for the rx query, use the source and rx methods
+ def _probe_usrp(self, widget=None):
+ """Probe the USRP device and copy the results into the query text box."""
+ dboard = usrp_dboard_param.evaluate()
+ side = {'a': 0, 'b': 1}[dboard[-1]]
+ if dboard.startswith('rx'): #for the rx query, use the source and rx methods
make = usrp.source_c
get_mux = usrp.determine_rx_mux_value
- elif type == 'tx': #for the tx query, use the sink and tx methods
+ elif dboard.startswith('tx'): #for the tx query, use the sink and tx methods
make = usrp.sink_c
get_mux = usrp.determine_tx_mux_value
try:
u = make(usrp_number_param.evaluate())
- subdev_spec = eval(side_subdev_param.evaluate())
- subdev = usrp.selected_subdev(u, subdev_spec)#get the subdev
- msg = ">>> USRP Query\n"
+ subdev_spec = (side, 0)
+ subdev = usrp.selected_subdev(u, subdev_spec) #get the subdev
+ msg = ">>> USRP Probe\n"
msg = "%s\nName:\n\t%s\n"%(msg, str(subdev.name()))
msg = "%s\nAutomated Mux:\n\t0x%08x\n"%(msg, 0xFFFFFFFFL & long(get_mux(u, subdev_spec))) #ensure that the value is displayed as: 8 nibbles, unsigned, hex
msg = "%s\nConverter Rate:\n\t%s\n"%(msg, u.converter_rate())
@@ -102,7 +101,7 @@ class USRPDiagnosticsWindow(gtk.Window):
freq_min, freq_max, freq_step = subdev.freq_range()
msg = "%s\nFreq Range (min, max, step size):\n\t%s\n\t%s\n\t%s\n"%(msg, freq_min, freq_max, freq_step)
self.query_buffer.set_text(msg)
- except Exception, e: #display the error message
+ except Exception, e: #display the error message
self.query_buffer.set_text('''\
>>> Error\n%s
@@ -113,6 +112,6 @@ If the problem persists, there may be a problem with you gnuradio installation o
#enter the mainloop
gtk.gdk.threads_init()
gtk.gdk.threads_enter()
-USRPDiagnosticsWindow()
+USRPProbeWindow()
gtk.main()
gtk.gdk.threads_leave()