commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11403 - gnuradio/branches/developers/jblum/digital


From: jblum
Subject: [Commit-gnuradio] r11403 - gnuradio/branches/developers/jblum/digital
Date: Thu, 9 Jul 2009 13:34:32 -0600 (MDT)

Author: jblum
Date: 2009-07-09 13:34:32 -0600 (Thu, 09 Jul 2009)
New Revision: 11403

Modified:
   gnuradio/branches/developers/jblum/digital/benchmark_rx.py
   gnuradio/branches/developers/jblum/digital/benchmark_tx.py
   gnuradio/branches/developers/jblum/digital/generic_usrp.py
   gnuradio/branches/developers/jblum/digital/receive_path.py
   gnuradio/branches/developers/jblum/digital/rx_voice.py
   gnuradio/branches/developers/jblum/digital/tunnel.py
   gnuradio/branches/developers/jblum/digital/tx_voice.py
Log:
Added usrp options and usrp create in all of the modules.
These modules used rx and tx path and expected it to have a usrp source/sink.
Options + dummy usrp work, otherwise untested.



Modified: gnuradio/branches/developers/jblum/digital/benchmark_rx.py
===================================================================
--- gnuradio/branches/developers/jblum/digital/benchmark_rx.py  2009-07-09 
19:09:25 UTC (rev 11402)
+++ gnuradio/branches/developers/jblum/digital/benchmark_rx.py  2009-07-09 
19:34:32 UTC (rev 11403)
@@ -124,6 +124,7 @@
         Adds usrp-specific options to the Options Parser
         """
         add_freq_option(normal)
+        usrp_options.add_rx_options(normal)
         normal.add_option("-v", "--verbose", action="store_true", 
default=False)
 
         expert.add_option("", "--rx-freq", type="eng_float", default=None,

Modified: gnuradio/branches/developers/jblum/digital/benchmark_tx.py
===================================================================
--- gnuradio/branches/developers/jblum/digital/benchmark_tx.py  2009-07-09 
19:09:25 UTC (rev 11402)
+++ gnuradio/branches/developers/jblum/digital/benchmark_tx.py  2009-07-09 
19:34:32 UTC (rev 11403)
@@ -124,8 +124,7 @@
         Adds usrp-specific options to the Options Parser
         """
         add_freq_option(normal)
