Forum: GNU Radio code changed and results in error of my programm

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.
85ffd97bae0e78056e1d06312744d7d1?d=identicon&s=25 feldmaus (Guest)
on 2009-05-15 13:35
(Received via mailing list)
Hi All,

one of my gnuradio programms do not work anymore, because
some changed the code.

My error Message is:
self._variable_text_box_0_control = grc_wxgui.text_box_control(
AttributeError: 'module' object has no attribute 'text_box_control'

What is the new name ?

regards Markus
85ffd97bae0e78056e1d06312744d7d1?d=identicon&s=25 feldmaus (Guest)
on 2009-05-15 14:28
(Received via mailing list)
feldmaus <feldmann_markus <at> gmx.de> writes:

>
> What is the new name ?
>
Forget this message. I do not need this Program anymore.

Regards Markus
4252201ac30d6dd44d8090ce1070e35f?d=identicon&s=25 Josh Blum (Guest)
on 2009-05-15 19:44
(Received via mailing list)
The callback controls module in grc was replaced with the forms module
http://gnuradio.org/trac/browser/gnuradio/trunk/gr...

The idea is that this forms module will get merged into wxgui and used
by wxgui applications other than grc. This is a step in that direction.

You should be able to change the import statement and constructor, and
everything will work with the forms module.

-Josh
85ffd97bae0e78056e1d06312744d7d1?d=identicon&s=25 feldmaus (Guest)
on 2009-05-25 10:53
(Received via mailing list)
Josh Blum <josh <at> joshknows.com> writes:

> -Josh
>
Thanks for your Answer,

i changed from,
    self._variable_text_box_0_control = grc_wxgui.text_box_control(
      window=self.GetWin(),
      callback=self.set_decim,
      label='decim',
      value=self.usrp_source.decim_rate(),
    )


to,
    self._variable_text_box_0_control = grc_wxgui.forms.text_box(
      window=self.GetWin(),
      callback=self.set_decim,
      label='decim',
      value=self.usrp_source.decim_rate(),
    )

But this results in an error:
TypeError: __init__() got an unexpected keyword argument 'window'

How should it look like now ?

Regards Markus
85ffd97bae0e78056e1d06312744d7d1?d=identicon&s=25 feldmaus (Guest)
on 2009-05-25 11:07
(Received via mailing list)
I still got some more errors:

i defined this elements:
    self._variable_text_box_0_control = grc_wxgui.forms.text_box(
      #window=self.GetWin(),
      callback=self.set_decim,
      label='decim',
      value=self.usrp_source.decim_rate(),
    )
    self.Add(self._variable_text_box_0_control)
    self._variable_text_box_1_control = grc_wxgui.forms.text_box(
      #window=self.GetWin(),
      callback=self.set_dc_offset_adc_0,
      label='DC-Offset(ADC_0)',
      value=262,
    )
    self.Add(self._variable_text_box_1_control)
    self._variable_text_box_2_control = grc_wxgui.forms.text_box(
      #window=self.GetWin(),
      callback=self.set_dc_offset_adc_1,
      label='DC-Offset(ADC_1)',
      value=262,
    )
    self.Add(self._variable_text_box_2_control)
    self._variable_text_box_3_control = grc_wxgui.forms.text_box(
      #window=self.GetWin(),
      callback=self.set_dc_offset_adc_2,
      label='DC-Offset(ADC_2)',
      value=-586,
    )
    self.Add(self._variable_text_box_3_control)
    self._variable_text_box_4_control = grc_wxgui.forms.text_box(
      #window=self.GetWin(),
      callback=self.set_dc_offset_adc_3,
      label='DC-Offset(ADC_3)',
      value=-663,
    )
    self.Add(self._variable_text_box_4_control)
    self._variable_chooser_filter = grc_wxgui.forms.drop_down(
      #window=self.GetWin(),
      callback=self.change_filter,
      label='Choose Filter',
      index=0,
      choices=[1, 2, 3, 4, 5],
      labels=['No Filter',
        'FIR frequency translating LP',
        'FIR frequency translating BP',
        'Analysis Filterbank+LP',
        'Analysis Filterbank+BP'],
    )
    self.Add(self._variable_chooser_filter)
    self._usrp_freq_control = grc_wxgui.forms.slider(
      #window=self.GetWin(),
      style=wx.SL_HORIZONTAL,
      callback=self.set_usrp_freq,
      label="Oszillatorfrequenz",
      value=self.usrp_freq,
      min=self.usrp_freq_min,
      max=self.usrp_freq_max,
      num_steps=1e3,
      slider_length=1024,
    )
    self.Add(self._usrp_freq_control)
    self._gain_usrp_source_control = grc_wxgui.forms.slider(
      #window=self.GetWin(),
      style=wx.SL_VERTICAL
      callback=self.set_gain_usrp_source,
      label="Gain Usrp Source",
      value=self.gain_usrp_source,
      min=0,
      max=20,
      num_steps=100,
      slider_length=200,
    )
    self.GridAdd(self._gain_usrp_source_control, 4, 0, 2, 1)

And there seems to be some more bugs:
    callback=self.set_gain_usrp_source,
           ^
SyntaxError: invalid syntax

Any Ideas ?

Regards Markus
4252201ac30d6dd44d8090ce1070e35f?d=identicon&s=25 Josh Blum (Guest)
on 2009-05-25 18:35
(Received via mailing list)
After 3.2, this stuff will get merged in officially to wxgui, for now,
your on the bleeding edge!

Look at the source code to get the parameters:
http://gnuradio.org/trac/browser/gnuradio/trunk/gr...

Or, generate a flow graph in grc with the various gui controls, and see
what parameters are used.

-Josh


feldmaus wrote:
>     self._variable_text_box_1_control = grc_wxgui.forms.text_box(
>       value=262,
>       #window=self.GetWin(),
>       choices=[1, 2, 3, 4, 5],
>       callback=self.set_usrp_freq,
>       style=wx.SL_VERTICAL
> And there seems to be some more bugs:
>     callback=self.set_gain_usrp_source,
>            ^
> SyntaxError: invalid syntax
>
> Any Ideas ?
>

missing a comma
style=wx.SL_VERTICAL,
This topic is locked and can not be replied to.