Hi,
I have individuated the error and we are near the solution, thanks to
all.
I just remember the error that appear when I try to run a simulation of
my
new block “power”:
Traceback (most recent call last):
File “/home/simone/Scrivania/top_block.py”, line 228, in
tb = top_block()
File “/home/simone/Scrivania/top_block.py”, line 71, in init
self.t1_power_0 = t1.power(0.001, 0.5)
AttributeError: ‘module’ object has no attribute ‘power’
I tried my block just eliminating the use of the class function
gr::uhd::usrp_source and it works.
So, the error is in the way in which I define and call a new USRP source
block.
/*************************************** INSTRUCTION
************************************************************/
This is my creation of the new UHD object in the _impl.cc file of my new
written block
::uhd::device_addr_t addr;
gr::uhd::usrp_source::sptr my_usrp_source =
gr::uhd::usrp_source::make(addr, ::uhd::stream_args_t(“fc32”));
and then I use this function
DB_gain = (float) my_usrp_source->get_gain(0);
/******************************************************************************************************************/
I have some questions:
consider the flowgraph attached in this mail,
first of all, I’m using an usrp (UHD: USRP SOURCE block) with a fixed ip
address (addr=192.168.10.2), and I set “sudo ifconfig eth0 192.168.10.1”
and get “addr 192.168.10.2” to setup the device.
In the same flowgraph, in my created block (my _impl.cc) now I’m
creating
another USRP source block and I don’t understand which address I need to
use to set correctly the make function (see instruction above) for
modifying parameters of the same USRP that is working, the USRP with
address 192.168.10.2.
In my code I set addr=192.168.10.2
Second, this definition:
gr::uhd::usrp_source::sptr my_usrp_source =
gr::uhd::usrp_source::make(addr, ::uhd::stream_args_t(“fc32”));
is sufficient to put it into the general work and no other places to use
this class??? The compilare does not advice me that there is an error,
but
my definition for class usage is not clear and wrong and then I get
error
in simulation…
Anyway, is well appreciated if someone can show me the correct way to
define and use function of other classes into a new created block!
On Mon, 8 Sep 2014 09:48:32 -0400, Tom R. [email protected] wrote:
constructor.
and then, in the constructor of the file power_control_impl.cc (in
short)
d_counter=0
Yeah, I figured there were two arguments. I just put them as x and y.
One thing that can happen here is if there’s a declared function in the
public and/or private header that’s not implemented in the .cc file. You
might have something like that going on, such as not having or deleting
the
destructor. Using gr_modtool should protect you from things like this,
and
[email protected]> wrote:
$cmake …/ && make && sudo make install && sudo ldconfig
self.PWagc_power_control_0 = PWagc.power_control(0.001, 0.25)
Someone can help me please?
function doesn’t actually do anything.
Are you potentially adding some interface setter or getter to the
class