QT widget to adjust integer values on the fly

I have a GRC flowgraph that includes a custom C++ block which dumps
custom vectors out a port, so I use the QT GUI Vector Sink to display
these.
The block also requires integer params which I need to adjust while
the flowgraph is running.

I have a problem, because as near as I can tell…
a) QT GUI Entry (and QT GUI Label) only display the value, changes the
user makes to QT GUI Entry while the flowgraph is running do not seem
to be propogated to the flowgraph block params that use the required
variable names - which unless I am mistaken here (possible) makes me
wonder what the point of the Entry is vs the Label - if this is
incorrect please let me know and I would like to investigate why I do
not see this happening on my flowgraphs
b) QT GUI Range seems to always output float values, there is no way
that I see to set the output type to handle integers, so when I try to
change the value and it is passed to an integer block param swig(?)
generates a runtime TypeError and the value does not actually change
in the block (although it seems to work fine for float params)
c) I want to use the QT option for the GUI because WX, while it has a
Slider and Text Box that appear to have formatting options to provide
integers(?), does not seem to have something akin to the QT GUI Vector
Sink that is so incredibly useful.

Programming GUI widgets or graphical sinks is not something I wish to
tackle at this stage.

Can someone recommend an apporach to handling this?

I could just make all the integer params into floats (and convert them
inside the custom block C++ code) as a workaround, but I am hoping GRC
has a better way to handle this.

Thanks

On Wed, Mar 18, 2015 at 11:58 AM, Murphy, John [email protected]
wrote:

variable names - which unless I am mistaken here (possible) makes me
wonder what the point of the Entry is vs the Label - if this is
incorrect please let me know and I would like to investigate why I do
not see this happening on my flowgraphs
b) QT GUI Range seems to always output float values, there is no way
that I see to set the output type to handle integers, so when I try to
change the value and it is passed to an integer block param swig(?)
generates a runtime TypeError and the value does not actually change
in the block (although it seems to work fine for float params)

We can look into adding the formatter option to this block – we’re
working
on updating it soon, anyways, to remove the use of PyQWT.

In the meantime, you can cast it yourself when you use it. Say your
Range
block variable is “var”, when you pass it to a block, say “int(var)” to
cast it to an integer.

Just remember that all of the edit boxes for parameters in GRC are
Python,
so you can put a Python expression in them as you need.

Tom

Ah! Thanks, Tom, that works.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs