[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] need help getting simple exercise to work
From: |
jmdaniel |
Subject: |
[Discuss-gnuradio] need help getting simple exercise to work |
Date: |
Thu, 2 Jun 2005 14:49:49 -0400 |
Hi,
I've got gnuradio up and running and am now trying to get a better
understanding of how to use it before beginning more involved
projects. I am trying to write a py script that displays an oscope
from a PCI-DAS4020/12. mc4020_fft.py runs and displays the
excpected results. Here's the code that I've peiced together.
#!/usr/bin/env python
#
# Copyright 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
from gnuradio import gr
from gnuradio import mc4020
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import stdgui, scopesink
from optparse import OptionParser
import wx
class app_flow_graph (stdgui.gui_flow_graph):
def __init__(self, frame, panel, vbox, argv):
stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
input_rate = 20e6
src = mc4020.source (input_rate, mc4020.MCC_CH3_EN |
mc4020.MCC_ALL_1V)
block, scope_win = scopesink.make_scope_sink_f (self, panel, "Rx
Data", input_rate)
vbox.Add (scope_win, 1, wx.EXPAND)
self.connect (src,block)
def main ():
app = stdgui.stdapp (app_flow_graph, "USRP FFT")
app.MainLoop ()
if __name__ == '__main__':
main ()
and here is what I get when I run it...
Traceback (most recent call last):
File "mc4020_scope.py", line 54, in ?
main ()
File "mc4020_scope.py", line 50, in main
app = stdgui.stdapp (app_flow_graph, "USRP FFT")
File "/usr/local/lib/python2.3/site-packages/gnuradio/wxgui/stdgui.p y",
line 35, in __init__
wx.App.__init__ (self)
File "/usr/lib/python2.3/site-packages/wx-2.6-gtk2-ansi/wx/_core.py" , line
6151, in __init__
self._BootstrapApp()
File "/usr/lib/python2.3/site-packages/wx-2.6-gtk2-ansi/wx/_core.py" , line
5803, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "/usr/local/lib/python2.3/site-packages/gnuradio/wxgui/stdgui.p y",
line 38, in OnInit
frame = stdframe (self.flow_graph_maker, self.title)
File "/usr/local/lib/python2.3/site-packages/gnuradio/wxgui/stdgui.p y",
line 59, in __init__
self.panel = stdpanel (self, self, flow_graph_maker)
File "/usr/local/lib/python2.3/site-packages/gnuradio/wxgui/stdgui.p y",
line 80, in __init__
self.fg = flow_graph_maker (frame, self, vbox, sys.argv)
File "mc4020_scope.py", line 47, in __init__
self.connect (src,block)
File "/usr/local/lib/python2.3/site-packages/gnuradio/gr/basic_flow_
graph.py", line 114, in connect
self._connect (points[i-1], points[i])
File "/usr/local/lib/python2.3/site-packages/gnuradio/gr/basic_flow_
graph.py", line 119, in _connect
self._connect_prim (s, d)
File "/usr/local/lib/python2.3/site-packages/gnuradio/gr/basic_flow_
graph.py", line 127, in _connect_prim
self._check_type_match (src_endpoint, dst_endpoint)
File "/usr/local/lib/python2.3/site-packages/gnuradio/gr/basic_flow_
graph.py", line 238, in _check_type_match
raise ValueError, 'source and destination data sizes are different '
ValueError: source and destination data sizes are different
I would greatly appreciate any help with understanding what is
wrong here and how to fix it.
Thanks.
John Daniel
address@hidden
Virginia Tech
- [Discuss-gnuradio] need help getting simple exercise to work,
jmdaniel <=