Forum: GNU Radio How to extract value from form.float_field??

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Yu-Hua Y. (Guest)
on 2009-06-06 14:04
(Received via mailing list)
Hello

I did my best at searching relevant topics as well as going through
wxPython.org to learn how to write GUI with Gnuradio but I am still
having
some trouble. Please bear with me as I am very new to Python and
GNURadio

I am currently trying to create a GUI that will allow the user to input
frequency, number of packets, packet size and then click send button to
start the tx from the USRP. I thought this would be a good excerise to
learn
the language and classes. I am having trouble trying to extract the
user-inputted value from the forms. I really dont understand this:

self.freq = form.float_field(
            parent=self.panel, sizer=hbox, label="Freq", weight=1)

I based my code on another GUI example in the GNUradio package. Anyways,
shouldn't this set the value in the form into self.freq? But when I try
to
display self.freq.get_value or self.freq._get_prim_value, if I call on
self.freq like this:

        message = "frequency is at %f" % self.freq.get_value
        self._set_status_msg(message, 0)

It would error with

"float argument required"

Same kind of error occurrs if i change the display to %d, just instead
"int
argument required"

How do I extract the freq value from the form?? Not just to display but
also
to be used to create a benchmark test... This is a very beginning step
but
seriously preventing me from progressing with my excerise. Please help.

Thank you
This topic is locked and can not be replied to.