Re: [Discuss-gnuradio] coerce endpoint - hier block API question with code

2011-08-08 Thread Martin Braun
On Sat, Aug 06, 2011 at 10:08:19PM +0200, Marius wrote:
 Hi!
 
 I'm creating an integration for the current GNU Radio = 3.4 tree
 upwards for a 3d FFT display block.
 I put the code I got there, and added some changes:
 https://github.com/wishi/gr_3d_fft
 
 My probem is:
 
 Traceback (most recent call last):
   File usrp_gl_fft.py, line 81, in module
 main ()
   File usrp_gl_fft.py, line 77, in main
 app = stdgui2.stdapp(app_flow_graph, 3d)
 [not interesting]
   File /usr/local/lib/python2.6/dist-packages/gnuradio/gr/top_block.py,
 line 128, in _connect
 (dst_block, dst_port) = self._coerce_endpoint(dst)
   File /usr/local/lib/python2.6/dist-packages/gnuradio/gr/top_block.py,
 line 139, in _coerce_endpoint
 raise ValueError(unable to coerce endpoint)
 ValueError: unable to coerce endpoint
 
 I know this is related to the hierarchical block API, but I don't know
 what I have to change. Could someone help me - at least a little?
 I think there's too much to do left, however I don't find a way to
 treat this error.
 If that works I'll do GRC integration and clean up the OpenGL stuff
 (the code is from the source mentioned in the repository, but GPL).
 I'm missing this kind of 3d perspective so I tried to create this
 graphical sink based on the mentioned code.

Hi Marius,

this usually means something like there's an 'open' connection (it's
like leaving that one pin of your µC dangling when it should be grounded
:).

A quick look at the code suggests your error is in the fft_sink_c class
(possibly others). In fact, you've thoroughly misunderstood what a
hier_block does.

A hier_block works just like any other block (from the outside). You
should have a look at some of the examples in
gnuradio-core/src/lib/python/gnuradio.

Two things immediately stand out:

- You're not calling the hier_block constructor.
- You pass 'fg' to the block, but it *is* part of the flow graph.
- Since this is a sink, you must have something like
  self.connect(self, ...)

As I said, have a look at the examples. Your code can't work in this
state.

Good luck,

MB



-- 
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association



pgpUGZLgxzDUG.pgp
Description: PGP signature
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] coerce endpoint - hier block API question with code

2011-08-06 Thread Marius
Hi!

I'm creating an integration for the current GNU Radio = 3.4 tree
upwards for a 3d FFT display block.
I put the code I got there, and added some changes:
https://github.com/wishi/gr_3d_fft

My probem is:

Traceback (most recent call last):
  File usrp_gl_fft.py, line 81, in module
main ()
  File usrp_gl_fft.py, line 77, in main
app = stdgui2.stdapp(app_flow_graph, 3d)
  File /usr/local/lib/python2.6/dist-packages/gnuradio/wxgui/stdgui2.py,
line 36, in __init__
wx.App.__init__ (self, redirect=False)
  File /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py,
line 7978, in __init__
self._BootstrapApp()
  File /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py,
line 7552, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File /usr/local/lib/python2.6/dist-packages/gnuradio/wxgui/stdgui2.py,
line 39, in OnInit
frame = stdframe (self.top_block_maker, self.title, self._nstatus)
  File /usr/local/lib/python2.6/dist-packages/gnuradio/wxgui/stdgui2.py,
line 60, in __init__
self.panel = stdpanel (self, self, top_block_maker)
  File /usr/local/lib/python2.6/dist-packages/gnuradio/wxgui/stdgui2.py,
line 81, in __init__
self.top_block = top_block_maker (frame, self, vbox, sys.argv)
  File usrp_gl_fft.py, line 74, in __init__
self.connect (self.u, block)
  File /usr/local/lib/python2.6/dist-packages/gnuradio/gr/top_block.py,
line 124, in connect
self._connect(points[i-1], points[i])
  File /usr/local/lib/python2.6/dist-packages/gnuradio/gr/top_block.py,
line 128, in _connect
(dst_block, dst_port) = self._coerce_endpoint(dst)
  File /usr/local/lib/python2.6/dist-packages/gnuradio/gr/top_block.py,
line 139, in _coerce_endpoint
raise ValueError(unable to coerce endpoint)
ValueError: unable to coerce endpoint

I know this is related to the hierarchical block API, but I don't know
what I have to change. Could someone help me - at least a little?
I think there's too much to do left, however I don't find a way to
treat this error.
If that works I'll do GRC integration and clean up the OpenGL stuff
(the code is from the source mentioned in the repository, but GPL).
I'm missing this kind of 3d perspective so I tried to create this
graphical sink based on the mentioned code.

Thanks in advance ;),
Marius

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio