Forum: GNU Radio Making a GUI to execute python scripts generated by GRC

5fd1e4f6f03488a54ea5b31a1ef94886?d=identicon&s=25 jason sam (Guest)
on 2014-06-18 07:24
(Received via mailing list)
Attachment: uhd_fft.py (9 KB)
Attachment: wxgui.py (853 Bytes)
Hi,
I have written a python code(wxgui.py) for a simple GUI using
wxPython.There is a button in it and by pressing that button i am
executing another python file.It's working fine and i am able to call
any python file,but when i try to execute the python file created by
GRC(uhd_fft.py) i get the following error:

Form: <class 'gnuradio.wxgui.forms.forms.text_box'> ->  Error
translating value: "<__main__.MyFrame; proxy of <Swig Object of type
'wxFrame *' at 0x30f44a0> >"
    bad operand type for abs(): 'MyFrame'
    Enter a float with optional scale suffix.  E.g., 100.1M
Form: <class 'gnuradio.wxgui.forms.forms.
slider'> ->  Error translating value: "<__main__.MyFrame; proxy of
<Swig Object of type 'wxFrame *' at 0x30f44a0> >"
    unsupported operand type(s) for -: 'MyFrame' and 'float'
    Value should be within slider range
Using Volk machine: avx_64_mmx_orc
Traceback (most recent call last):
  File "wxgui.py", line 26, in Execute
    self.aNewFrame = uhd_fft.uhd_fft(self)
  File "/home/ali/Desktop/WXGUI/uhd_fft.py", line 155, in __init__
    size=((-1, 400)),
  File
"/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/fftsink_gl.py",
line 126, in __init__
    persist_alpha=persist_alpha,
  File
"/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/fft_window.py",
line 304, in __init__
    self.update_grid()
  File
"/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/fft_window.py",
line 401, in update_grid
    baseband_freq - sample_rate/2.0,
TypeError: unsupported operand type(s) for -: 'MyFrame' and 'float'
Traceback (most recent call last):
  File
"/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/forms/forms.py",
line 102, in <lambda>
    widget.Bind(EVT_DATA, lambda x: self._update(x.data))
  File
"/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/forms/forms.py",
line 248, in _update
    def _update(self, value): self._text_box.SetValue(value);
self._update_color()
  File
"/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_controls.py",
line 1754, in SetValue
    return _controls_.TextCtrl_SetValue(*args, **kwargs)
TypeError: String or Unicode type required
Traceback (most recent call last):
  File
"/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/forms/forms.py",
line 102, in <lambda>
    widget.Bind(EVT_DATA, lambda x: self._update(x.data))
  File
"/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/forms/forms.py",
line 181, in _update
    def _update(self, value): self._slider.SetValue(int(round(value)))
TypeError: a float is required


Both files are as attached.Is there any other way for it?What am i
doing wrong?This issue is bothering me since long.

Regards,
Ali
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.