discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] GRCP Monitor and Non-Numbers (C++ rpc register)


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] GRCP Monitor and Non-Numbers (C++ rpc register)
Date: Thu, 28 Aug 2014 06:57:23 -0700

On Wed, Aug 27, 2014 at 4:11 PM, JT <address@hidden> wrote:
Hello

I am attempting to get and set strings via ControlPort, but I keep getting
the traceback error below when I right-click to set a value in the
ControlPort monitor (which I am using to ensure I am setting up the RPC
calls properly). Getting and setting a number works fine, but strings (and
vectors) keep giving me a traceback; the monitor doesn't crash, though, but
I still can't set the string.

rpcbasic_register_set<a_class, std::string> get_some_string
rpcbasic_register_set<a_class, std::string> set_some_string

Traceback (most recent call last):
  File "/opt/gnuradio3.7/bin/gr-ctrlport-monitor", line 744, in openMenu
    self.parent.propertiesMenu(itemname, self.radio, self.uid)
  File "/opt/gnuradio3.7/bin/gr-ctrlport-monitor", line 124, in
propertiesMenu
    pmin = 1.1*abs(pmin)
TypeError: bad operand type for abs(): 'str'

I am not sure if it's important, but I the setup the polymorphic types as
follows:

pmt::string_to_symbol(std::string("")) for the getter
and
pmt::mp("") for the setter


Thank you in advance,
JT

Ah, yes, that's an issue with the controlport monitor application. It's trying to get information about the knob that's exposed with controlport, including the min and max, but it's designed around numbers and so trying to take the abs() of everything. You'll have to edit gr-ctrlport-monitor to put a check around line 124 if the value is a number or not. If not, don't try and set the min (or max).

Tom
 

reply via email to

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