[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10264 - in gnuradio/trunk/grc: data/platforms/python/
From: |
jblum |
Subject: |
[Commit-gnuradio] r10264 - in gnuradio/trunk/grc: data/platforms/python/blocks freedesktop scripts |
Date: |
Mon, 19 Jan 2009 21:59:14 -0700 (MST) |
Author: jblum
Date: 2009-01-19 21:59:13 -0700 (Mon, 19 Jan 2009)
New Revision: 10264
Added:
gnuradio/trunk/grc/data/platforms/python/blocks/usrp_probe.xml
gnuradio/trunk/grc/freedesktop/gnuradio-usrp_probe.desktop
gnuradio/trunk/grc/scripts/usrp_probe
Removed:
gnuradio/trunk/grc/data/platforms/python/blocks/usrp_diagnostics.xml
gnuradio/trunk/grc/freedesktop/gnuradio-usrp_diagnostics.desktop
gnuradio/trunk/grc/scripts/usrp_diagnostics
Modified:
gnuradio/trunk/grc/data/platforms/python/blocks/Makefile.am
gnuradio/trunk/grc/freedesktop/Makefile.am
gnuradio/trunk/grc/freedesktop/grc_setup_freedesktop.in
gnuradio/trunk/grc/scripts/Makefile.am
Log:
call it probe
Modified: gnuradio/trunk/grc/data/platforms/python/blocks/Makefile.am
===================================================================
--- gnuradio/trunk/grc/data/platforms/python/blocks/Makefile.am 2009-01-19
22:58:08 UTC (rev 10263)
+++ gnuradio/trunk/grc/data/platforms/python/blocks/Makefile.am 2009-01-20
04:59:13 UTC (rev 10264)
@@ -192,9 +192,9 @@
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 \
Deleted: gnuradio/trunk/grc/data/platforms/python/blocks/usrp_diagnostics.xml
Copied: gnuradio/trunk/grc/data/platforms/python/blocks/usrp_probe.xml (from
rev 10260, gnuradio/trunk/grc/data/platforms/python/blocks/usrp_diagnostics.xml)
===================================================================
--- gnuradio/trunk/grc/data/platforms/python/blocks/usrp_probe.xml
(rev 0)
+++ gnuradio/trunk/grc/data/platforms/python/blocks/usrp_probe.xml
2009-01-20 04:59:13 UTC (rev 10264)
@@ -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>
Property changes on:
gnuradio/trunk/grc/data/platforms/python/blocks/usrp_probe.xml
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: gnuradio/trunk/grc/freedesktop/Makefile.am
===================================================================
--- gnuradio/trunk/grc/freedesktop/Makefile.am 2009-01-19 22:58:08 UTC (rev
10263)
+++ gnuradio/trunk/grc/freedesktop/Makefile.am 2009-01-20 04:59:13 UTC (rev
10264)
@@ -31,7 +31,7 @@
grc-icon-32.png \
gnuradio-grc.xml \
gnuradio-grc.desktop \
- gnuradio-usrp_diagnostics.desktop
+ gnuradio-usrp_probe.desktop
dist_bin_SCRIPTS = grc_setup_freedesktop
Deleted: gnuradio/trunk/grc/freedesktop/gnuradio-usrp_diagnostics.desktop
Copied: gnuradio/trunk/grc/freedesktop/gnuradio-usrp_probe.desktop (from rev
10260, gnuradio/trunk/grc/freedesktop/gnuradio-usrp_diagnostics.desktop)
===================================================================
--- gnuradio/trunk/grc/freedesktop/gnuradio-usrp_probe.desktop
(rev 0)
+++ gnuradio/trunk/grc/freedesktop/gnuradio-usrp_probe.desktop 2009-01-20
04:59:13 UTC (rev 10264)
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=USRP Probe
+Exec=usrp_probe
+Categories=Development;
+Icon=gnuradio-grc
Property changes on: gnuradio/trunk/grc/freedesktop/gnuradio-usrp_probe.desktop
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: gnuradio/trunk/grc/freedesktop/grc_setup_freedesktop.in
===================================================================
--- gnuradio/trunk/grc/freedesktop/grc_setup_freedesktop.in 2009-01-19
22:58:08 UTC (rev 10263)
+++ gnuradio/trunk/grc/freedesktop/grc_setup_freedesktop.in 2009-01-20
04:59:13 UTC (rev 10264)
@@ -28,7 +28,7 @@
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 @@
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 ""
;;
Modified: gnuradio/trunk/grc/scripts/Makefile.am
===================================================================
--- gnuradio/trunk/grc/scripts/Makefile.am 2009-01-19 22:58:08 UTC (rev
10263)
+++ gnuradio/trunk/grc/scripts/Makefile.am 2009-01-20 04:59:13 UTC (rev
10264)
@@ -21,4 +21,4 @@
include $(top_srcdir)/grc/Makefile.inc
-dist_bin_SCRIPTS = grc usrp_diagnostics
+dist_bin_SCRIPTS = grc usrp_probe
Deleted: gnuradio/trunk/grc/scripts/usrp_diagnostics
Copied: gnuradio/trunk/grc/scripts/usrp_probe (from rev 10260,
gnuradio/trunk/grc/scripts/usrp_diagnostics)
===================================================================
--- gnuradio/trunk/grc/scripts/usrp_probe (rev 0)
+++ gnuradio/trunk/grc/scripts/usrp_probe 2009-01-20 04:59:13 UTC (rev
10264)
@@ -0,0 +1,117 @@
+#!/usr/bin/env python
+"""
+Copyright 2008 Free Software Foundation, Inc.
+This file is part of GNU Radio
+
+GNU Radio Companion is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+GNU Radio Companion is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+"""
+
+from gnuradio import usrp
+import os
+
+import pygtk
+pygtk.require('2.0')
+import gtk
+
+from gnuradio.grc.gui.Dialogs import TextDisplay
+
+from gnuradio.grc.platforms.python.Platform import Platform
+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_probe')
+
+##all params
+usrp_number_param = block.get_param('number')
+usrp_dboard_param = block.get_param('dboard')
+
+class USRPProbeWindow(gtk.Window):
+ """
+ The main window for USRP Dignostics.
+ """
+
+ def delete_event(self, widget, event, data=None): return False
+
+ def destroy(self, widget, data=None): gtk.main_quit()
+
+ def __init__(self):
+ """
+ USRPProbeWindow contructor.
+ Create a new gtk Dialog with a close button, USRP input
paramaters, and output labels.
+ """
+ gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
+ #quit signals
+ self.connect("delete_event", self.delete_event)
+ self.connect("destroy", self.destroy)
+ #set the title
+ self.set_title('USRP Probe')
+ #create decorative frame
+ frame = gtk.Frame()
+ self.add(frame)
+ #create vbox for storage
+ vbox = gtk.VBox()
+ frame.add(vbox)
+ vbox.pack_start(usrp_number_param.get_input_object(), False)
+ 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 "Probe" to retrieve USRP
information...')
+ vbox.pack_start(self.query_buffer)
+ self.show_all()
+
+ 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 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 = (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())
+ msg = "%s\nUses Quadrature:\n\t%s\n"%(msg,
str(subdev.is_quadrature()))
+ gain_min, gain_max, gain_step = subdev.gain_range()
+ msg = "%s\nGain Range (min, max, step
size):\n\t%s\n\t%s\n\t%s\n"%(msg, gain_min, gain_max, gain_step)
+ 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
+ self.query_buffer.set_text('''\
+>>> Error\n%s
+
+If the USRP cannot be found, make sure that the USRP is plugged-in and restart
this program. \
+If the problem persists, there may be a problem with you gnuradio installation
or USB 2.0.
+'''%str(e))
+
+#enter the mainloop
+gtk.gdk.threads_init()
+gtk.gdk.threads_enter()
+USRPProbeWindow()
+gtk.main()
+gtk.gdk.threads_leave()
Property changes on: gnuradio/trunk/grc/scripts/usrp_probe
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mergeinfo
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10264 - in gnuradio/trunk/grc: data/platforms/python/blocks freedesktop scripts,
jblum <=