discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] How to extract value from form.float_field??


From: Yu-Hua Yang
Subject: [Discuss-gnuradio] How to extract value from form.float_field??
Date: Sat, 6 Jun 2009 18:01:22 +0800

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

reply via email to

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