~ubuntu-branches/ubuntu/precise/gnuradio/precise

« back to all changes in this revision

Viewing changes to gnuradio-examples/python/multi-antenna/multi_file.py

  • Committer: Bazaar Package Importer
  • Author(s): Kamal Mostafa
  • Date: 2010-03-13 07:46:01 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100313074601-zjsa893a87bozyh7
Tags: 3.2.2.dfsg-1ubuntu1
* Fix build for Ubuntu lucid (LP: #260406)
  - add binary package dep for libusrp0, libusrp2-0: adduser
  - debian/rules clean: remove pre-built Qt moc files

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
from gnuradio import eng_notation
7
7
from gnuradio import optfir
8
8
from optparse import OptionParser
9
 
from gnuradio.wxgui import stdgui, fftsink, waterfallsink, scopesink, form, slider
10
 
import wx
11
 
import usrp_dbid
 
9
from usrpm import usrp_dbid
12
10
import time
13
11
import os.path
14
12
import sys
16
14
# required FPGA that can do 4 rx channels.
17
15
 
18
16
 
19
 
class my_graph(gr.flow_graph):
 
17
class my_graph(gr.top_block):
20
18
 
21
19
    def __init__(self):
22
 
        gr.flow_graph.__init__(self)
 
20
        gr.top_block.__init__(self)
23
21
 
24
22
        parser = OptionParser (option_class=eng_option)
25
23
        #parser.add_option("-S", "--subdev", type="subdev", default=(0, None),
56
54
            sw_decim = 1
57
55
 
58
56
        self.u = usrp.source_c(0, options.decim, fpga_filename="std_4rx_0tx.rbf")
59
 
        if self.u.nddc() < nchan:
 
57
        if self.u.nddcs() < nchan:
60
58
            sys.stderr.write('This code requires an FPGA build with %d DDCs.  This FPGA has only %d.\n' % (
61
 
                nchan, self.u.nddc()))
 
59
                nchan, self.u.nddcs()))
62
60
            raise SystemExit
63
61
                             
64
62
        if not self.u.set_nchannels(nchan):
70
68
        sink_data_rate = input_rate/sw_decim
71
69
        print "Scope data rate = %s" % (eng_notation.num_to_str(sink_data_rate),)
72
70
 
73
 
        self.subdev = self.u.db[0] + self.u.db[1]
 
71
        self.subdev = self.u.db(0) + self.u.db(1)
74
72
 
75
 
        if (len(self.subdev) != 4 or
76
 
            self.u.db[0][0].dbid() != usrp_dbid.BASIC_RX or
77
 
            self.u.db[1][0].dbid() != usrp_dbid.BASIC_RX):
 
73
        if (len(self.subdev) < 4 or
 
74
            self.u.db(0, 0).dbid() != usrp_dbid.BASIC_RX or
 
75
            self.u.db(1, 0).dbid() != usrp_dbid.BASIC_RX):
78
76
            sys.stderr.write('This code requires a Basic Rx board on Sides A & B\n')
79
77
            sys.exit(1)
80
78