discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] About a typeerror


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] About a typeerror
Date: Fri, 1 Oct 2010 10:45:32 -0400

On Thu, Sep 30, 2010 at 4:34 PM, 王铖 <address@hidden> wrote:
Hi, everyone,

When I ran a python program, I met such a question, can you holp me to point out where the problem is?

The problem is as follows:

Traceback (most recent call last):
  File "MainFrame.py", line 106, in OnDBPSK_Demodulate
    objDemod = DBPSKDemod.dbpsk_demod(fg)
  File "/home/cwang/prj/ufl/source_code/Receiver/DBPSKDemod.py", line 153, in __init__
    gr.hier_block2.__init__(self, self._fg, self.pre_scaler, self.unpack)    #changed from block to block2, cwang 9.29
  File "/usr/local/lib/python2.6/dist-packages/gnuradio/gr/hier_block2.py", line 42, in __init__
    self._hb = hier_block2_swig(name, input_signature, output_signature)
  File "/usr/local/lib/python2.6/dist-packages/gnuradio/gr/gnuradio_swig_py_runtime.py", line 1015, in hier_block2_swig
    return _gnuradio_swig_py_runtime.hier_block2_swig(*args, **kwargs)
TypeError: in method 'hier_block2_swig', argument 1 of type 'std::string const'


Thanks.

Cheng



From: self._hb = hier_block2_swig(name, input_signature, output_signature), you're supposed to pass an argument "name" to the hier_block2 constructor, so the error is telling you that you're using the wrong type (i.e., not a string like it's expecting).

From: gr.hier_block2.__init__(self, self._fg, self.pre_scaler, self.unpack), you're passing a flow graph as the argument instead of a name.

The comment suggests you just changed "block" to "block2", but there were more changes than just the cosmetic name change, so you'll need to look into how to use the hier_block2.

Tom

 


reply via email to

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