discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] gr-howto-write-a-block


From: William Sherman
Subject: [Discuss-gnuradio] gr-howto-write-a-block
Date: Thu, 2 Apr 2009 04:55:39 +0200

Hi,

I have been trying to create a new block
"howto_ren_bin_statistics_mean_f" using the howto example as the base.

I have created a .cc, .h, edited the howto.i and edited the Makefile.am.
The block  successfully "compiles" after calling automake -> ./configure
-> make, and .la, howto.cc, howto.py files are successfully generated.

However when I run a test program with:

from gnuradio import howto

...

stats = howto.ren_bin_statistics_mean_f(self.fft_size, self.msgq,
        self._tune_callback, tune_delay, dwell_delay)

It says it can't find the module,

Traceback (most recent call last):
  File "qa_spectrum_sense.py", line 481, in <module>
    tb = my_top_block()
  File "qa_spectrum_sense.py", line 380, in __init__
    stats = howto.ren_bin_statistics_mean_f(self.fft_size, self.msgq,
AttributeError: 'module' object has no attribute
'ren_bin_statistics_mean_f'

How do I build howto correctly or get gnuradio to recognise and use this
new block ren_bin_statistics_mean_f?

I am concerned in _howto.la that the "directory this library needs to be
installed under"
libdir='/u/students/sherman/ren_static/gr-howto-write-a-block-3.1.3/lib/python2.5/site-packages/gnuradio'

is not the same as I am using,
libdir='/u/students/sherman/ren_static/gr-howto-write-a-block-3.1.3'

I believe the whole thing is building correctly because in the generated
howto.py there is an entry:

howto_ren_bin_statistics_mean_f_sptr_swigregister =
_howto.howto_ren_bin_statistics_mean_f_sptr_swigregister
howto_ren_bin_statistics_mean_f_sptr_swigregister(howto_ren_bin_statistics_mean_f_sptr)


def howto_ren_bin_statistics_mean_f_block(*args):
  """howto_ren_bin_statistics_mean_f_block(howto_ren_bin_statistics_mean_f_sptr
r) -> gr_block_sptr"""
  return _howto.howto_ren_bin_statistics_mean_f_block(*args)
howto_ren_bin_statistics_mean_f_sptr.block = lambda self:
howto_ren_bin_statistics_mean_f_block (self)
howto_ren_bin_statistics_mean_f_sptr.__repr__ = lambda self: "<gr_block
%s (%d)>" % (self.name(), self.unique_id ())


def ren_bin_statistics_mean_f(*args):
  """
    ren_bin_statistics_mean_f(unsigned int vlen, gr_msg_queue_sptr msgq,
gr_feval_dd tune,
        size_t tune_delay, size_t dwell_delay) ->
howto_ren_bin_statistics_mean_f_sptr
    """
  return _howto.ren_bin_statistics_mean_f(*args)


Just to make clear what is my question:
How do I build howto correctly or get gnuradio to recognise and use this
new block ren_bin_statistics_mean_f?
-- 
Posted via http://www.ruby-forum.com/.




reply via email to

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