-        normal.add_option("-T", "--tx-subdev-spec", type="subdev", 
default=None,
-                          help="select USRP Tx side A or B")
+        usrp_options.add_tx_options(normal)
         normal.add_option("-v", "--verbose", action="store_true", 
default=False)
 
         expert.add_option("", "--tx-freq", type="eng_float", default=None,
@@ -135,16 +134,6 @@
     # Make a static method to call before instantiation
     add_options = staticmethod(add_options)
 
-    def _print_verbage(self):
-        """
-        Prints information about the transmit path
-        """
-        print "Using TX d'board %s"    % (self.subdev.side_and_name(),)
-        print "modulation:      %s"    % (self._modulator_class.__name__)
-        print "interp:          %3d"   % (self._interp)
-        print "Tx Frequency:    %s"    % 
(eng_notation.num_to_str(self._tx_freq))
-        
-
 def add_freq_option(parser):
     """
     Hackery that has the -f / --freq option set both tx_freq and rx_freq

Modified: gnuradio/branches/developers/jblum/digital/generic_usrp.py
===================================================================
--- gnuradio/branches/developers/jblum/digital/generic_usrp.py  2009-07-09 
19:09:25 UTC (rev 11402)
+++ gnuradio/branches/developers/jblum/digital/generic_usrp.py  2009-07-09 
19:34:32 UTC (rev 11403)
@@ -99,7 +99,7 @@
     def gain_range(self):
         if self._type == USRP1_TYPE: return self._subdev.gain_range()
         elif self._type == USRP2_TYPE: return self._u.gain_range()
-        elif self._type == DUMMY_TYPE: return (0, 0)
+        elif self._type == DUMMY_TYPE: return (0, 0, 0)
 
     def set_center_freq(self, target_freq):
         if self._type == USRP1_TYPE:

Modified: gnuradio/branches/developers/jblum/digital/receive_path.py
===================================================================
--- gnuradio/branches/developers/jblum/digital/receive_path.py  2009-07-09 
19:09:25 UTC (rev 11402)
+++ gnuradio/branches/developers/jblum/digital/receive_path.py  2009-07-09 
19:34:32 UTC (rev 11403)
@@ -118,8 +118,6 @@
         if not normal.has_option("--bitrate"):
             normal.add_option("-r", "--bitrate", type="eng_float", 
default=100e3,
                               help="specify bitrate [default=%default].")
-        normal.add_option("", "--show-rx-gain-range", action="store_true", 
default=False, 
-                          help="print min and max Rx gain available on 
selected daughterboard")
         normal.add_option("-v", "--verbose", action="store_true", 
default=False)
         expert.add_option("-S", "--samples-per-symbol", type="int", default=2,
                           help="set samples/symbol [default=%default]")

Modified: gnuradio/branches/developers/jblum/digital/rx_voice.py
===================================================================
--- gnuradio/branches/developers/jblum/digital/rx_voice.py      2009-07-09 
19:09:25 UTC (rev 11402)
+++ gnuradio/branches/developers/jblum/digital/rx_voice.py      2009-07-09 
19:34:32 UTC (rev 11403)
@@ -26,6 +26,7 @@
 from gnuradio import eng_notation
 from gnuradio.eng_option import eng_option
 from optparse import OptionParser
+import usrp_options
 
 from gnuradio.vocoder import gsm_full_rate
 
@@ -63,7 +64,7 @@
         gr.top_block.__init__(self)
         self.rxpath = receive_path(demod_class, rx_callback, options)
         self.audio_tx = audio_tx(options.audio_output)
-       self.connect(self.rxpath)
+       self.connect(usrp_options.create_usrp_source(options), self.rxpath)
        self.connect(self.audio_tx)        
 
 # /////////////////////////////////////////////////////////////////////////////
@@ -101,7 +102,7 @@
                             % (', '.join(demods.keys()),))
     parser.add_option("-O", "--audio-output", type="string", default="",
                       help="pcm output device name.  E.g., hw:0,0 or /dev/dsp")
-
+    usrp_options.add_rx_options(parser)
     receive_path.add_options(parser, expert_grp)
 
     for mod in demods.values():

Modified: gnuradio/branches/developers/jblum/digital/tunnel.py
===================================================================
--- gnuradio/branches/developers/jblum/digital/tunnel.py        2009-07-09 
19:09:25 UTC (rev 11402)
+++ gnuradio/branches/developers/jblum/digital/tunnel.py        2009-07-09 
19:34:32 UTC (rev 11403)
@@ -38,6 +38,7 @@
 from gnuradio import eng_notation
 from gnuradio.eng_option import eng_option
 from optparse import OptionParser
+import usrp_options
 
 import random
 import time
@@ -93,9 +94,9 @@
         gr.top_block.__init__(self)
         self.txpath = transmit_path(mod_class, options)
         self.rxpath = receive_path(demod_class, rx_callback, options)
-       self.connect(self.txpath);
-       self.connect(self.rxpath);
-       
+        self.connect(self.txpath, usrp_options.create_usrp_sink(options))
+        self.connect(usrp_options.create_usrp_source(options), self.rxpath)
+
     def send_pkt(self, payload='', eof=False):
         return self.txpath.send_pkt(payload, eof)
 
@@ -173,6 +174,21 @@
 #                                   main
 # /////////////////////////////////////////////////////////////////////////////
 
+
+def add_freq_option(parser):
+    """
+    Hackery that has the -f / --freq option set both tx_freq and rx_freq
+    """
+    def freq_callback(option, opt_str, value, parser):
+        parser.values.rx_freq = value
+        parser.values.tx_freq = value
+
+    if not parser.has_option('--freq'):
+        parser.add_option('-f', '--freq', type="eng_float",
+                          action="callback", callback=freq_callback,
+                          help="set Tx and/or Rx frequency to FREQ 
[default=%default]",
+                          metavar="FREQ")
+
 def main():
 
     mods = modulation_utils.type_1_mods()
@@ -180,7 +196,11 @@
 
     parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
     expert_grp = parser.add_option_group("Expert")
-
+    add_freq_option(parser)
+    expert_grp.add_option("", "--rx-freq", type="eng_float", default=None,
+                          help="set Rx frequency to FREQ [default=%default]", 
metavar="FREQ")
+    expert_grp.add_option("", "--tx-freq", type="eng_float", default=None,
+                          help="set transmit frequency to FREQ 
[default=%default]", metavar="FREQ")
     parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
                       default='gmsk',
                       help="Select modulation from: %s [default=%%default]"
@@ -194,6 +214,8 @@
 
     transmit_path.add_options(parser, expert_grp)
     receive_path.add_options(parser, expert_grp)
+    usrp_options.add_rx_options(parser)
+    usrp_options.add_tx_options(parser)
 
     for mod in mods.values():
         mod.add_options(expert_grp)

Modified: gnuradio/branches/developers/jblum/digital/tx_voice.py
===================================================================
--- gnuradio/branches/developers/jblum/digital/tx_voice.py      2009-07-09 
19:09:25 UTC (rev 11402)
+++ gnuradio/branches/developers/jblum/digital/tx_voice.py      2009-07-09 
19:34:32 UTC (rev 11403)
@@ -26,6 +26,7 @@
 from gnuradio import eng_notation
 from gnuradio.eng_option import eng_option
 from optparse import OptionParser
+import usrp_options
 
 from gnuradio.vocoder import gsm_full_rate
 
@@ -66,7 +67,7 @@
         gr.top_block.__init__(self)
         self.txpath = transmit_path(modulator_class, options)
         self.audio_rx = audio_rx(options.audio_input)
-       self.connect(self.txpath)
+       self.connect(self.txpath, usrp_options.create_usrp_sink(options))
        self.connect(self.audio_rx)
 
 
@@ -95,7 +96,7 @@
                       help="set megabytes to transmit [default=inf]")
     parser.add_option("-I", "--audio-input", type="string", default="",
                       help="pcm input device name.  E.g., hw:0,0 or /dev/dsp")
-
+    usrp_options.add_tx_options(parser)
     transmit_path.add_options(parser, expert_grp)
 
     for mod in mods.values():





reply via email to

[Prev in Thread] Current Thread [Next in Thread]