From 7ed83c72dbd079a50a421661a874c3ac94a34bd6 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 5 Dec 2010 17:21:07 -0500 Subject: grc: added qtgui support to grc (just added sink) --- grc/blocks/Makefile.am | 1 + grc/blocks/block_tree.xml | 1 + grc/blocks/options.xml | 8 +++ grc/blocks/qtgui_sink_x.xml | 123 ++++++++++++++++++++++++++++++++++++++++++++ grc/python/flow_graph.tmpl | 9 ++++ 5 files changed, 142 insertions(+) create mode 100644 grc/blocks/qtgui_sink_x.xml diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index 18420a013..ea3c94cbe 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -203,6 +203,7 @@ dist_ourdata_DATA = \ pad_source.xml \ parameter.xml \ probe_function.xml \ + qtgui_sink_x.xml \ random_source_x.xml \ root_raised_cosine_filter.xml \ trellis_encoder_xx.xml \ diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 610a88102..644841884 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -47,6 +47,7 @@ wxgui_waterfallsink2 wxgui_histosink2 wxgui_termsink + qtgui_sink_x Operators diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index 4d0dd2899..62ceeba0f 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -15,6 +15,10 @@ from grc_gnuradio import wxgui as grc_wxgui import wx #end if +#if $generate_options() == 'qt_gui' +from PyQt4 import QtGui +import sys +#end if #if $generate_options() != 'hb' from optparse import OptionParser from gnuradio.eng_option import eng_option @@ -61,6 +65,10 @@ else: self.stop(); self.wait() WX GUI wx_gui + - - - Converter - converver - float_converter - enum - - $start <= $value <= $stop diff --git a/gr-qtgui/python/forms/__init__.py b/gr-qtgui/python/forms/__init__.py deleted file mode 100644 index 0f4391bb8..000000000 --- a/gr-qtgui/python/forms/__init__.py +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright 2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -######################################################################## -# External Converters -######################################################################## -from converters import \ - eval_converter, str_converter, \ - float_converter, int_converter - -######################################################################## -# External Forms -######################################################################## -from forms import slider, text_box diff --git a/gr-qtgui/python/forms/converters.py b/gr-qtgui/python/forms/converters.py deleted file mode 100644 index 53c966d32..000000000 --- a/gr-qtgui/python/forms/converters.py +++ /dev/null @@ -1,154 +0,0 @@ -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import eng_notation -import math - -class abstract_converter(object): - def external_to_internal(self, v): - """ - Convert from user specified value to value acceptable to underlying primitive. - The underlying primitive usually expects strings. - """ - raise NotImplementedError - def internal_to_external(self, s): - """ - Convert from underlying primitive value to user specified value. - The underlying primitive usually expects strings. - """ - raise NotImplementedError - def help(self): - return "Any string is acceptable" - -class identity_converter(abstract_converter): - def external_to_internal(self,v): - return v - def internal_to_external(self, s): - return s - -######################################################################## -# Commonly used converters -######################################################################## -class chooser_converter(abstract_converter): - """ - Convert between a set of possible choices and an index. - Used in the chooser base and all sub-classes. - """ - def __init__(self, choices): - #choices must be a list because tuple does not have .index() in python2.5 - self._choices = list(choices) - def external_to_internal(self, choice): - return self._choices.index(choice) - def internal_to_external(self, index): - return self._choices[index] - def help(self): - return 'Enter a possible value in choices: "%s"'%str(self._choices) - -class bool_converter(abstract_converter): - """ - The internal representation is boolean. - The external representation is specified. - Used in the check box form. - """ - def __init__(self, true, false): - self._true = true - self._false = false - def external_to_internal(self, v): - if v == self._true: return True - if v == self._false: return False - raise Exception, 'Value "%s" is not a possible option.'%v - def internal_to_external(self, v): - if v: return self._true - else: return self._false - def help(self): - return "Value must be in (%s, %s)."%(self._true, self._false) - -class eval_converter(abstract_converter): - """ - A catchall converter when int and float are not enough. - Evaluate the internal representation with python's eval(). - Possible uses, set a complex number, constellation points. - Used in text box. - """ - def __init__(self, formatter=lambda x: '%s'%(x)): - self._formatter = formatter - def external_to_internal(self, v): - return self._formatter(v) - def internal_to_external(self, s): - return eval(s) - def help(self): - return "Value must be evaluatable by python's eval." - -class str_converter(abstract_converter): - def __init__(self, formatter=lambda x: '%s'%(x)): - self._formatter = formatter - def external_to_internal(self, v): - return self._formatter(v) - def internal_to_external(self, s): - return str(s) - -class int_converter(abstract_converter): - def __init__(self, formatter=lambda x: '%d'%round(x)): - self._formatter = formatter - def external_to_internal(self, v): - return self._formatter(v) - def internal_to_external(self, s): - return int(s, 0) - def help(self): - return "Enter an integer. Leading 0x indicates hex" - -class float_converter(abstract_converter): - def __init__(self, formatter=eng_notation.num_to_str): - self._formatter = formatter - def external_to_internal(self, v): - return self._formatter(v) - def internal_to_external(self, s): - return eng_notation.str_to_num(s) - def help(self): - return "Enter a float with optional scale suffix. E.g., 100.1M" - -class slider_converter(abstract_converter): - """ - Scale values to and from the slider. - """ - def __init__(self, start, stop, num_steps, cast): - assert start < stop - assert num_steps > 0 - self._offset = start - self._scaler = float(stop - start)/num_steps - self._cast = cast - def external_to_internal(self, v): - return (v - self._offset)/self._scaler - def internal_to_external(self, v): - return self._cast(v*self._scaler + self._offset) - def help(self): - return "Value should be within slider range" - -class log_slider_converter(slider_converter): - def __init__(self, min_exp, max_exp, num_steps, base): - assert min_exp < max_exp - assert num_steps > 0 - self._base = base - slider_converter.__init__(self, start=min_exp, stop=max_exp, num_steps=num_steps, cast=float) - def external_to_internal(self, v): - return slider_converter.external_to_internal(self, math.log(v, self._base)) - def internal_to_external(self, v): - return self._base**slider_converter.internal_to_external(self, v) diff --git a/gr-qtgui/python/forms/forms.py b/gr-qtgui/python/forms/forms.py deleted file mode 100644 index 56ee72499..000000000 --- a/gr-qtgui/python/forms/forms.py +++ /dev/null @@ -1,140 +0,0 @@ -# -# Copyright 2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from PyQt4 import QtGui -from PyQt4.QtCore import Qt - -import converters - -######################################################################## -# Base class for all forms -######################################################################## -class _form_base(QtGui.QWidget): - def __init__(self, parent=None, converter=None, callback=None, value=None): - QtGui.QWidget.__init__(self, parent) - self._layout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self) - self._converter = converter - self._callback = callback - self._value = value - - def _add_widget(self, widget, label): - if label: - label_widget = QtGui.QLabel(self) - label_widget.setText('%s: '%label) - self._layout.addWidget(label_widget, True) - self._layout.addWidget(widget, stretch=1) - #disable callback, update, re-enable - callback = self._callback - self._callback = None - self.set_value(self.get_value()) - self._callback = callback - - def get_value(self): - return self._value - - def set_value(self, value): - self._value = value - self._base_update(self._converter.external_to_internal(value)) - - def _base_update(self, int_val): - self._update(int_val) - - def _base_handle(self, int_val): - self._value = self._converter.internal_to_external(int_val) - if self._callback: self._callback(self._value) - -######################################################################## -# Slider base class, shared by log and linear sliders -######################################################################## -class _slider_base(_form_base): - def __init__(self, label='', length=-1, num_steps=100, orient=Qt.Horizontal, **kwargs): - _form_base.__init__(self, **kwargs) - self._slider = QtGui.QSlider(parent=self) - self._slider.setOrientation(orient) - self._slider.setRange(0, num_steps) - if length > 0: - if orient == Qt.Horizontal: - slider_size = self._slider.setWidth(length) - if orient == Qt.Vertical: - slider_size = self._slider.setHeight(length) - self._add_widget(self._slider, label) - self._slider.valueChanged.connect(self._handle) - - def _handle(self, event): - value = self._slider.value() - if self._cache != value: self._base_handle(value) - def _update(self, value): - self._cache = int(round(value)) - self._slider.setValue(self._cache) - -######################################################################## -# Linear slider form -######################################################################## -class slider(_slider_base): - """ - A generic linear slider. - @param parent the parent widget - @param value the default value - @param label title label for this widget (optional) - @param length the length of the slider in px (optional) - @param orient Qt.Horizontal Veritcal (default=horizontal) - @param start the start value - @param stop the stop value - @param num_steps the number of slider steps (or specify step_size) - @param step_size the step between slider jumps (or specify num_steps) - @param cast a cast function, int, or float (default=float) - """ - def __init__(self, start, stop, step=None, num_steps=100, cast=float, **kwargs): - assert step or num_steps - if step is not None: num_steps = (stop - start)/step - converter = converters.slider_converter(start=start, stop=stop, num_steps=num_steps, cast=cast) - _slider_base.__init__(self, converter=converter, num_steps=num_steps, **kwargs) - -######################################################################## -# Text Box Form -######################################################################## -class text_box(_form_base): - """ - A text box form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param value the default value - @param label title label for this widget (optional) - @param converter forms.str_converter(), int_converter(), float_converter()... - """ - def __init__(self, label='', converter=converters.eval_converter(), **kwargs): - _form_base.__init__(self, converter=converter, **kwargs) - self._text_box = QtGui.QLineEdit(self) - self._default_style_sheet = self._text_box.styleSheet() - self._text_box.textChanged.connect(self._set_color_changed) - self._text_box.returnPressed.connect(self._handle) - self._add_widget(self._text_box, label) - - def _set_color_default(self): - self._text_box.setStyleSheet(self._default_style_sheet) - - def _set_color_changed(self, *args): - self._text_box.setStyleSheet("QWidget { background-color: #EEDDDD }") - - def _handle(self): self._base_handle(str(self._text_box.text())) - def _update(self, value): - self._text_box.setText(value) - self._set_color_default() -- cgit From e30f0a7ca02801732ad7a25ab83e1d27dc45c6ce Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Jan 2011 22:31:31 -0800 Subject: grc: added tabbed widget in qtgui for grc created gui_hint type to handle tab descriptor + position markup, and to handle the generation of the name of the parent widget. No support python modules required in gr-qtgui. --- config/grc_gr_qtgui.m4 | 3 +- gr-qtgui/Makefile.am | 1 - gr-qtgui/grc/Makefile.am | 3 +- gr-qtgui/grc/qtgui_sink_x.xml | 18 ++++++-- gr-qtgui/grc/qtgui_tab_widget.xml | 84 ++++++++++++++++++++++++++++++++++ gr-qtgui/grc/qtgui_variable_slider.xml | 30 ++++++++---- grc/blocks/options.xml | 2 +- grc/python/Generator.py | 4 ++ grc/python/Param.py | 25 +++++++++- grc/python/flow_graph.tmpl | 13 ++++-- 10 files changed, 161 insertions(+), 22 deletions(-) create mode 100644 gr-qtgui/grc/qtgui_tab_widget.xml diff --git a/config/grc_gr_qtgui.m4 b/config/grc_gr_qtgui.m4 index 4027bb332..c14f984c3 100644 --- a/config/grc_gr_qtgui.m4 +++ b/config/grc_gr_qtgui.m4 @@ -1,4 +1,4 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc. +dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2011 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl @@ -82,6 +82,7 @@ AC_DEFUN([GRC_GR_QTGUI],[ AC_CONFIG_FILES([ \ gr-qtgui/Makefile \ + gr-qtgui/grc/Makefile \ gr-qtgui/src/Makefile \ gr-qtgui/src/lib/Makefile \ gr-qtgui/src/python/Makefile \ diff --git a/gr-qtgui/Makefile.am b/gr-qtgui/Makefile.am index 66746e5e8..30b249589 100644 --- a/gr-qtgui/Makefile.am +++ b/gr-qtgui/Makefile.am @@ -26,5 +26,4 @@ DIST_SUBDIRS = src if PYTHON SUBDIRS += grc -SUBDIRS += python endif diff --git a/gr-qtgui/grc/Makefile.am b/gr-qtgui/grc/Makefile.am index 226e9d137..132d1a2e0 100644 --- a/gr-qtgui/grc/Makefile.am +++ b/gr-qtgui/grc/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2010 Free Software Foundation, Inc. +# Copyright 2010-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,4 +25,5 @@ grcblocksdir = $(grc_blocksdir) dist_grcblocks_DATA = \ qtgui_sink_x.xml \ + qtgui_tab_widget.xml \ qtgui_variable_slider.xml diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml index 8182f8d94..6e5c9549b 100644 --- a/gr-qtgui/grc/qtgui_sink_x.xml +++ b/gr-qtgui/grc/qtgui_sink_x.xml @@ -8,10 +8,12 @@ QT GUI Sink qtgui_sink_x Graphical Sinks + from PyQt4 import Qt from gnuradio.qtgui import qtgui from gnuradio.gr import firdes import sip - qtgui.$(type.fcn)( + #set $win = 'self._%s_win'%$id +qtgui.$(type.fcn)( $fftsize, \#fftsize $wintype, \#wintype $fc, \#fc @@ -23,8 +25,8 @@ $plottime, \#plottime $plotconst, \#plotconst ) -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), QtGui.QWidget) -self.layout.addWidget(self._$(id)_win) +self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) +$(gui_hint()($win)) set_frequency_range($fc, $bw) Type @@ -114,11 +116,21 @@ self.layout.addWidget(self._$(id)_win) + + GUI Hint + gui_hint + + gui_hint + part + in $type $num_inputs +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml new file mode 100644 index 000000000..66597b454 --- /dev/null +++ b/gr-qtgui/grc/qtgui_tab_widget.xml @@ -0,0 +1,84 @@ + + + + QT GUI Tab Widget + qtgui_tab_widget + from PyQt4 import Qt + #set $win = 'self.%s'%$id +$win = Qt.QTabWidget(None) +#for i, label in enumerate([$label0, $label1, $label2, $label3, $label4]) +#if int($num_tabs()) > $i +self.$(id)_widget_$(i) = Qt.QWidget() +self.$(id)_layout_$(i) = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.$(id)_widget_$(i)) +self.$(id)_grid_layout_$(i) = Qt.QGridLayout() +self.$(id)_layout_$(i).addLayout(self.$(id)_grid_layout_$(i)) +$(win).addTab(self.$(id)_widget_$(i), $label) +#end if +#end for +$(gui_hint()($win)) + + Num Tabs + num_tabs + 1 + enum + + + + + + + + Label 0 + label0 + Tab 0 + string + #if int($num_tabs()) > 0 then 'none' else 'all'# + + + Label 1 + label1 + Tab 1 + string + #if int($num_tabs()) > 1 then 'none' else 'all'# + + + Label 2 + label2 + Tab 2 + string + #if int($num_tabs()) > 2 then 'none' else 'all'# + + + Label 3 + label3 + Tab 3 + string + #if int($num_tabs()) > 3 then 'none' else 'all'# + + + Label 4 + label4 + Tab 4 + string + #if int($num_tabs()) > 4 then 'none' else 'all'# + + + GUI Hint + gui_hint + + gui_hint + part + + +This block creates a tabbed widget to organize other widgets. \ +The ID of this block can be used as the tab_id in the GUI hints of other widgets. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + + diff --git a/gr-qtgui/grc/qtgui_variable_slider.xml b/gr-qtgui/grc/qtgui_variable_slider.xml index 5587fdc27..239d90903 100644 --- a/gr-qtgui/grc/qtgui_variable_slider.xml +++ b/gr-qtgui/grc/qtgui_variable_slider.xml @@ -6,35 +6,35 @@ ################################################### --> - QT GUI Variable Slider + QT GUI Slider variable_qtgui_slider Variables from PyQt4 import Qt import PyQt4.Qwt5 as Qwt self.$(id) = $(id) = $value - #set $win = '_%s_sizer'%$id + #set $win = '_%s_layout'%$id $win = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom) self._$(id)_tool_bar = Qt.QToolBar(self) $(win).addWidget(self._$(id)_tool_bar) #if $label() -self._$(id)_tool_bar.addWidget(Qt.QLabel($label, self._$(id)_tool_bar)) +self._$(id)_tool_bar.addWidget(Qt.QLabel($label, None)) #else -self._$(id)_tool_bar.addWidget(Qt.QLabel($id, self._$(id)_tool_bar)) +self._$(id)_tool_bar.addWidget(Qt.QLabel($id, None)) #end if -self._$(id)_counter = Qwt.QwtCounter(self._$(id)_tool_bar) +self._$(id)_counter = Qwt.QwtCounter(None) self._$(id)_counter.setRange($start, $stop, $step) self._$(id)_counter.setNumButtons(2) self._$(id)_counter.setValue($value) self._$(id)_tool_bar.addWidget(self._$(id)_counter) -$(win).connect(self._$(id)_counter, Qt.SIGNAL('valueChanged(double)'), self.set_$(id)) -self._$(id)_slider = Qwt.QwtSlider(self._$(id)_tool_bar) +self._$(id)_counter.valueChanged.connect(self.set_$(id)) +self._$(id)_slider = Qwt.QwtSlider(None) self._$(id)_slider.setRange($start, $stop, $step) self._$(id)_slider.setValue($value) self._$(id)_slider.setOrientation(Qt.$orient) self._$(id)_slider.setScalePosition($orient.scalepos) -$(win).connect(self._$(id)_slider, Qt.SIGNAL('valueChanged(double)'), self.set_$(id)) +self._$(id)_slider.valueChanged.connect(self.set_$(id)) $(win).addWidget(self._$(id)_slider) -self.layout.addLayout($win) +$(gui_hint()($win)) self.set_$(id)($value) self._$(id)_counter.setValue($id) self._$(id)_slider.setValue($id) @@ -68,7 +68,6 @@ self.layout.addLayout($win) step 1 real - part Orientation @@ -87,6 +86,13 @@ self.layout.addLayout($win) scalepos:Qwt.QwtSlider.RightScale + + GUI Hint + gui_hint + + gui_hint + part + $start <= $value <= $stop $start < $stop @@ -94,5 +100,9 @@ This block creates a variable with a slider. \ Leave the label blank to use the variable id as the label. \ The value must be a real number. \ The value must be between the start and the stop. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index 62ceeba0f..ed4d3c1d8 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -16,7 +16,7 @@ from grc_gnuradio import wxgui as grc_wxgui import wx #end if #if $generate_options() == 'qt_gui' -from PyQt4 import QtGui +from PyQt4 import Qt import sys #end if #if $generate_options() != 'hb' diff --git a/grc/python/Generator.py b/grc/python/Generator.py index d53802bef..7d08b914b 100644 --- a/grc/python/Generator.py +++ b/grc/python/Generator.py @@ -100,6 +100,10 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') filter(lambda b: b.get_key() == 'notebook', blocks), lambda n: n.get_id(), lambda n: n.get_param('notebook').get_value(), ) + notebooks += expr_utils.sort_objects( + filter(lambda b: b.get_key() == 'qtgui_tab_widget', blocks), + lambda n: n.get_id(), lambda n: n.get_param('gui_hint').get_value(), + ) #list of regular blocks (all blocks minus the special ones) blocks = filter(lambda b: b not in (imports + parameters + variables + probes + notebooks), blocks) + probes #list of connections where each endpoint is enabled diff --git a/grc/python/Param.py b/grc/python/Param.py index 6dd008d1d..27258faab 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -99,7 +99,7 @@ class Param(_Param, _GUIParam): 'hex', 'string', 'bool', 'file_open', 'file_save', 'id', 'stream_id', - 'grid_pos', 'notebook', + 'grid_pos', 'notebook', 'gui_hint', 'import', ) @@ -354,6 +354,29 @@ class Param(_Param, _GUIParam): except: raise Exception, 'Stream ID "%s" is not found.'%v return v ######################### + # GUI Position/Hint + ######################### + elif t == 'gui_hint': + if ':' in v: tab, pos = v.split(':') + elif '@' in v: tab, pos = v, '' + else: tab, pos = '', v + + if '@' in tab: tab, index = tab.split('@') + else: index = '?' + + widget_str = ({ + (True, True): 'self.%(tab)s_grid_layout_%(index)s.addWidget(%(widget)s, %(pos)s)', + (True, False): 'self.%(tab)s_layout_%(index)s.addWidget(%(widget)s)', + (False, True): 'self.top_grid_layout.addWidget(%(widget)s, %(pos)s)', + (False, False): 'self.top_layout.addWidget(%(widget)s)', + }[bool(tab), bool(pos)])%{'tab': tab, 'index': index, 'widget': '%s', 'pos': pos} + + def gui_hint(ws, w): + if 'layout' in w: ws = ws.replace('addWidget', 'addLayout') + return ws%w + + return lambda w: gui_hint(widget_str, w) + ######################### # Grid Position Type ######################### elif t == 'grid_pos': diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 108e15ca0..88049a9ef 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -60,12 +60,14 @@ class $(class_name)(grc_wxgui.top_block_gui): self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #end if #elif $generate_options == 'qt_gui' -class $(class_name)(gr.top_block, QtGui.QWidget): +class $(class_name)(gr.top_block, Qt.QWidget): def __init__($param_str): gr.top_block.__init__(self, "$title") - QtGui.QWidget.__init__(self) - self.layout = QtGui.QBoxLayout(QtGui.QBoxLayout.TopToBottom, self) + Qt.QWidget.__init__(self) + self.top_layout = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) #elif $generate_options == 'no_gui' class $(class_name)(gr.top_block): @@ -203,6 +205,9 @@ self.$port.get_parent().get_id()#slurp ######################################################## #for $var in $parameters + $variables #set $id = $var.get_id() + def get_$(id)(self): + return self.$id + def set_$(id)(self, $id): self.$id = $id #for $callback in $var_id2cbs[$id] @@ -250,7 +255,7 @@ if __name__ == '__main__': tb = $(class_name)($(', '.join($params_eq_list))) tb.Run($flow_graph.get_option('run')) #elif $generate_options == 'qt_gui' - qapp = QtGui.QApplication(sys.argv) + qapp = Qt.QApplication(sys.argv) tb = $(class_name)($(', '.join($params_eq_list))) tb.start() tb.show() -- cgit From 2c263e9640f2812b241d724286aaa1f13c57935f Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 21 Jan 2011 14:33:27 -0800 Subject: qtgui: work on variable chooser --- gr-qtgui/grc/Makefile.am | 1 + gr-qtgui/grc/qtgui_variable_chooser.xml | 85 +++++++++++++++++++++++++++++++++ gr-qtgui/grc/qtgui_variable_slider.xml | 2 +- grc/blocks/options.xml | 1 - 4 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 gr-qtgui/grc/qtgui_variable_chooser.xml diff --git a/gr-qtgui/grc/Makefile.am b/gr-qtgui/grc/Makefile.am index 132d1a2e0..e69d3a9af 100644 --- a/gr-qtgui/grc/Makefile.am +++ b/gr-qtgui/grc/Makefile.am @@ -26,4 +26,5 @@ grcblocksdir = $(grc_blocksdir) dist_grcblocks_DATA = \ qtgui_sink_x.xml \ qtgui_tab_widget.xml \ + qtgui_variable_chooser.xml \ qtgui_variable_slider.xml diff --git a/gr-qtgui/grc/qtgui_variable_chooser.xml b/gr-qtgui/grc/qtgui_variable_chooser.xml new file mode 100644 index 000000000..46e302bc7 --- /dev/null +++ b/gr-qtgui/grc/qtgui_variable_chooser.xml @@ -0,0 +1,85 @@ + + + + QT GUI Chooser + variable_qtgui_chooser + Variables + from PyQt4 import Qt + import PyQt4.Qwt5 as Qwt + self.$(id) = $(id) = $value + #set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if $label() +$(win).addWidget(Qt.QLabel($label, None)) +#else +$(win).addWidget(Qt.QLabel("$id", None)) +#end if +self._$(id)_chooser = Qt.QComboBox(None) +$(win).addWidget(self._$(id)_chooser) + +self._$(id)_options = ['a', 'b', 'c'] + +self._$(id)_chooser.addItem('A') +self._$(id)_chooser.addItem('B') +self._$(id)_chooser.addItem('C') + +self._$(id)_chooser.currentIndexChanged.connect( + lambda i: self.set_$(id)(self._$(id)_options[i]) +) + +$(gui_hint()($win)) + self.set_$(id)($value) + self._$(id)_chooser.setCurrentIndex( + self._$(id)_options.index($id) +) + + Label + label + + string + #if $label() then 'none' else 'part'# + + + + Type + type + real + enum + part + + + + + + + + Default Value + value + 50 + $type + + + + + + GUI Hint + gui_hint + + gui_hint + part + + +This block creates a variable with enumerated choices. \ +The gui widget is implemented as a combo box or radio button group. \ +Leave the label blank to use the variable id as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + + diff --git a/gr-qtgui/grc/qtgui_variable_slider.xml b/gr-qtgui/grc/qtgui_variable_slider.xml index 239d90903..4eeb7a29b 100644 --- a/gr-qtgui/grc/qtgui_variable_slider.xml +++ b/gr-qtgui/grc/qtgui_variable_slider.xml @@ -19,7 +19,7 @@ $(win).addWidget(self._$(id)_tool_bar) #if $label() self._$(id)_tool_bar.addWidget(Qt.QLabel($label, None)) #else -self._$(id)_tool_bar.addWidget(Qt.QLabel($id, None)) +self._$(id)_tool_bar.addWidget(Qt.QLabel("$id", None)) #end if self._$(id)_counter = Qwt.QwtCounter(None) self._$(id)_counter.setRange($start, $stop, $step) diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index ed4d3c1d8..e6c7e0287 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -60,7 +60,6 @@ else: self.stop(); self.wait() generate_options wx_gui enum - #if $generate_options() == 'wx_gui' then 'part' else 'none'# - - Graphical Sinks - wxgui_numbersink2 - wxgui_scopesink2 - wxgui_fftsink2 - wxgui_constellationsink2 - wxgui_waterfallsink2 - wxgui_histosink2 - wxgui_termsink - qtgui_sink_x - Operators gr_add_xx @@ -139,7 +128,7 @@ gr_pll_freqdet_cf gr_pll_refout_cc - gr_fll_band_edge_cc + gr_fll_band_edge_cc gr_correlate_access_code_bb gr_pn_correlator_cc @@ -263,7 +252,7 @@ gr_additive_scrambler_bb - Vocoders + Vocoders blks2_cvsd_encode blks2_cvsd_decode @@ -311,7 +300,5 @@ xmlrpc_server xmlrpc_client - - notebook diff --git a/grc/blocks/notebook.xml b/grc/blocks/notebook.xml deleted file mode 100644 index d41db9e2d..000000000 --- a/grc/blocks/notebook.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - Notebook - notebook - from grc_gnuradio import wxgui as grc_wxgui - #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' -self.$(id) = wx.Notebook($(parent).GetWin(), style=$style) -#for $label in $labels() -self.$(id).AddPage(grc_wxgui.Panel(self.$(id)), "$label") -#end for -#if not $grid_pos() -$(parent).Add(self.$(id)) -#else -$(parent).GridAdd(self.$(id), $(', '.join(map(str, $grid_pos())))) -#end if - - Tab Orientation - style - wx.NB_TOP - enum - - - - - - - Labels - labels - ['tab1', 'tab2', 'tab3'] - raw - - - Grid Position - grid_pos - - grid_pos - - - Notebook - notebook - - notebook - - isinstance($labels, (list, tuple)) - all(map(lambda x: isinstance(x, str), $labels)) - len($labels) > 0 - -Use the Grid Position (row, column, row span, column span) to position the graphical element in the window. - -Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page. - - diff --git a/grc/python/Generator.py b/grc/python/Generator.py index 7d08b914b..b669fa65a 100644 --- a/grc/python/Generator.py +++ b/grc/python/Generator.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -90,22 +90,20 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') imports = self._flow_graph.get_imports() variables = self._flow_graph.get_variables() parameters = self._flow_graph.get_parameters() - #list of variables with controls - controls = filter(lambda v: v.get_make(), variables) #list of blocks not including variables and imports and parameters and disabled - blocks = sorted(self._flow_graph.get_enabled_blocks(), lambda x, y: cmp(x.get_id(), y.get_id())) - probes = filter(lambda b: b.get_key().startswith('probe_'), blocks) #ensure probes are last in the block list - #get a list of notebooks and sort them according dependencies - notebooks = expr_utils.sort_objects( - filter(lambda b: b.get_key() == 'notebook', blocks), - lambda n: n.get_id(), lambda n: n.get_param('notebook').get_value(), - ) - notebooks += expr_utils.sort_objects( - filter(lambda b: b.get_key() == 'qtgui_tab_widget', blocks), - lambda n: n.get_id(), lambda n: n.get_param('gui_hint').get_value(), + def _get_block_sort_text(block): + code = block.get_make().replace(block.get_id(), ' ') + try: code += block.get_param('notebook').get_value() #older gui markup w/ wxgui + except: pass + try: code += block.get_param('gui_hint').get_value() #newer gui markup w/ qtgui + except: pass + return code + blocks = expr_utils.sort_objects( + self._flow_graph.get_enabled_blocks(), + lambda b: b.get_id(), _get_block_sort_text ) #list of regular blocks (all blocks minus the special ones) - blocks = filter(lambda b: b not in (imports + parameters + variables + probes + notebooks), blocks) + probes + blocks = filter(lambda b: b not in (imports + parameters), blocks) #list of connections where each endpoint is enabled connections = filter(lambda c: not c.is_msg(), self._flow_graph.get_enabled_connections()) messages = filter(lambda c: c.is_msg(), self._flow_graph.get_enabled_connections()) @@ -129,8 +127,6 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') 'imports': imports, 'flow_graph': self._flow_graph, 'variables': variables, - 'notebooks': notebooks, - 'controls': controls, 'parameters': parameters, 'blocks': blocks, 'connections': connections, diff --git a/grc/python/Param.py b/grc/python/Param.py index 27258faab..303ab3ed8 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 88049a9ef..8757b5204 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -5,8 +5,6 @@ ##@param imports the import statements ##@param flow_graph the flow_graph ##@param variables the variable blocks -##@param notebooks a list of notebook blocks -##@param controls the variables with gui controls ##@param parameters the paramater blocks ##@param blocks the signal blocks ##@param connections the connections @@ -121,30 +119,6 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $indent($var.get_var_make()) #end for ######################################################## -##Create Notebooks -######################################################## -#if $notebooks - - $DIVIDER - # Notebooks - $DIVIDER -#end if -#for $notebook in $notebooks - $indent($notebook.get_make()) -#end for -######################################################## -##Create Controls -######################################################## -#if $controls - - $DIVIDER - # Controls - $DIVIDER -#end if -#for $ctrl in $controls - $indent($ctrl.get_make()) -#end for -######################################################## ##Create Message Queues ######################################################## #if $messages @@ -166,7 +140,11 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $DIVIDER #end if #for $blk in filter(lambda b: b.get_make(), $blocks) + #if $blk in $variables + $indent($blk.get_make()) + #else self.$blk.get_id() = $indent($blk.get_make()) + #end if #end for ######################################################## ##Create Connections -- cgit From c1ff442c8b450e7b0e41cd7b717d7368de3e6898 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 28 Feb 2011 11:09:40 -0800 Subject: grc-qtgui: work on variable chooser block --- gr-qtgui/grc/qtgui_tab_widget.xml | 5 +- gr-qtgui/grc/qtgui_variable_chooser.xml | 120 ++++++++++++++++++++++++++++---- 2 files changed, 108 insertions(+), 17 deletions(-) diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml index 3c4edfd35..efdeaa19a 100644 --- a/gr-qtgui/grc/qtgui_tab_widget.xml +++ b/gr-qtgui/grc/qtgui_tab_widget.xml @@ -11,14 +11,13 @@ from PyQt4 import Qt #set $win = 'self.%s'%$id Qt.QTabWidget(None) -#for i, label in enumerate([$label0, $label1, $label2, $label3, $label4]) -#if int($num_tabs()) > $i +#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_tabs())] +#for i, label in enumerate($all_labels) self.$(id)_widget_$(i) = Qt.QWidget() self.$(id)_layout_$(i) = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.$(id)_widget_$(i)) self.$(id)_grid_layout_$(i) = Qt.QGridLayout() self.$(id)_layout_$(i).addLayout(self.$(id)_grid_layout_$(i)) $(win).addTab(self.$(id)_widget_$(i), $label) -#end if #end for $(gui_hint()($win)) diff --git a/gr-qtgui/grc/qtgui_variable_chooser.xml b/gr-qtgui/grc/qtgui_variable_chooser.xml index d9c9c8f3f..7e3906902 100644 --- a/gr-qtgui/grc/qtgui_variable_chooser.xml +++ b/gr-qtgui/grc/qtgui_variable_chooser.xml @@ -21,17 +21,43 @@ $(win).addWidget(Qt.QLabel("$id", None)) #end if self._$(id)_chooser = Qt.QComboBox(None) $(win).addWidget(self._$(id)_chooser) - -self._$(id)_options = ['a', 'b', 'c'] - -self._$(id)_chooser.addItem('A') -self._$(id)_chooser.addItem('B') -self._$(id)_chooser.addItem('C') - +#set $all_options = [$option0, $option1, $option2][:int($num_opts())] +#set $all_labels = [$label0, $label1, $label2][:int($num_opts())] +######################################################################## +## Create the options list +######################################################################## +#if $num_opts() +self._$(id)_options = ( + #for $ch in $all_options + $ch, + #end for +) +#else +self._$(id)_options = $options +#end if +######################################################################## +## Create a widget for each item +######################################################################## +#if $num_opts() +self._$(id)_labels = ( + #for i, $lbl in enumerate($all_labels) + #if $lbl() + $lbl, + #else + str(self._$(id)_options[$i]), + #end if + #end for +) +#elif $labels +self._$(id)_labels = $labels +#else +self._$(id)_labels = map(str, self._$(id)_options) +#end if +for label in self._$(id)_labels: + self._$(id)_chooser.addItem(label) self._$(id)_chooser.currentIndexChanged.connect( lambda i: self.set_$(id)(self._$(id)_options[i]) ) - $(gui_hint()($win)) self.set_$(id)($value) self._$(id)_chooser.setCurrentIndex( @@ -44,7 +70,6 @@ $(gui_hint()($win)) string #if $label() then 'none' else 'part'# - Type type @@ -56,16 +81,78 @@ $(gui_hint()($win)) - + + Num Options + num_opts + 3 + enum + + + + + Default Value value 50 $type - - - + + Options + options + [0, 1, 2] + raw + #if int($num_opts()) then 'all' else 'none'# + + + Labels + labels + [] + raw + #if int($num_opts()) then 'all' else 'none'# + + + Option 0 + option0 + 0 + $type + #if int($num_opts()) > 0 then 'none' else 'all'# + + + Label 0 + label0 + + string + $((int($num_opts()) > 0) and ($label0() and 'none' or 'part') or 'all') + + + Option 1 + option1 + 1 + $type + #if int($num_opts()) > 1 then 'none' else 'all'# + + + Label 1 + label1 + + string + $((int($num_opts()) > 1) and ($label1() and 'none' or 'part') or 'all') + + + Option 2 + option2 + 2 + $type + #if int($num_opts()) > 2 then 'none' else 'all'# + + + Label 2 + label2 + + string + $((int($num_opts()) > 2) and ($label2() and 'none' or 'part') or 'all') + GUI Hint gui_hint @@ -74,10 +161,15 @@ $(gui_hint()($win)) part -This block creates a variable with enumerated choices. \ +This block creates a variable with enumerated options. \ The gui widget is implemented as a combo box or radio button group. \ Leave the label blank to use the variable id as the label. +Choose the number of options available to your chooser. \ +When the label is left blank, the option will be used as the label. \ +Set the number of options to "list" to enter a single list of options and labels. \ +When the labels is an empty list, the options will be used as the label. + The GUI hint can be used to position the widget within the application. \ The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ Both the tab specification and the grid position are optional. -- cgit From d829499725251ce5d1b9fd81a83cb92e0f3ebce3 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 28 Feb 2011 16:51:55 -0800 Subject: grc-qtgui: added radio button support, tweaks, more options --- gr-qtgui/grc/qtgui_variable_chooser.xml | 132 ++++++++++++++++++++++++++------ 1 file changed, 107 insertions(+), 25 deletions(-) diff --git a/gr-qtgui/grc/qtgui_variable_chooser.xml b/gr-qtgui/grc/qtgui_variable_chooser.xml index 7e3906902..632cfa099 100644 --- a/gr-qtgui/grc/qtgui_variable_chooser.xml +++ b/gr-qtgui/grc/qtgui_variable_chooser.xml @@ -12,39 +12,31 @@ from PyQt4 import Qt import PyQt4.Qwt5 as Qwt self.$(id) = $(id) = $value - #set $win = 'self._%s_tool_bar'%$id -$win = Qt.QToolBar(self) -#if $label() -$(win).addWidget(Qt.QLabel($label, None)) -#else -$(win).addWidget(Qt.QLabel("$id", None)) -#end if -self._$(id)_chooser = Qt.QComboBox(None) -$(win).addWidget(self._$(id)_chooser) -#set $all_options = [$option0, $option1, $option2][:int($num_opts())] -#set $all_labels = [$label0, $label1, $label2][:int($num_opts())] + #slurp +#set $all_options = [$option0, $option1, $option2, $option3, $option4][:int($num_opts())] +#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_opts())] ######################################################################## ## Create the options list ######################################################################## #if $num_opts() -self._$(id)_options = ( +self._$(id)_options = (#slurp #for $ch in $all_options - $ch, +$ch, #slurp #end for ) #else self._$(id)_options = $options #end if ######################################################################## -## Create a widget for each item +## Create the labels list ######################################################################## #if $num_opts() -self._$(id)_labels = ( +self._$(id)_labels = (#slurp #for i, $lbl in enumerate($all_labels) #if $lbl() - $lbl, +$lbl, #slurp #else - str(self._$(id)_options[$i]), +str(self._$(id)_options[$i]), #slurp #end if #end for ) @@ -53,16 +45,52 @@ self._$(id)_labels = $labels #else self._$(id)_labels = map(str, self._$(id)_options) #end if -for label in self._$(id)_labels: - self._$(id)_chooser.addItem(label) -self._$(id)_chooser.currentIndexChanged.connect( +######################################################################## +## Create the combo box +######################################################################## +#if $widget() == 'combo_box' +#set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if $label() +$(win).addWidget(Qt.QLabel($label+" ", None)) +#else +$(win).addWidget(Qt.QLabel("$id ", None)) +#end if +self._$(id)_combo_box = Qt.QComboBox(None) +$(win).addWidget(self._$(id)_combo_box) +for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) +self._$(id)_callback = lambda i: self._$(id)_combo_box.setCurrentIndex(self._$(id)_options.index(i)) +self._$(id)_callback(self.$id) +self._$(id)_combo_box.currentIndexChanged.connect( lambda i: self.set_$(id)(self._$(id)_options[i]) ) +#end if +######################################################################## +## Create the radio buttons +######################################################################## +#if $widget() == 'radio_buttons' +#set $win = 'self._%s_radio_group'%$id +#if $label() +$win = Qt.QGroupBox($label) +#else +$win = Qt.QGroupBox("$id") +#end if +self._$(id)_box = $(orient)() +self._$(id)_button_group = Qt.QButtonGroup() +$(win).setLayout(self._$(id)_box) +for i, label in enumerate(self._$(id)_labels): + radio_button = Qt.QRadioButton(label) + self._$(id)_box.addWidget(radio_button) + self._$(id)_button_group.addButton(radio_button, i) +self._$(id)_callback = lambda i: self._$(id)_button_group.button(self._$(id)_options.index(i)).setChecked(True) +self._$(id)_callback(self.$id) +self._$(id)_button_group.buttonClicked.connect( + lambda i: self.set_$(id)(self._$(id)_options[self._$(id)_button_group.checkedId()]) +) +#end if $(gui_hint()($win)) self.set_$(id)($value) - self._$(id)_chooser.setCurrentIndex( - self._$(id)_options.index($id) -) + self._$(id)_callback($id) Label label @@ -73,7 +101,7 @@ $(gui_hint()($win)) Type type - real + int enum part @@ -90,11 +118,13 @@ $(gui_hint()($win)) + + Default Value value - 50 + 0 $type @@ -153,6 +183,58 @@ $(gui_hint()($win)) string $((int($num_opts()) > 2) and ($label2() and 'none' or 'part') or 'all') + + Option 3 + option3 + 3 + $type + #if int($num_opts()) > 3 then 'none' else 'all'# + + + Label 3 + label3 + + string + $((int($num_opts()) > 3) and ($label3() and 'none' or 'part') or 'all') + + + Option 4 + option4 + 4 + $type + #if int($num_opts()) > 4 then 'none' else 'all'# + + + Label 4 + label4 + + string + $((int($num_opts()) > 4) and ($label4() and 'none' or 'part') or 'all') + + + Widget + widget + combo_box + enum + part + + + + + Orientation + orient + Qt.QVBoxLayout + enum + #if $widget() == 'radio_buttons' then 'part' else 'all'# + + + GUI Hint gui_hint -- cgit From c86fb3460c14cc308f0809e08f3fb460f70c08d9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 28 Feb 2011 19:15:29 -0800 Subject: grc-qtgui: pick correct signal overload for variable chooser --- gr-qtgui/grc/qtgui_variable_chooser.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gr-qtgui/grc/qtgui_variable_chooser.xml b/gr-qtgui/grc/qtgui_variable_chooser.xml index 632cfa099..b833fb8ad 100644 --- a/gr-qtgui/grc/qtgui_variable_chooser.xml +++ b/gr-qtgui/grc/qtgui_variable_chooser.xml @@ -62,8 +62,7 @@ for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) self._$(id)_callback = lambda i: self._$(id)_combo_box.setCurrentIndex(self._$(id)_options.index(i)) self._$(id)_callback(self.$id) self._$(id)_combo_box.currentIndexChanged.connect( - lambda i: self.set_$(id)(self._$(id)_options[i]) -) + lambda i: self.set_$(id)(self._$(id)_options[i])) #end if ######################################################################## ## Create the radio buttons @@ -84,9 +83,8 @@ for i, label in enumerate(self._$(id)_labels): self._$(id)_button_group.addButton(radio_button, i) self._$(id)_callback = lambda i: self._$(id)_button_group.button(self._$(id)_options.index(i)).setChecked(True) self._$(id)_callback(self.$id) -self._$(id)_button_group.buttonClicked.connect( - lambda i: self.set_$(id)(self._$(id)_options[self._$(id)_button_group.checkedId()]) -) +self._$(id)_button_group.buttonClicked[int].connect( + lambda i: self.set_$(id)(self._$(id)_options[i])) #end if $(gui_hint()($win)) self.set_$(id)($value) -- cgit From 931332448227a6b509a9b39bb68044fa55d8b1cb Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 1 Mar 2011 00:32:55 -0800 Subject: grc-qtgui: added variable text box and static text widgets --- gr-qtgui/grc/Makefile.am | 6 +- gr-qtgui/grc/qtgui_chooser.xml | 256 +++++++++++++++++++++++++++++++ gr-qtgui/grc/qtgui_slider.xml | 108 ++++++++++++++ gr-qtgui/grc/qtgui_static_text.xml | 65 ++++++++ gr-qtgui/grc/qtgui_text_box.xml | 67 +++++++++ gr-qtgui/grc/qtgui_variable_chooser.xml | 257 -------------------------------- gr-qtgui/grc/qtgui_variable_slider.xml | 108 -------------- 7 files changed, 500 insertions(+), 367 deletions(-) create mode 100644 gr-qtgui/grc/qtgui_chooser.xml create mode 100644 gr-qtgui/grc/qtgui_slider.xml create mode 100644 gr-qtgui/grc/qtgui_static_text.xml create mode 100644 gr-qtgui/grc/qtgui_text_box.xml delete mode 100644 gr-qtgui/grc/qtgui_variable_chooser.xml delete mode 100644 gr-qtgui/grc/qtgui_variable_slider.xml diff --git a/gr-qtgui/grc/Makefile.am b/gr-qtgui/grc/Makefile.am index e69d3a9af..1153fc976 100644 --- a/gr-qtgui/grc/Makefile.am +++ b/gr-qtgui/grc/Makefile.am @@ -25,6 +25,8 @@ grcblocksdir = $(grc_blocksdir) dist_grcblocks_DATA = \ qtgui_sink_x.xml \ + qtgui_static_text.xml \ qtgui_tab_widget.xml \ - qtgui_variable_chooser.xml \ - qtgui_variable_slider.xml + qtgui_text_box.xml \ + qtgui_chooser.xml \ + qtgui_slider.xml diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml new file mode 100644 index 000000000..5f383949e --- /dev/null +++ b/gr-qtgui/grc/qtgui_chooser.xml @@ -0,0 +1,256 @@ + + + + QT GUI Chooser + variable_qtgui_chooser + QT GUI Widgets + from PyQt4 import Qt + self.$(id) = $(id) = $value + #slurp +#set $all_options = [$option0, $option1, $option2, $option3, $option4][:int($num_opts())] +#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_opts())] +######################################################################## +## Create the options list +######################################################################## +#if $num_opts() +self._$(id)_options = (#slurp + #for $ch in $all_options +$ch, #slurp + #end for +) +#else +self._$(id)_options = $options +#end if +######################################################################## +## Create the labels list +######################################################################## +#if $num_opts() +self._$(id)_labels = (#slurp + #for i, $lbl in enumerate($all_labels) + #if $lbl() +$lbl, #slurp + #else +str(self._$(id)_options[$i]), #slurp + #end if + #end for +) +#elif $labels +self._$(id)_labels = $labels +#else +self._$(id)_labels = map(str, self._$(id)_options) +#end if +######################################################################## +## Create the combo box +######################################################################## +#if $widget() == 'combo_box' +#set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if $label() +$(win).addWidget(Qt.QLabel($label+" ", None)) +#else +$(win).addWidget(Qt.QLabel("$id ", None)) +#end if +self._$(id)_combo_box = Qt.QComboBox(None) +$(win).addWidget(self._$(id)_combo_box) +for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) +self._$(id)_callback = lambda i: self._$(id)_combo_box.setCurrentIndex(self._$(id)_options.index(i)) +self._$(id)_callback(self.$id) +self._$(id)_combo_box.currentIndexChanged.connect( + lambda i: self.set_$(id)(self._$(id)_options[i])) +#end if +######################################################################## +## Create the radio buttons +######################################################################## +#if $widget() == 'radio_buttons' +#set $win = 'self._%s_radio_group'%$id +#if $label() +$win = Qt.QGroupBox($label) +#else +$win = Qt.QGroupBox("$id") +#end if +self._$(id)_box = $(orient)() +self._$(id)_button_group = Qt.QButtonGroup() +$(win).setLayout(self._$(id)_box) +for i, label in enumerate(self._$(id)_labels): + radio_button = Qt.QRadioButton(label) + self._$(id)_box.addWidget(radio_button) + self._$(id)_button_group.addButton(radio_button, i) +self._$(id)_callback = lambda i: self._$(id)_button_group.button(self._$(id)_options.index(i)).setChecked(True) +self._$(id)_callback(self.$id) +self._$(id)_button_group.buttonClicked[int].connect( + lambda i: self.set_$(id)(self._$(id)_options[i])) +#end if +$(gui_hint()($win)) + self.set_$(id)($value) + self._$(id)_callback($id) + + Label + label + + string + #if $label() then 'none' else 'part'# + + + Type + type + int + enum + part + + + + + + + Num Options + num_opts + 3 + enum + + + + + + + + + Default Value + value + 0 + $type + + + Options + options + [0, 1, 2] + raw + #if int($num_opts()) then 'all' else 'none'# + + + Labels + labels + [] + raw + #if int($num_opts()) then 'all' else 'none'# + + + Option 0 + option0 + 0 + $type + #if int($num_opts()) > 0 then 'none' else 'all'# + + + Label 0 + label0 + + string + $((int($num_opts()) > 0) and ($label0() and 'none' or 'part') or 'all') + + + Option 1 + option1 + 1 + $type + #if int($num_opts()) > 1 then 'none' else 'all'# + + + Label 1 + label1 + + string + $((int($num_opts()) > 1) and ($label1() and 'none' or 'part') or 'all') + + + Option 2 + option2 + 2 + $type + #if int($num_opts()) > 2 then 'none' else 'all'# + + + Label 2 + label2 + + string + $((int($num_opts()) > 2) and ($label2() and 'none' or 'part') or 'all') + + + Option 3 + option3 + 3 + $type + #if int($num_opts()) > 3 then 'none' else 'all'# + + + Label 3 + label3 + + string + $((int($num_opts()) > 3) and ($label3() and 'none' or 'part') or 'all') + + + Option 4 + option4 + 4 + $type + #if int($num_opts()) > 4 then 'none' else 'all'# + + + Label 4 + label4 + + string + $((int($num_opts()) > 4) and ($label4() and 'none' or 'part') or 'all') + + + Widget + widget + combo_box + enum + part + + + + + Orientation + orient + Qt.QVBoxLayout + enum + #if $widget() == 'radio_buttons' then 'part' else 'all'# + + + + + GUI Hint + gui_hint + + gui_hint + part + + +This block creates a variable with enumerated options. \ +The gui widget is implemented as a combo box or radio button group. \ +Leave the label blank to use the variable id as the label. + +Choose the number of options available to your chooser. \ +When the label is left blank, the option will be used as the label. \ +Set the number of options to "list" to enter a single list of options and labels. \ +When the labels is an empty list, the options will be used as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + + diff --git a/gr-qtgui/grc/qtgui_slider.xml b/gr-qtgui/grc/qtgui_slider.xml new file mode 100644 index 000000000..68000fa2f --- /dev/null +++ b/gr-qtgui/grc/qtgui_slider.xml @@ -0,0 +1,108 @@ + + + + QT GUI Slider + variable_qtgui_slider + QT GUI Widgets + from PyQt4 import Qt + import PyQt4.Qwt5 as Qwt + self.$(id) = $(id) = $value + #set $win = '_%s_layout'%$id +$win = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom) +self._$(id)_tool_bar = Qt.QToolBar(self) +$(win).addWidget(self._$(id)_tool_bar) +#if $label() +self._$(id)_tool_bar.addWidget(Qt.QLabel($label, None)) +#else +self._$(id)_tool_bar.addWidget(Qt.QLabel("$id", None)) +#end if +self._$(id)_counter = Qwt.QwtCounter(None) +self._$(id)_counter.setRange($start, $stop, $step) +self._$(id)_counter.setNumButtons(2) +self._$(id)_counter.setValue($value) +self._$(id)_tool_bar.addWidget(self._$(id)_counter) +self._$(id)_counter.valueChanged.connect(self.set_$(id)) +self._$(id)_slider = Qwt.QwtSlider(None) +self._$(id)_slider.setRange($start, $stop, $step) +self._$(id)_slider.setValue($value) +self._$(id)_slider.setOrientation(Qt.$orient) +self._$(id)_slider.setScalePosition($orient.scalepos) +self._$(id)_slider.valueChanged.connect(self.set_$(id)) +$(win).addWidget(self._$(id)_slider) +$(gui_hint()($win)) + self.set_$(id)($value) + self._$(id)_counter.setValue($id) + self._$(id)_slider.setValue($id) + + Label + label + + string + #if $label() then 'none' else 'part'# + + + Default Value + value + 50 + real + + + Start + start + 0 + real + + + Stop + stop + 100 + real + + + Step + step + 1 + real + + + Orientation + orient + Qt.Horizontal + enum + part + + + + + GUI Hint + gui_hint + + gui_hint + part + + $start <= $value <= $stop + $start < $stop + +This block creates a variable with a slider. \ +Leave the label blank to use the variable id as the label. \ +The value must be a real number. \ +The value must be between the start and the stop. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + + diff --git a/gr-qtgui/grc/qtgui_static_text.xml b/gr-qtgui/grc/qtgui_static_text.xml new file mode 100644 index 000000000..92346b071 --- /dev/null +++ b/gr-qtgui/grc/qtgui_static_text.xml @@ -0,0 +1,65 @@ + + + + QT GUI Static Text + variable_qtgui_static_text + QT GUI Widgets + from PyQt4 import Qt + self.$(id) = $(id) = $value + #set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if $label() +$(win).addWidget(Qt.QLabel($label+" ", None)) +#else +$(win).addWidget(Qt.QLabel("$id ", None)) +#end if +self._$(id)_label = Qt.QLabel(str(self.$id)) +self._$(id)_tool_bar.addWidget(self._$(id)_label) +$(gui_hint()($win)) + self.set_$(id)($value) + self._$(id)_label.setText(str($id)) + + Label + label + + string + #if $label() then 'none' else 'part'# + + + Type + type + int + enum + part + + + + + + + Default Value + value + 0 + $type + + + GUI Hint + gui_hint + + gui_hint + part + + +This block creates a variable with a static text widget. \ +Leave the label blank to use the variable id as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + + diff --git a/gr-qtgui/grc/qtgui_text_box.xml b/gr-qtgui/grc/qtgui_text_box.xml new file mode 100644 index 000000000..4fd961f55 --- /dev/null +++ b/gr-qtgui/grc/qtgui_text_box.xml @@ -0,0 +1,67 @@ + + + + QT GUI Text Box + variable_qtgui_text_box + QT GUI Widgets + from PyQt4 import Qt + self.$(id) = $(id) = $value + #set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if $label() +$(win).addWidget(Qt.QLabel($label+" ", None)) +#else +$(win).addWidget(Qt.QLabel("$id ", None)) +#end if +self._$(id)_line_edit = Qt.QLineEdit(str(self.$id)) +self._$(id)_tool_bar.addWidget(self._$(id)_line_edit) +self._$(id)_line_edit.returnPressed.connect( + lambda: self.set_$(id)($(type.conv)(self._$(id)_line_edit.text()))) +$(gui_hint()($win)) + self.set_$(id)($value) + self._$(id)_line_edit.setText(str($id)) + + Label + label + + string + #if $label() then 'none' else 'part'# + + + Type + type + int + enum + part + + + + + + + Default Value + value + 0 + $type + + + GUI Hint + gui_hint + + gui_hint + part + + +This block creates a variable with text box entry. \ +Leave the label blank to use the variable id as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + + diff --git a/gr-qtgui/grc/qtgui_variable_chooser.xml b/gr-qtgui/grc/qtgui_variable_chooser.xml deleted file mode 100644 index b833fb8ad..000000000 --- a/gr-qtgui/grc/qtgui_variable_chooser.xml +++ /dev/null @@ -1,257 +0,0 @@ - - - - QT GUI Chooser - variable_qtgui_chooser - QT GUI Widgets - from PyQt4 import Qt - import PyQt4.Qwt5 as Qwt - self.$(id) = $(id) = $value - #slurp -#set $all_options = [$option0, $option1, $option2, $option3, $option4][:int($num_opts())] -#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_opts())] -######################################################################## -## Create the options list -######################################################################## -#if $num_opts() -self._$(id)_options = (#slurp - #for $ch in $all_options -$ch, #slurp - #end for -) -#else -self._$(id)_options = $options -#end if -######################################################################## -## Create the labels list -######################################################################## -#if $num_opts() -self._$(id)_labels = (#slurp - #for i, $lbl in enumerate($all_labels) - #if $lbl() -$lbl, #slurp - #else -str(self._$(id)_options[$i]), #slurp - #end if - #end for -) -#elif $labels -self._$(id)_labels = $labels -#else -self._$(id)_labels = map(str, self._$(id)_options) -#end if -######################################################################## -## Create the combo box -######################################################################## -#if $widget() == 'combo_box' -#set $win = 'self._%s_tool_bar'%$id -$win = Qt.QToolBar(self) -#if $label() -$(win).addWidget(Qt.QLabel($label+" ", None)) -#else -$(win).addWidget(Qt.QLabel("$id ", None)) -#end if -self._$(id)_combo_box = Qt.QComboBox(None) -$(win).addWidget(self._$(id)_combo_box) -for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) -self._$(id)_callback = lambda i: self._$(id)_combo_box.setCurrentIndex(self._$(id)_options.index(i)) -self._$(id)_callback(self.$id) -self._$(id)_combo_box.currentIndexChanged.connect( - lambda i: self.set_$(id)(self._$(id)_options[i])) -#end if -######################################################################## -## Create the radio buttons -######################################################################## -#if $widget() == 'radio_buttons' -#set $win = 'self._%s_radio_group'%$id -#if $label() -$win = Qt.QGroupBox($label) -#else -$win = Qt.QGroupBox("$id") -#end if -self._$(id)_box = $(orient)() -self._$(id)_button_group = Qt.QButtonGroup() -$(win).setLayout(self._$(id)_box) -for i, label in enumerate(self._$(id)_labels): - radio_button = Qt.QRadioButton(label) - self._$(id)_box.addWidget(radio_button) - self._$(id)_button_group.addButton(radio_button, i) -self._$(id)_callback = lambda i: self._$(id)_button_group.button(self._$(id)_options.index(i)).setChecked(True) -self._$(id)_callback(self.$id) -self._$(id)_button_group.buttonClicked[int].connect( - lambda i: self.set_$(id)(self._$(id)_options[i])) -#end if -$(gui_hint()($win)) - self.set_$(id)($value) - self._$(id)_callback($id) - - Label - label - - string - #if $label() then 'none' else 'part'# - - - Type - type - int - enum - part - - - - - - - Num Options - num_opts - 3 - enum - - - - - - - - - Default Value - value - 0 - $type - - - Options - options - [0, 1, 2] - raw - #if int($num_opts()) then 'all' else 'none'# - - - Labels - labels - [] - raw - #if int($num_opts()) then 'all' else 'none'# - - - Option 0 - option0 - 0 - $type - #if int($num_opts()) > 0 then 'none' else 'all'# - - - Label 0 - label0 - - string - $((int($num_opts()) > 0) and ($label0() and 'none' or 'part') or 'all') - - - Option 1 - option1 - 1 - $type - #if int($num_opts()) > 1 then 'none' else 'all'# - - - Label 1 - label1 - - string - $((int($num_opts()) > 1) and ($label1() and 'none' or 'part') or 'all') - - - Option 2 - option2 - 2 - $type - #if int($num_opts()) > 2 then 'none' else 'all'# - - - Label 2 - label2 - - string - $((int($num_opts()) > 2) and ($label2() and 'none' or 'part') or 'all') - - - Option 3 - option3 - 3 - $type - #if int($num_opts()) > 3 then 'none' else 'all'# - - - Label 3 - label3 - - string - $((int($num_opts()) > 3) and ($label3() and 'none' or 'part') or 'all') - - - Option 4 - option4 - 4 - $type - #if int($num_opts()) > 4 then 'none' else 'all'# - - - Label 4 - label4 - - string - $((int($num_opts()) > 4) and ($label4() and 'none' or 'part') or 'all') - - - Widget - widget - combo_box - enum - part - - - - - Orientation - orient - Qt.QVBoxLayout - enum - #if $widget() == 'radio_buttons' then 'part' else 'all'# - - - - - GUI Hint - gui_hint - - gui_hint - part - - -This block creates a variable with enumerated options. \ -The gui widget is implemented as a combo box or radio button group. \ -Leave the label blank to use the variable id as the label. - -Choose the number of options available to your chooser. \ -When the label is left blank, the option will be used as the label. \ -Set the number of options to "list" to enter a single list of options and labels. \ -When the labels is an empty list, the options will be used as the label. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - - diff --git a/gr-qtgui/grc/qtgui_variable_slider.xml b/gr-qtgui/grc/qtgui_variable_slider.xml deleted file mode 100644 index 68000fa2f..000000000 --- a/gr-qtgui/grc/qtgui_variable_slider.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - QT GUI Slider - variable_qtgui_slider - QT GUI Widgets - from PyQt4 import Qt - import PyQt4.Qwt5 as Qwt - self.$(id) = $(id) = $value - #set $win = '_%s_layout'%$id -$win = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom) -self._$(id)_tool_bar = Qt.QToolBar(self) -$(win).addWidget(self._$(id)_tool_bar) -#if $label() -self._$(id)_tool_bar.addWidget(Qt.QLabel($label, None)) -#else -self._$(id)_tool_bar.addWidget(Qt.QLabel("$id", None)) -#end if -self._$(id)_counter = Qwt.QwtCounter(None) -self._$(id)_counter.setRange($start, $stop, $step) -self._$(id)_counter.setNumButtons(2) -self._$(id)_counter.setValue($value) -self._$(id)_tool_bar.addWidget(self._$(id)_counter) -self._$(id)_counter.valueChanged.connect(self.set_$(id)) -self._$(id)_slider = Qwt.QwtSlider(None) -self._$(id)_slider.setRange($start, $stop, $step) -self._$(id)_slider.setValue($value) -self._$(id)_slider.setOrientation(Qt.$orient) -self._$(id)_slider.setScalePosition($orient.scalepos) -self._$(id)_slider.valueChanged.connect(self.set_$(id)) -$(win).addWidget(self._$(id)_slider) -$(gui_hint()($win)) - self.set_$(id)($value) - self._$(id)_counter.setValue($id) - self._$(id)_slider.setValue($id) - - Label - label - - string - #if $label() then 'none' else 'part'# - - - Default Value - value - 50 - real - - - Start - start - 0 - real - - - Stop - stop - 100 - real - - - Step - step - 1 - real - - - Orientation - orient - Qt.Horizontal - enum - part - - - - - GUI Hint - gui_hint - - gui_hint - part - - $start <= $value <= $stop - $start < $stop - -This block creates a variable with a slider. \ -Leave the label blank to use the variable id as the label. \ -The value must be a real number. \ -The value must be between the start and the stop. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - - -- cgit From a09e0096cf717c137126cd5fb721c0331a1a8df6 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 1 Mar 2011 13:03:36 -0800 Subject: grc-qtgui: creaded check box widget with qtgui, cleanup label code --- gr-qtgui/grc/Makefile.am | 1 + gr-qtgui/grc/qtgui_check_box.xml | 83 ++++++++++++++++++++++++++++++++++++++ gr-qtgui/grc/qtgui_chooser.xml | 13 ++---- gr-qtgui/grc/qtgui_slider.xml | 7 ++-- gr-qtgui/grc/qtgui_static_text.xml | 8 ++-- gr-qtgui/grc/qtgui_text_box.xml | 8 ++-- 6 files changed, 99 insertions(+), 21 deletions(-) create mode 100644 gr-qtgui/grc/qtgui_check_box.xml diff --git a/gr-qtgui/grc/Makefile.am b/gr-qtgui/grc/Makefile.am index 1153fc976..23e01a2c6 100644 --- a/gr-qtgui/grc/Makefile.am +++ b/gr-qtgui/grc/Makefile.am @@ -24,6 +24,7 @@ include $(top_srcdir)/Makefile.common grcblocksdir = $(grc_blocksdir) dist_grcblocks_DATA = \ + qtgui_check_box.xml \ qtgui_sink_x.xml \ qtgui_static_text.xml \ qtgui_tab_widget.xml \ diff --git a/gr-qtgui/grc/qtgui_check_box.xml b/gr-qtgui/grc/qtgui_check_box.xml new file mode 100644 index 000000000..95f4f968a --- /dev/null +++ b/gr-qtgui/grc/qtgui_check_box.xml @@ -0,0 +1,83 @@ + + + + QT GUI Check Box + variable_qtgui_check_box + QT GUI Widgets + from PyQt4 import Qt + self.$(id) = $(id) = $value + #set $win = '_%s_check_box'%$id +#if not $label() + #set $label = '"%s"'%$id +#end if +$win = Qt.QCheckBox($label) +self._$(id)_choices = {True: $true, False: $false} +self._$(id)_choices_inv = dict((v,k) for k,v in self._$(id)_choices.iteritems()) +self._$(id)_callback = lambda i: $(win).setChecked(self._$(id)_choices_inv[i]) +self._$(id)_callback(self.$id) +$(win).stateChanged.connect(lambda i: self.set_$(id)(self._$(id)_choices[bool(i)])) +$(gui_hint()($win)) + self.set_$(id)($value) + self._$(id)_callback($id) + + Label + label + + string + #if $label() then 'none' else 'part'# + + + Type + type + int + enum + part + + + + + + + + Default Value + value + True + $type + + + True + true + True + $type + + + False + false + False + $type + + + GUI Hint + gui_hint + + gui_hint + part + + $value in ($true, $false) + +This block creates a variable check box. \ +Leave the label blank to use the variable id as the label. + +A check box selects between two values of similar type. \ +Te values do not necessarily need to be of boolean type. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + + diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml index 5f383949e..0d95c7cda 100644 --- a/gr-qtgui/grc/qtgui_chooser.xml +++ b/gr-qtgui/grc/qtgui_chooser.xml @@ -14,6 +14,9 @@ #slurp #set $all_options = [$option0, $option1, $option2, $option3, $option4][:int($num_opts())] #set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_opts())] +#if not $label() + #set $label = '"%s"'%$id +#end if ######################################################################## ## Create the options list ######################################################################## @@ -50,11 +53,7 @@ self._$(id)_labels = map(str, self._$(id)_options) #if $widget() == 'combo_box' #set $win = 'self._%s_tool_bar'%$id $win = Qt.QToolBar(self) -#if $label() $(win).addWidget(Qt.QLabel($label+" ", None)) -#else -$(win).addWidget(Qt.QLabel("$id ", None)) -#end if self._$(id)_combo_box = Qt.QComboBox(None) $(win).addWidget(self._$(id)_combo_box) for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) @@ -67,12 +66,8 @@ self._$(id)_combo_box.currentIndexChanged.connect( ## Create the radio buttons ######################################################################## #if $widget() == 'radio_buttons' -#set $win = 'self._%s_radio_group'%$id -#if $label() +#set $win = 'self._%s_group_box'%$id $win = Qt.QGroupBox($label) -#else -$win = Qt.QGroupBox("$id") -#end if self._$(id)_box = $(orient)() self._$(id)_button_group = Qt.QButtonGroup() $(win).setLayout(self._$(id)_box) diff --git a/gr-qtgui/grc/qtgui_slider.xml b/gr-qtgui/grc/qtgui_slider.xml index 68000fa2f..e29123878 100644 --- a/gr-qtgui/grc/qtgui_slider.xml +++ b/gr-qtgui/grc/qtgui_slider.xml @@ -16,11 +16,10 @@ $win = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom) self._$(id)_tool_bar = Qt.QToolBar(self) $(win).addWidget(self._$(id)_tool_bar) -#if $label() -self._$(id)_tool_bar.addWidget(Qt.QLabel($label, None)) -#else -self._$(id)_tool_bar.addWidget(Qt.QLabel("$id", None)) +#if not $label() + #set $label = '"%s"'%$id #end if +self._$(id)_tool_bar.addWidget(Qt.QLabel($label, None)) self._$(id)_counter = Qwt.QwtCounter(None) self._$(id)_counter.setRange($start, $stop, $step) self._$(id)_counter.setNumButtons(2) diff --git a/gr-qtgui/grc/qtgui_static_text.xml b/gr-qtgui/grc/qtgui_static_text.xml index 92346b071..f20bf7e69 100644 --- a/gr-qtgui/grc/qtgui_static_text.xml +++ b/gr-qtgui/grc/qtgui_static_text.xml @@ -13,11 +13,10 @@ self.$(id) = $(id) = $value #set $win = 'self._%s_tool_bar'%$id $win = Qt.QToolBar(self) -#if $label() -$(win).addWidget(Qt.QLabel($label+" ", None)) -#else -$(win).addWidget(Qt.QLabel("$id ", None)) +#if not $label() + #set $label = '"%s"'%$id #end if +$(win).addWidget(Qt.QLabel($label+" ", None)) self._$(id)_label = Qt.QLabel(str(self.$id)) self._$(id)_tool_bar.addWidget(self._$(id)_label) $(gui_hint()($win)) @@ -39,6 +38,7 @@ $(gui_hint()($win)) + diff --git a/gr-qtgui/grc/qtgui_text_box.xml b/gr-qtgui/grc/qtgui_text_box.xml index 4fd961f55..0d7fe36ee 100644 --- a/gr-qtgui/grc/qtgui_text_box.xml +++ b/gr-qtgui/grc/qtgui_text_box.xml @@ -13,11 +13,10 @@ self.$(id) = $(id) = $value #set $win = 'self._%s_tool_bar'%$id $win = Qt.QToolBar(self) -#if $label() -$(win).addWidget(Qt.QLabel($label+" ", None)) -#else -$(win).addWidget(Qt.QLabel("$id ", None)) +#if not $label() + #set $label = '"%s"'%$id #end if +$(win).addWidget(Qt.QLabel($label+" ", None)) self._$(id)_line_edit = Qt.QLineEdit(str(self.$id)) self._$(id)_tool_bar.addWidget(self._$(id)_line_edit) self._$(id)_line_edit.returnPressed.connect( @@ -41,6 +40,7 @@ $(gui_hint()($win)) + -- cgit From fb5d1b80dc97bf940079b5a4b3b3f35002cc60aa Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 1 Mar 2011 18:05:34 -0800 Subject: qtgui-grc: rename the text entry and label blocks --- gr-qtgui/grc/Makefile.am | 4 +-- gr-qtgui/grc/qtgui_entry.xml | 67 ++++++++++++++++++++++++++++++++++++++ gr-qtgui/grc/qtgui_label.xml | 65 ++++++++++++++++++++++++++++++++++++ gr-qtgui/grc/qtgui_static_text.xml | 65 ------------------------------------ gr-qtgui/grc/qtgui_text_box.xml | 67 -------------------------------------- 5 files changed, 134 insertions(+), 134 deletions(-) create mode 100644 gr-qtgui/grc/qtgui_entry.xml create mode 100644 gr-qtgui/grc/qtgui_label.xml delete mode 100644 gr-qtgui/grc/qtgui_static_text.xml delete mode 100644 gr-qtgui/grc/qtgui_text_box.xml diff --git a/gr-qtgui/grc/Makefile.am b/gr-qtgui/grc/Makefile.am index 23e01a2c6..3045a8779 100644 --- a/gr-qtgui/grc/Makefile.am +++ b/gr-qtgui/grc/Makefile.am @@ -25,9 +25,9 @@ grcblocksdir = $(grc_blocksdir) dist_grcblocks_DATA = \ qtgui_check_box.xml \ + qtgui_entry.xml \ + qtgui_label.xml \ qtgui_sink_x.xml \ - qtgui_static_text.xml \ qtgui_tab_widget.xml \ - qtgui_text_box.xml \ qtgui_chooser.xml \ qtgui_slider.xml diff --git a/gr-qtgui/grc/qtgui_entry.xml b/gr-qtgui/grc/qtgui_entry.xml new file mode 100644 index 000000000..63c14ad8f --- /dev/null +++ b/gr-qtgui/grc/qtgui_entry.xml @@ -0,0 +1,67 @@ + + + + QT GUI Entry + variable_qtgui_entry + QT GUI Widgets + from PyQt4 import Qt + self.$(id) = $(id) = $value + #set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if not $label() + #set $label = '"%s"'%$id +#end if +$(win).addWidget(Qt.QLabel($label+" ", None)) +self._$(id)_line_edit = Qt.QLineEdit(str(self.$id)) +self._$(id)_tool_bar.addWidget(self._$(id)_line_edit) +self._$(id)_line_edit.returnPressed.connect( + lambda: self.set_$(id)($(type.conv)(self._$(id)_line_edit.text()))) +$(gui_hint()($win)) + self.set_$(id)($value) + self._$(id)_line_edit.setText(str($id)) + + Label + label + + string + #if $label() then 'none' else 'part'# + + + Type + type + int + enum + part + + + + + + + + Default Value + value + 0 + $type + + + GUI Hint + gui_hint + + gui_hint + part + + +This block creates a variable with a text entry box. \ +Leave the label blank to use the variable id as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + + diff --git a/gr-qtgui/grc/qtgui_label.xml b/gr-qtgui/grc/qtgui_label.xml new file mode 100644 index 000000000..90286d0b2 --- /dev/null +++ b/gr-qtgui/grc/qtgui_label.xml @@ -0,0 +1,65 @@ + + + + QT GUI Label + variable_qtgui_label + QT GUI Widgets + from PyQt4 import Qt + self.$(id) = $(id) = $value + #set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if not $label() + #set $label = '"%s"'%$id +#end if +$(win).addWidget(Qt.QLabel($label+" ", None)) +self._$(id)_label = Qt.QLabel(str(self.$id)) +self._$(id)_tool_bar.addWidget(self._$(id)_label) +$(gui_hint()($win)) + self.set_$(id)($value) + self._$(id)_label.setText(str($id)) + + Label + label + + string + #if $label() then 'none' else 'part'# + + + Type + type + int + enum + part + + + + + + + + Default Value + value + 0 + $type + + + GUI Hint + gui_hint + + gui_hint + part + + +This block creates a variable with a label widget for text. \ +Leave the label blank to use the variable id as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + + diff --git a/gr-qtgui/grc/qtgui_static_text.xml b/gr-qtgui/grc/qtgui_static_text.xml deleted file mode 100644 index f20bf7e69..000000000 --- a/gr-qtgui/grc/qtgui_static_text.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - QT GUI Static Text - variable_qtgui_static_text - QT GUI Widgets - from PyQt4 import Qt - self.$(id) = $(id) = $value - #set $win = 'self._%s_tool_bar'%$id -$win = Qt.QToolBar(self) -#if not $label() - #set $label = '"%s"'%$id -#end if -$(win).addWidget(Qt.QLabel($label+" ", None)) -self._$(id)_label = Qt.QLabel(str(self.$id)) -self._$(id)_tool_bar.addWidget(self._$(id)_label) -$(gui_hint()($win)) - self.set_$(id)($value) - self._$(id)_label.setText(str($id)) - - Label - label - - string - #if $label() then 'none' else 'part'# - - - Type - type - int - enum - part - - - - - - - - Default Value - value - 0 - $type - - - GUI Hint - gui_hint - - gui_hint - part - - -This block creates a variable with a static text widget. \ -Leave the label blank to use the variable id as the label. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - - diff --git a/gr-qtgui/grc/qtgui_text_box.xml b/gr-qtgui/grc/qtgui_text_box.xml deleted file mode 100644 index 0d7fe36ee..000000000 --- a/gr-qtgui/grc/qtgui_text_box.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - QT GUI Text Box - variable_qtgui_text_box - QT GUI Widgets - from PyQt4 import Qt - self.$(id) = $(id) = $value - #set $win = 'self._%s_tool_bar'%$id -$win = Qt.QToolBar(self) -#if not $label() - #set $label = '"%s"'%$id -#end if -$(win).addWidget(Qt.QLabel($label+" ", None)) -self._$(id)_line_edit = Qt.QLineEdit(str(self.$id)) -self._$(id)_tool_bar.addWidget(self._$(id)_line_edit) -self._$(id)_line_edit.returnPressed.connect( - lambda: self.set_$(id)($(type.conv)(self._$(id)_line_edit.text()))) -$(gui_hint()($win)) - self.set_$(id)($value) - self._$(id)_line_edit.setText(str($id)) - - Label - label - - string - #if $label() then 'none' else 'part'# - - - Type - type - int - enum - part - - - - - - - - Default Value - value - 0 - $type - - - GUI Hint - gui_hint - - gui_hint - part - - -This block creates a variable with text box entry. \ -Leave the label blank to use the variable id as the label. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - - -- cgit From fedf4fbc9d217926ecbb1917d3c995516d88a8a9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 1 Mar 2011 18:18:53 -0800 Subject: qtgui-grc: enable start/stop control through qt widgets --- grc/blocks/options.xml | 2 +- grc/python/flow_graph.tmpl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index e6c7e0287..b27ea900c 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -105,7 +105,7 @@ else: self.stop(); self.wait() True bool -#if $generate_options() == 'wx_gui' +#if $generate_options() in ('qt_gui', 'wx_gui') #if $run() part #else diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 8757b5204..854d83967 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -235,7 +235,9 @@ if __name__ == '__main__': #elif $generate_options == 'qt_gui' qapp = Qt.QApplication(sys.argv) tb = $(class_name)($(', '.join($params_eq_list))) + #if $flow_graph.get_option('run') tb.start() + #end if tb.show() qapp.exec_() #elif $generate_options == 'no_gui' -- cgit From 47096a9ec323ad88c83afbaefa4686284449048c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 2 Mar 2011 22:13:11 -0800 Subject: qtgui-grc: add engineering notation to entry and label + other tweaks --- gr-qtgui/grc/qtgui_chooser.xml | 2 +- gr-qtgui/grc/qtgui_entry.xml | 17 +++++++++-------- gr-qtgui/grc/qtgui_label.xml | 15 ++++++++------- gr-qtgui/grc/qtgui_slider.xml | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml index 0d95c7cda..d06a229b4 100644 --- a/gr-qtgui/grc/qtgui_chooser.xml +++ b/gr-qtgui/grc/qtgui_chooser.xml @@ -53,7 +53,7 @@ self._$(id)_labels = map(str, self._$(id)_options) #if $widget() == 'combo_box' #set $win = 'self._%s_tool_bar'%$id $win = Qt.QToolBar(self) -$(win).addWidget(Qt.QLabel($label+" ", None)) +$(win).addWidget(Qt.QLabel($label+": ", None)) self._$(id)_combo_box = Qt.QComboBox(None) $(win).addWidget(self._$(id)_combo_box) for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) diff --git a/gr-qtgui/grc/qtgui_entry.xml b/gr-qtgui/grc/qtgui_entry.xml index 63c14ad8f..32c879420 100644 --- a/gr-qtgui/grc/qtgui_entry.xml +++ b/gr-qtgui/grc/qtgui_entry.xml @@ -10,20 +10,21 @@ variable_qtgui_entry QT GUI Widgets from PyQt4 import Qt + from gnuradio import eng_notation self.$(id) = $(id) = $value #set $win = 'self._%s_tool_bar'%$id $win = Qt.QToolBar(self) #if not $label() #set $label = '"%s"'%$id #end if -$(win).addWidget(Qt.QLabel($label+" ", None)) +$(win).addWidget(Qt.QLabel($label+": ", None)) self._$(id)_line_edit = Qt.QLineEdit(str(self.$id)) self._$(id)_tool_bar.addWidget(self._$(id)_line_edit) self._$(id)_line_edit.returnPressed.connect( - lambda: self.set_$(id)($(type.conv)(self._$(id)_line_edit.text()))) + lambda: self.set_$(id)($(type.conv)(self._$(id)_line_edit.text().toAscii()))) $(gui_hint()($win)) self.set_$(id)($value) - self._$(id)_line_edit.setText(str($id)) + self._$(id)_line_edit.setText($(type.str)($id)) Label label @@ -37,11 +38,11 @@ $(gui_hint()($win)) int enum part - - - - - + + + + + Default Value diff --git a/gr-qtgui/grc/qtgui_label.xml b/gr-qtgui/grc/qtgui_label.xml index 90286d0b2..96354688e 100644 --- a/gr-qtgui/grc/qtgui_label.xml +++ b/gr-qtgui/grc/qtgui_label.xml @@ -10,18 +10,19 @@ variable_qtgui_label QT GUI Widgets from PyQt4 import Qt + from gnuradio import eng_notation self.$(id) = $(id) = $value #set $win = 'self._%s_tool_bar'%$id $win = Qt.QToolBar(self) #if not $label() #set $label = '"%s"'%$id #end if -$(win).addWidget(Qt.QLabel($label+" ", None)) +$(win).addWidget(Qt.QLabel($label+": ", None)) self._$(id)_label = Qt.QLabel(str(self.$id)) self._$(id)_tool_bar.addWidget(self._$(id)_label) $(gui_hint()($win)) self.set_$(id)($value) - self._$(id)_label.setText(str($id)) + self._$(id)_label.setText($(type.str)($id)) Label label @@ -35,11 +36,11 @@ $(gui_hint()($win)) int enum part - - - - - + + + + + Default Value diff --git a/gr-qtgui/grc/qtgui_slider.xml b/gr-qtgui/grc/qtgui_slider.xml index e29123878..e71382b12 100644 --- a/gr-qtgui/grc/qtgui_slider.xml +++ b/gr-qtgui/grc/qtgui_slider.xml @@ -19,7 +19,7 @@ $(win).addWidget(self._$(id)_tool_bar) #if not $label() #set $label = '"%s"'%$id #end if -self._$(id)_tool_bar.addWidget(Qt.QLabel($label, None)) +self._$(id)_tool_bar.addWidget(Qt.QLabel($label+": ", None)) self._$(id)_counter = Qwt.QwtCounter(None) self._$(id)_counter.setRange($start, $stop, $step) self._$(id)_counter.setNumButtons(2) -- cgit From 5bffcb2b1443f85bf695b48b57e6b16634ba331c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 3 Mar 2011 22:16:55 -0800 Subject: qtgui-grc: made slider widget components (counter/slider) optional --- gr-qtgui/grc/qtgui_slider.xml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/gr-qtgui/grc/qtgui_slider.xml b/gr-qtgui/grc/qtgui_slider.xml index e71382b12..078e0df76 100644 --- a/gr-qtgui/grc/qtgui_slider.xml +++ b/gr-qtgui/grc/qtgui_slider.xml @@ -20,23 +20,31 @@ $(win).addWidget(self._$(id)_tool_bar) #set $label = '"%s"'%$id #end if self._$(id)_tool_bar.addWidget(Qt.QLabel($label+": ", None)) +#if int($widget.counter) self._$(id)_counter = Qwt.QwtCounter(None) self._$(id)_counter.setRange($start, $stop, $step) self._$(id)_counter.setNumButtons(2) -self._$(id)_counter.setValue($value) +self._$(id)_counter.setValue(self.$id) self._$(id)_tool_bar.addWidget(self._$(id)_counter) self._$(id)_counter.valueChanged.connect(self.set_$(id)) +#end if +#if int($widget.slider) self._$(id)_slider = Qwt.QwtSlider(None) self._$(id)_slider.setRange($start, $stop, $step) -self._$(id)_slider.setValue($value) +self._$(id)_slider.setValue(self.$id) self._$(id)_slider.setOrientation(Qt.$orient) self._$(id)_slider.setScalePosition($orient.scalepos) self._$(id)_slider.valueChanged.connect(self.set_$(id)) $(win).addWidget(self._$(id)_slider) +#end if $(gui_hint()($win)) self.set_$(id)($value) - self._$(id)_counter.setValue($id) - self._$(id)_slider.setValue($id) + #if int($widget.counter) +self._$(id)_counter.setValue($id) +#end if +#if int($widget.slider) +self._$(id)_slider.setValue($id) +#end if Label label @@ -68,6 +76,16 @@ $(gui_hint()($win)) 1 real + + Widget + widget + all + enum + part + + + + Orientation orient -- cgit From 028f105b345c937f69aa5701e0de7761a2c6fcf3 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 4 Mar 2011 09:08:37 -0800 Subject: qtgui-grc: use a vboxlayout for the top_layout --- grc/python/flow_graph.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 854d83967..070ad7ed1 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -63,7 +63,7 @@ class $(class_name)(gr.top_block, Qt.QWidget): def __init__($param_str): gr.top_block.__init__(self, "$title") Qt.QWidget.__init__(self) - self.top_layout = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self) + self.top_layout = Qt.QVBoxLayout(self) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) #elif $generate_options == 'no_gui' -- cgit From 19c0865b4b6c94f86679151e9f52c99331b1f0b9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 5 Mar 2011 20:37:40 -0800 Subject: qtgui-grc: moved slider to range, added knob and gui tweaks --- gr-qtgui/grc/Makefile.am | 4 +- gr-qtgui/grc/qtgui_range.xml | 184 ++++++++++++++++++++++++++++++++++++++++++ gr-qtgui/grc/qtgui_slider.xml | 125 ---------------------------- 3 files changed, 186 insertions(+), 127 deletions(-) create mode 100644 gr-qtgui/grc/qtgui_range.xml delete mode 100644 gr-qtgui/grc/qtgui_slider.xml diff --git a/gr-qtgui/grc/Makefile.am b/gr-qtgui/grc/Makefile.am index 3045a8779..b3114268c 100644 --- a/gr-qtgui/grc/Makefile.am +++ b/gr-qtgui/grc/Makefile.am @@ -27,7 +27,7 @@ dist_grcblocks_DATA = \ qtgui_check_box.xml \ qtgui_entry.xml \ qtgui_label.xml \ + qtgui_range.xml \ qtgui_sink_x.xml \ qtgui_tab_widget.xml \ - qtgui_chooser.xml \ - qtgui_slider.xml + qtgui_chooser.xml diff --git a/gr-qtgui/grc/qtgui_range.xml b/gr-qtgui/grc/qtgui_range.xml new file mode 100644 index 000000000..12807ec84 --- /dev/null +++ b/gr-qtgui/grc/qtgui_range.xml @@ -0,0 +1,184 @@ + + + + QT GUI Range + variable_qtgui_range + QT GUI Widgets + from PyQt4 import Qt + import PyQt4.Qwt5 as Qwt + from gnuradio import eng_notation + self.$(id) = $(id) = $value + #set $win = 'self._%s_layout'%$id +#if not $label() + #set $label = '"%s"'%$id +#end if +######################################################################## +#if $widget() == "knob" +######################################################################## +$win = Qt.QVBoxLayout() +self._$(id)_knob = Qwt.QwtKnob(None) +self._$(id)_knob.setRange($start, $stop, $step) +self._$(id)_knob.setValue(self.$id) +self._$(id)_knob.valueChanged.connect(self.set_$(id)) +$(win).addWidget(self._$(id)_knob) +self._$(id)_label = Qt.QLabel($label, None) +self._$(id)_label.setAlignment(Qt.Qt.AlignTop | Qt.Qt.AlignHCenter) +$(win).addWidget(self._$(id)_label) +#end if +######################################################################## +#if $widget() == "counter" +######################################################################## +$win = Qt.QHBoxLayout() +$(win).addWidget(Qt.QLabel($label+": ", None)) +self._$(id)_counter = Qwt.QwtCounter(None) +self._$(id)_counter.setRange($start, $stop, $step) +self._$(id)_counter.setNumButtons(2) +self._$(id)_counter.setMinimumWidth($min_len) +self._$(id)_counter.setValue(self.$id) +$(win).addWidget(self._$(id)_counter) +self._$(id)_counter.valueChanged.connect(self.set_$(id)) +#end if +######################################################################## +#if $widget() == "slider" +######################################################################## +$win = $(orient.layout)() +self._$(id)_slider = Qwt.QwtSlider(None, Qt.$orient, $orient.scalepos, Qwt.QwtSlider.BgSlot) +self._$(id)_slider.setRange($start, $stop, $step) +self._$(id)_slider.setValue(self.$id) +self._$(id)_slider.$(orient.minfcn)($min_len) +self._$(id)_slider.valueChanged.connect(self.set_$(id)) +$(win).addWidget(self._$(id)_slider) +self._$(id)_num = Qt.QLabel(eng_notation.num_to_str($id), None) +$(win).addWidget(self._$(id)_num) +#end if +######################################################################## +#if $widget() == "counter_slider" +######################################################################## +$win = Qt.QVBoxLayout() +self._$(id)_tool_bar = Qt.QToolBar(self) +$(win).addWidget(self._$(id)_tool_bar) +self._$(id)_tool_bar.addWidget(Qt.QLabel($label+": ", None)) +self._$(id)_counter = Qwt.QwtCounter(None) +self._$(id)_counter.setRange($start, $stop, $step) +self._$(id)_counter.setNumButtons(2) +self._$(id)_counter.setValue(self.$id) +self._$(id)_tool_bar.addWidget(self._$(id)_counter) +self._$(id)_counter.valueChanged.connect(self.set_$(id)) +self._$(id)_slider = Qwt.QwtSlider(None, Qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot) +self._$(id)_slider.setRange($start, $stop, $step) +self._$(id)_slider.setValue(self.$id) +self._$(id)_slider.setMinimumWidth($min_len) +self._$(id)_slider.valueChanged.connect(self.set_$(id)) +$(win).addWidget(self._$(id)_slider) +#end if +$(gui_hint()($win)) + self.set_$(id)($value) + #if $widget() == "knob" +self._$(id)_knob.setValue($id) +#end if +#if $widget() == "counter" +self._$(id)_counter.setValue($id) +#end if +#if $widget() == "slider" +self._$(id)_slider.setValue($id) +self._$(id)_num.setText(eng_notation.num_to_str($id)) +#end if +#if $widget() == "counter_slider" +self._$(id)_counter.setValue($id) +self._$(id)_slider.setValue($id) +#end if + + Label + label + + string + #if $label() then 'none' else 'part'# + + + Default Value + value + 50 + real + + + Start + start + 0 + real + + + Stop + stop + 100 + real + + + Step + step + 1 + real + + + Widget + widget + counter_slider + enum + part + + + + + + + Orientation + orient + Qt.Horizontal + enum + #if $widget() == "slider" then 'part' else 'all'# + + + + + Minimum Length + min_len + 200 + int + #if $widget().split('_')[0] in ("slider", "counter") then 'part' else 'all'# + + + GUI Hint + gui_hint + + gui_hint + part + + $start <= $value <= $stop + $start < $stop + +This block creates a variable with a slider. \ +Leave the label blank to use the variable id as the label. \ +The value must be a real number. \ +The value must be between the start and the stop. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + + diff --git a/gr-qtgui/grc/qtgui_slider.xml b/gr-qtgui/grc/qtgui_slider.xml deleted file mode 100644 index 078e0df76..000000000 --- a/gr-qtgui/grc/qtgui_slider.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - QT GUI Slider - variable_qtgui_slider - QT GUI Widgets - from PyQt4 import Qt - import PyQt4.Qwt5 as Qwt - self.$(id) = $(id) = $value - #set $win = '_%s_layout'%$id -$win = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom) -self._$(id)_tool_bar = Qt.QToolBar(self) -$(win).addWidget(self._$(id)_tool_bar) -#if not $label() - #set $label = '"%s"'%$id -#end if -self._$(id)_tool_bar.addWidget(Qt.QLabel($label+": ", None)) -#if int($widget.counter) -self._$(id)_counter = Qwt.QwtCounter(None) -self._$(id)_counter.setRange($start, $stop, $step) -self._$(id)_counter.setNumButtons(2) -self._$(id)_counter.setValue(self.$id) -self._$(id)_tool_bar.addWidget(self._$(id)_counter) -self._$(id)_counter.valueChanged.connect(self.set_$(id)) -#end if -#if int($widget.slider) -self._$(id)_slider = Qwt.QwtSlider(None) -self._$(id)_slider.setRange($start, $stop, $step) -self._$(id)_slider.setValue(self.$id) -self._$(id)_slider.setOrientation(Qt.$orient) -self._$(id)_slider.setScalePosition($orient.scalepos) -self._$(id)_slider.valueChanged.connect(self.set_$(id)) -$(win).addWidget(self._$(id)_slider) -#end if -$(gui_hint()($win)) - self.set_$(id)($value) - #if int($widget.counter) -self._$(id)_counter.setValue($id) -#end if -#if int($widget.slider) -self._$(id)_slider.setValue($id) -#end if - - Label - label - - string - #if $label() then 'none' else 'part'# - - - Default Value - value - 50 - real - - - Start - start - 0 - real - - - Stop - stop - 100 - real - - - Step - step - 1 - real - - - Widget - widget - all - enum - part - - - - - - Orientation - orient - Qt.Horizontal - enum - part - - - - - GUI Hint - gui_hint - - gui_hint - part - - $start <= $value <= $stop - $start < $stop - -This block creates a variable with a slider. \ -Leave the label blank to use the variable id as the label. \ -The value must be a real number. \ -The value must be between the start and the stop. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - - -- cgit From 7070c10d7ac59adcd597c18ec2c83b1b59ed87e9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 6 Mar 2011 11:18:27 -0800 Subject: grc: rework the probe blocks and how they fit into grc Removed the source on all probe blocks. Advertise the probe-able function in the docs. Added missing signal probe block. Removed probe function and variable sink blocks. Removed all supporting grc_gnuradio python files. Added variable_function_probe block that can probe arbitrary functions on a block. All the code needed by the function probe is available is the make tag. To display the value of a probe block, use the variable probe block, and a gui widget. To disply the value of a stream, do the same but use the signal probe block. Simple see :-) If more types other than floats need to be read from the stream, the signal probe should be extended. --- grc/blocks/Makefile.am | 4 +- grc/blocks/blks2_variable_sink_x.xml | 77 -------------------- grc/blocks/block_tree.xml | 4 +- grc/blocks/gr_probe_avg_mag_sqrd_x.xml | 22 ++---- grc/blocks/gr_probe_density_b.xml | 15 ++-- grc/blocks/gr_probe_mpsk_snr_c.xml | 39 ++-------- grc/blocks/gr_probe_signal_f.xml | 19 +++++ grc/blocks/probe_function.xml | 44 ------------ grc/blocks/variable_function_probe.xml | 51 +++++++++++++ grc/grc_gnuradio/Makefile.am | 6 +- grc/grc_gnuradio/blks2/__init__.py | 4 +- grc/grc_gnuradio/blks2/probe.py | 123 -------------------------------- grc/grc_gnuradio/blks2/variable_sink.py | 64 ----------------- 13 files changed, 92 insertions(+), 380 deletions(-) delete mode 100644 grc/blocks/blks2_variable_sink_x.xml create mode 100644 grc/blocks/gr_probe_signal_f.xml delete mode 100644 grc/blocks/probe_function.xml create mode 100644 grc/blocks/variable_function_probe.xml delete mode 100644 grc/grc_gnuradio/blks2/probe.py delete mode 100644 grc/grc_gnuradio/blks2/variable_sink.py diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index d9ec0896e..15c641fbc 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -60,7 +60,6 @@ dist_ourdata_DATA = \ blks2_tcp_sink.xml \ blks2_tcp_source.xml \ blks2_valve.xml \ - blks2_variable_sink_x.xml \ blks2_wfm_rcv.xml \ blks2_wfm_rcv_pll.xml \ blks2_wfm_tx.xml \ @@ -158,6 +157,7 @@ dist_ourdata_DATA = \ gr_probe_avg_mag_sqrd_x.xml \ gr_probe_density_b.xml \ gr_probe_mpsk_snr_c.xml \ + gr_probe_signal_f.xml \ gr_pwr_squelch_xx.xml \ gr_quadrature_demod_cf.xml \ gr_rational_resampler_base_xxx.xml \ @@ -201,7 +201,6 @@ dist_ourdata_DATA = \ pad_sink.xml \ pad_source.xml \ parameter.xml \ - probe_function.xml \ random_source_x.xml \ root_raised_cosine_filter.xml \ trellis_encoder_xx.xml \ @@ -221,6 +220,7 @@ dist_ourdata_DATA = \ usrp_simple_source_x.xml \ variable.xml \ variable_config.xml \ + variable_function_probe.xml \ virtual_sink.xml \ virtual_source.xml \ xmlrpc_client.xml \ diff --git a/grc/blocks/blks2_variable_sink_x.xml b/grc/blocks/blks2_variable_sink_x.xml deleted file mode 100644 index 5709c9f76..000000000 --- a/grc/blocks/blks2_variable_sink_x.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - Variable Sink - blks2_variable_sink_x - from grc_gnuradio import blks2 as grc_blks2 - grc_blks2.variable_sink_$(type.fcn)( - vlen=$vlen, - decim=$decim, - callback=self.set_$(variable()), -) - set_decim($decim) - - Type - type - enum - - - - - - - - Variable - variable - - string - - - Decimation - decim - 1 - int - - - Vec Length - vlen - 1 - int - - $vlen > 0 - - in - $type - $vlen - - -Read samples from the input stream and \ -write one in every decimation samples to the variable. - -The variable must be the id of an existing variable block. - - diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 50c463f55..e9a0c1591 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -26,7 +26,6 @@ Sinks - blks2_variable_sink_x gr_vector_sink_x gr_null_sink gr_file_sink @@ -261,7 +260,7 @@ gr_probe_avg_mag_sqrd_x gr_probe_density_b gr_probe_mpsk_snr_c - probe_function + gr_probe_signal_f USRP @@ -276,6 +275,7 @@ Variables variable variable_config + variable_function_probe parameter diff --git a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml index eb855956a..ac409ad67 100644 --- a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml +++ b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml @@ -7,15 +7,10 @@ Probe Avg Mag^2 gr_probe_avg_mag_sqrd_x - from grc_gnuradio import blks2 as grc_blks2 - grc_blks2.probe_avg_mag_sqrd_$(type)( - threshold=$threshold, - alpha=$alpha, - probe_rate=$probe_rate, -) + from gnuradio import gr + gr.probe_avg_mag_sqrd_$(type)($threshold, $alpha) set_alpha($alpha) set_threshold($threshold) - set_probe_rate($probe_rate) Type type @@ -43,18 +38,11 @@ 1 real - - Probe Rate - probe_rate - 10 - real - in $type.input - - out - float - + +Available functions to probe: level + diff --git a/grc/blocks/gr_probe_density_b.xml b/grc/blocks/gr_probe_density_b.xml index 74d3b0a2b..8e0e2c964 100644 --- a/grc/blocks/gr_probe_density_b.xml +++ b/grc/blocks/gr_probe_density_b.xml @@ -7,13 +7,9 @@ Probe Density gr_probe_density_b - from grc_gnuradio import blks2 as grc_blks2 - grc_blks2.probe_density_b( - alpha=$alpha, - probe_rate=$probe_rate, -) + from gnuradio import gr + gr.probe_density_b($alpha) set_alpha($alpha) - set_probe_rate($probe_rate) Alpha alpha @@ -30,8 +26,7 @@ in byte - - out - float - + +Available functions to probe: density + diff --git a/grc/blocks/gr_probe_mpsk_snr_c.xml b/grc/blocks/gr_probe_mpsk_snr_c.xml index 7f562d2f3..38211b55f 100644 --- a/grc/blocks/gr_probe_mpsk_snr_c.xml +++ b/grc/blocks/gr_probe_mpsk_snr_c.xml @@ -7,49 +7,20 @@ Probe MPSK SNR gr_probe_mpsk_snr_c - from grc_gnuradio import blks2 as grc_blks2 - grc_blks2.probe_mpsk_snr_c( - type='$type', - alpha=$alpha, - probe_rate=$probe_rate, -) + from gnuradio import gr + gr.probe_mpsk_snr_c($alpha) set_alpha($alpha) - set_probe_rate($probe_rate) - - Type - type - enum - - - - Alpha alpha 1 real - - Probe Rate - probe_rate - 10 - real - in complex - - out - float - + +Available functions to probe: signal_mean, noise_variance + diff --git a/grc/blocks/gr_probe_signal_f.xml b/grc/blocks/gr_probe_signal_f.xml new file mode 100644 index 000000000..e1847788a --- /dev/null +++ b/grc/blocks/gr_probe_signal_f.xml @@ -0,0 +1,19 @@ + + + + Probe Signal + gr_probe_signal_f + from gnuradio import gr + gr.probe_signal_f() + + in + float + + +Available functions to probe: level + + diff --git a/grc/blocks/probe_function.xml b/grc/blocks/probe_function.xml deleted file mode 100644 index ac0b3dcde..000000000 --- a/grc/blocks/probe_function.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - Probe Function - probe_function - from grc_gnuradio import blks2 as grc_blks2 - grc_blks2.probe_function( - probe_callback=self.$(block_id()).$(function_name()), - probe_rate=$probe_rate, -) - set_probe_rate($probe_rate) - - Block ID - block_id - my_block_0 - string - - - Function Name - function_name - get_number - string - - - Probe Rate - probe_rate - 10 - real - - - out - float - - -Polls a function of an arbitrary block and writes the value to the output port. \ -The block id is the id of another block in the flow graph. \ -The function name is the name of a function in the said block. \ -The function should take no arguments and return a floating point or integer number. - - diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml new file mode 100644 index 000000000..695d2f56c --- /dev/null +++ b/grc/blocks/variable_function_probe.xml @@ -0,0 +1,51 @@ + + + + Function Probe + variable_function_probe + import time + import threading + self.$(id) = $(id) = $value + #slurp +def _$(id)_probe(): + while True: + self.set_$(id)(self.$(block_id()).$(function_name())()) + time.sleep(1.0/($poll_rate)) +_$(id)_thread = threading.Thread(target=_$(id)_probe) +_$(id)_thread.daemon = True +_$(id)_thread.start() + self.set_$(id)($value) + + Value + value + 0 + raw + + + Block ID + block_id + my_block_0 + string + + + Function Name + function_name + get_number + string + + + Poll Rate (Hz) + poll_rate + 10 + real + + +Periodically probe a function and set its value to this variable. + +To poll a stream for a level, use this with the probe signal block. + + diff --git a/grc/grc_gnuradio/Makefile.am b/grc/grc_gnuradio/Makefile.am index c53d07b4e..c70972f59 100644 --- a/grc/grc_gnuradio/Makefile.am +++ b/grc/grc_gnuradio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -31,10 +31,8 @@ blks2_python_PYTHON = \ blks2/__init__.py \ blks2/error_rate.py \ blks2/packet.py \ - blks2/probe.py \ blks2/selector.py \ - blks2/tcp.py \ - blks2/variable_sink.py + blks2/tcp.py usrp_pythondir = $(grc_gnuradio_prefix)/usrp usrp_python_PYTHON = \ diff --git a/grc/grc_gnuradio/blks2/__init__.py b/grc/grc_gnuradio/blks2/__init__.py index cb1196f25..fde76f256 100644 --- a/grc/grc_gnuradio/blks2/__init__.py +++ b/grc/grc_gnuradio/blks2/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,6 +23,4 @@ from packet import options, packet_encoder, packet_decoder, \ packet_mod_b, packet_mod_s, packet_mod_i, packet_mod_f, packet_mod_c, \ packet_demod_b, packet_demod_s, packet_demod_i, packet_demod_f, packet_demod_c from error_rate import error_rate -from probe import probe_function, probe_avg_mag_sqrd_c, probe_avg_mag_sqrd_f, probe_density_b, probe_mpsk_snr_c -from variable_sink import variable_sink_b, variable_sink_s, variable_sink_i, variable_sink_f, variable_sink_c from tcp import tcp_source, tcp_sink diff --git a/grc/grc_gnuradio/blks2/probe.py b/grc/grc_gnuradio/blks2/probe.py deleted file mode 100644 index 8db81f057..000000000 --- a/grc/grc_gnuradio/blks2/probe.py +++ /dev/null @@ -1,123 +0,0 @@ -# -# Copyright 2008 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr -import threading -import numpy -import time - -####################################################################################### -## Probe: Function -####################################################################################### -class probe_function(gr.hier_block2, threading.Thread): - """ - The thread polls the function for values and writes to a message source. - """ - - def __init__(self, probe_callback, probe_rate): - #init hier block - gr.hier_block2.__init__( - self, 'probe_function', - gr.io_signature(0, 0, 0), - gr.io_signature(1, 1, gr.sizeof_float), - ) - self._probe_callback = probe_callback - self.set_probe_rate(probe_rate) - #create message source - message_source = gr.message_source(gr.sizeof_float, 1) - self._msgq = message_source.msgq() - #connect - self.connect(message_source, self) - #setup thread - threading.Thread.__init__(self) - self.setDaemon(True) - self.start() - - def run(self): - """ - Infinite polling loop. - """ - while True: - time.sleep(1.0/self._probe_rate) - arr = numpy.array(self._probe_callback(), numpy.float32) - msg = gr.message_from_string(arr.tostring(), 0, gr.sizeof_float, 1) - self._msgq.insert_tail(msg) - - def set_probe_rate(self, probe_rate): - self._probe_rate = probe_rate - -class _probe_base(gr.hier_block2): - def __init__(self, probe_block, probe_callback, probe_rate): - #init hier block - gr.hier_block2.__init__( - self, 'probe', - gr.io_signature(1, 1, probe_block.input_signature().sizeof_stream_items()[0]), - gr.io_signature(1, 1, gr.sizeof_float), - ) - probe_function_block = probe_function(probe_callback, probe_rate) - #forward callbacks - self.set_probe_rate = probe_function_block.set_probe_rate - #connect - self.connect(self, probe_block) - self.connect(probe_function_block, self) - -####################################################################################### -## Probe: Average Magnitude Squared -####################################################################################### -class _probe_avg_mag_sqrd_base(_probe_base): - def __init__(self, threshold, alpha, probe_rate): - #create block - probe_block = self._probe_block_contructor[0](threshold, alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - self.set_threshold = probe_block.set_threshold - #init - _probe_base.__init__(self, probe_block, probe_block.level, probe_rate) - -class probe_avg_mag_sqrd_c(_probe_avg_mag_sqrd_base): _probe_block_contructor = (gr.probe_avg_mag_sqrd_c,) -class probe_avg_mag_sqrd_f(_probe_avg_mag_sqrd_base): _probe_block_contructor = (gr.probe_avg_mag_sqrd_f,) - -####################################################################################### -## Probe: Density -####################################################################################### -class probe_density_b(_probe_base): - def __init__(self, alpha, probe_rate): - #create block - probe_block = gr.probe_density_b(alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - #init - _probe_base.__init__(self, probe_block, probe_block.density, probe_rate) - -####################################################################################### -## Probe: MPSK SNR -####################################################################################### -class probe_mpsk_snr_c(_probe_base): - def __init__(self, type, alpha, probe_rate): - """ - Type can be "snr", "signal_mean", or "noise_variance" - """ - #create block - probe_block = gr.probe_mpsk_snr_c(alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - #init - _probe_base.__init__(self, probe_block, getattr(probe_block, type), probe_rate) diff --git a/grc/grc_gnuradio/blks2/variable_sink.py b/grc/grc_gnuradio/blks2/variable_sink.py deleted file mode 100644 index cad3b8b04..000000000 --- a/grc/grc_gnuradio/blks2/variable_sink.py +++ /dev/null @@ -1,64 +0,0 @@ -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr -import threading -import numpy - -class _variable_sink_base(gr.hier_block2, threading.Thread): - """ - The thread polls the message queue for values and writes to a callback. - """ - - def __init__(self, vlen, decim, callback): - self._vlen = vlen - self._callback = callback - self._item_size = self._size*self._vlen - #init hier block - gr.hier_block2.__init__( - self, 'variable_sink', - gr.io_signature(1, 1, self._item_size), - gr.io_signature(0, 0, 0), - ) - #create blocks - self._decimator = gr.keep_one_in_n(self._item_size, decim) - self._msgq = gr.msg_queue(2) - message_sink = gr.message_sink(self._item_size, self._msgq, False) - #connect - self.connect(self, self._decimator, message_sink) - #setup thread - threading.Thread.__init__(self) - self.setDaemon(True) - self.start() - - def set_decim(self, decim): self._decimator.set_n(decim) - - def run(self): - while True: #truncate to item size, convert to array, callback - msg = self._msgq.delete_head().to_string()[-self._item_size:] - arr = map(self._cast, numpy.fromstring(msg, self._numpy)) - self._callback(self._vlen > 1 and arr or arr[0]) - -class variable_sink_b(_variable_sink_base): _numpy, _size, _cast = numpy.int8, gr.sizeof_char, int -class variable_sink_s(_variable_sink_base): _numpy, _size, _cast = numpy.int16, gr.sizeof_short, int -class variable_sink_i(_variable_sink_base): _numpy, _size, _cast = numpy.int32, gr.sizeof_int, int -class variable_sink_f(_variable_sink_base): _numpy, _size, _cast = numpy.float32, gr.sizeof_float, float -class variable_sink_c(_variable_sink_base): _numpy, _size, _cast = numpy.complex64, gr.sizeof_gr_complex, complex -- cgit From 4e0fb789e55e26bc16990a257c57494f3d3e6100 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 7 Mar 2011 11:43:34 -0800 Subject: grc: added function args to probe block and documentation --- grc/blocks/gr_probe_avg_mag_sqrd_x.xml | 4 +++- grc/blocks/gr_probe_density_b.xml | 4 +++- grc/blocks/gr_probe_mpsk_snr_c.xml | 4 +++- grc/blocks/gr_probe_signal_f.xml | 4 +++- grc/blocks/variable_function_probe.xml | 18 +++++++++++++++++- 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml index ac409ad67..6bf706ae1 100644 --- a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml +++ b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml @@ -43,6 +43,8 @@ $type.input -Available functions to probe: level +Available functions to probe: level() + +Use with the function probe block. diff --git a/grc/blocks/gr_probe_density_b.xml b/grc/blocks/gr_probe_density_b.xml index 8e0e2c964..3a91256aa 100644 --- a/grc/blocks/gr_probe_density_b.xml +++ b/grc/blocks/gr_probe_density_b.xml @@ -27,6 +27,8 @@ byte -Available functions to probe: density +Available functions to probe: density() + +Use with the function probe block. diff --git a/grc/blocks/gr_probe_mpsk_snr_c.xml b/grc/blocks/gr_probe_mpsk_snr_c.xml index 38211b55f..5687e867d 100644 --- a/grc/blocks/gr_probe_mpsk_snr_c.xml +++ b/grc/blocks/gr_probe_mpsk_snr_c.xml @@ -21,6 +21,8 @@ complex -Available functions to probe: signal_mean, noise_variance +Available functions to probe: signal_mean(), noise_variance() + +Use with the function probe block. diff --git a/grc/blocks/gr_probe_signal_f.xml b/grc/blocks/gr_probe_signal_f.xml index e1847788a..5c38e816f 100644 --- a/grc/blocks/gr_probe_signal_f.xml +++ b/grc/blocks/gr_probe_signal_f.xml @@ -14,6 +14,8 @@ float -Available functions to probe: level +Available functions to probe: level() + +Use with the function probe block. diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml index 695d2f56c..49f48fc89 100644 --- a/grc/blocks/variable_function_probe.xml +++ b/grc/blocks/variable_function_probe.xml @@ -13,7 +13,7 @@ #slurp def _$(id)_probe(): while True: - self.set_$(id)(self.$(block_id()).$(function_name())()) + self.set_$(id)(self.$(block_id()).$(function_name())($(function_args()))) time.sleep(1.0/($poll_rate)) _$(id)_thread = threading.Thread(target=_$(id)_probe) _$(id)_thread.daemon = True @@ -37,6 +37,13 @@ _$(id)_thread.start() get_number string + + Function Args + function_args + + string + #if $function_args() then 'none' else 'part'# + Poll Rate (Hz) poll_rate @@ -46,6 +53,15 @@ _$(id)_thread.start() Periodically probe a function and set its value to this variable. +Set the values for block ID, function name, and function args appropriately: \ +Block ID should be the ID of another block in this flow graph. \ +Function name should be the name of a class method on that block. \ +Function args are the parameters passed into that function. \ +For a function with no arguments, leave function args blank. + +The values will used literally, and generated into the following form: +self.block_id.function_name(function_args) + To poll a stream for a level, use this with the probe signal block. -- cgit From d658659c4cb72385f921a03c37bb58b452190aab Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 7 Mar 2011 12:45:06 -0800 Subject: qtgui-grc: added check for pyqwt in config --- config/grc_gr_qtgui.m4 | 11 +++++------ config/grc_grc.m4 | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/config/grc_gr_qtgui.m4 b/config/grc_gr_qtgui.m4 index c14f984c3..92392c883 100644 --- a/config/grc_gr_qtgui.m4 +++ b/config/grc_gr_qtgui.m4 @@ -29,13 +29,12 @@ AC_DEFUN([GRC_GR_QTGUI],[ dnl no : otherwise PYTHON_CHECK_MODULE([PyQt4.QtCore], [PyQt4 for Qt4], \ - [passed=yes], [passed=no], \ - [PyQt4.QtCore.PYQT_VERSION >= 260000]) + [], [passed=no], \ + [PyQt4.QtCore.PYQT_VERSION >= 260000]) - # Enable this if we want to test for PyQwt, too - #PYTHON_CHECK_MODULE([PyQt4.Qwt5], [PyQwt5 for Qt4], \ - # [passed=yes], [passed=no], \ - # [PyQt4.Qwt5.QWT_VERSION >= 327000]) + PYTHON_CHECK_MODULE([PyQt4.Qwt5], [PyQwt5 for Qt4], \ + [], [passed=no], \ + [PyQt4.Qwt5.QWT_VERSION >= 327000]) # Check for: # QtOpenGL diff --git a/config/grc_grc.m4 b/config/grc_grc.m4 index 9aff3cd1d..c21acccff 100644 --- a/config/grc_grc.m4 +++ b/config/grc_grc.m4 @@ -20,8 +20,6 @@ dnl Boston, MA 02110-1301, USA. AC_DEFUN([GRC_GRC],[ GRC_ENABLE(grc) -dnl GRC_CHECK_DEPENDENCY(grc, gr-wxgui) - AC_CHECK_PROG(XDG_UTILS, xdg-mime, true, false) AM_CONDITIONAL(XDG_UTILS, $XDG_UTILS) -- cgit From 0f9de85118b29f9cd5e832ea05e6438adf89e0fb Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 7 Mar 2011 13:15:43 -0800 Subject: qtgui-grc: fix for list option working in chooser block --- gr-qtgui/grc/qtgui_chooser.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml index d06a229b4..6f405d99d 100644 --- a/gr-qtgui/grc/qtgui_chooser.xml +++ b/gr-qtgui/grc/qtgui_chooser.xml @@ -20,7 +20,7 @@ ######################################################################## ## Create the options list ######################################################################## -#if $num_opts() +#if int($num_opts()) self._$(id)_options = (#slurp #for $ch in $all_options $ch, #slurp @@ -32,7 +32,7 @@ self._$(id)_options = $options ######################################################################## ## Create the labels list ######################################################################## -#if $num_opts() +#if int($num_opts()) self._$(id)_labels = (#slurp #for i, $lbl in enumerate($all_labels) #if $lbl() @@ -42,7 +42,7 @@ str(self._$(id)_options[$i]), #slurp #end if #end for ) -#elif $labels +#elif $labels() self._$(id)_labels = $labels #else self._$(id)_labels = map(str, self._$(id)_options) -- cgit From 51bcf966e09e15bd97822608b236f02fd379ea87 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 7 Mar 2011 13:16:19 -0800 Subject: qtgui-grc: added read-only thermo widget to range block --- gr-qtgui/grc/qtgui_range.xml | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/gr-qtgui/grc/qtgui_range.xml b/gr-qtgui/grc/qtgui_range.xml index 12807ec84..4d28de223 100644 --- a/gr-qtgui/grc/qtgui_range.xml +++ b/gr-qtgui/grc/qtgui_range.xml @@ -21,21 +21,33 @@ #if $widget() == "knob" ######################################################################## $win = Qt.QVBoxLayout() -self._$(id)_knob = Qwt.QwtKnob(None) +self._$(id)_knob = Qwt.QwtKnob() self._$(id)_knob.setRange($start, $stop, $step) self._$(id)_knob.setValue(self.$id) self._$(id)_knob.valueChanged.connect(self.set_$(id)) $(win).addWidget(self._$(id)_knob) -self._$(id)_label = Qt.QLabel($label, None) +self._$(id)_label = Qt.QLabel($label) self._$(id)_label.setAlignment(Qt.Qt.AlignTop | Qt.Qt.AlignHCenter) $(win).addWidget(self._$(id)_label) #end if ######################################################################## +#if $widget() == "thermo" +######################################################################## +$win = $(orient.layout)() +$(win).addWidget(Qt.QLabel($label)) +self._$(id)_thermo = Qwt.QwtThermo() +self._$(id)_thermo.setScalePosition(Qwt.QwtThermo.$orient.scalepos) +self._$(id)_thermo.setRange($start, $stop) +self._$(id)_thermo.setValue(self.$id) +self._$(id)_thermo.$(orient.minfcn)($min_len) +$(win).addWidget(self._$(id)_thermo) +#end if +######################################################################## #if $widget() == "counter" ######################################################################## $win = Qt.QHBoxLayout() -$(win).addWidget(Qt.QLabel($label+": ", None)) -self._$(id)_counter = Qwt.QwtCounter(None) +$(win).addWidget(Qt.QLabel($label+": ")) +self._$(id)_counter = Qwt.QwtCounter() self._$(id)_counter.setRange($start, $stop, $step) self._$(id)_counter.setNumButtons(2) self._$(id)_counter.setMinimumWidth($min_len) @@ -47,13 +59,13 @@ self._$(id)_counter.valueChanged.connect(self.set_$(id)) #if $widget() == "slider" ######################################################################## $win = $(orient.layout)() -self._$(id)_slider = Qwt.QwtSlider(None, Qt.$orient, $orient.scalepos, Qwt.QwtSlider.BgSlot) +self._$(id)_slider = Qwt.QwtSlider(None, Qt.$orient, Qwt.QwtSlider.$orient.scalepos, Qwt.QwtSlider.BgSlot) self._$(id)_slider.setRange($start, $stop, $step) self._$(id)_slider.setValue(self.$id) self._$(id)_slider.$(orient.minfcn)($min_len) self._$(id)_slider.valueChanged.connect(self.set_$(id)) $(win).addWidget(self._$(id)_slider) -self._$(id)_num = Qt.QLabel(eng_notation.num_to_str($id), None) +self._$(id)_num = Qt.QLabel(eng_notation.num_to_str($id)) $(win).addWidget(self._$(id)_num) #end if ######################################################################## @@ -62,8 +74,8 @@ $(win).addWidget(self._$(id)_num) $win = Qt.QVBoxLayout() self._$(id)_tool_bar = Qt.QToolBar(self) $(win).addWidget(self._$(id)_tool_bar) -self._$(id)_tool_bar.addWidget(Qt.QLabel($label+": ", None)) -self._$(id)_counter = Qwt.QwtCounter(None) +self._$(id)_tool_bar.addWidget(Qt.QLabel($label+": ")) +self._$(id)_counter = Qwt.QwtCounter() self._$(id)_counter.setRange($start, $stop, $step) self._$(id)_counter.setNumButtons(2) self._$(id)_counter.setValue(self.$id) @@ -81,6 +93,9 @@ $(gui_hint()($win)) #if $widget() == "knob" self._$(id)_knob.setValue($id) #end if +#if $widget() == "thermo" +self._$(id)_thermo.setValue($id) +#end if #if $widget() == "counter" self._$(id)_counter.setValue($id) #end if @@ -133,24 +148,25 @@ self._$(id)_slider.setValue($id) + Orientation orient Qt.Horizontal enum - #if $widget() == "slider" then 'part' else 'all'# + #if $widget() in ("slider", "thermo") then 'part' else 'all'# @@ -160,7 +176,7 @@ self._$(id)_slider.setValue($id) min_len 200 int - #if $widget().split('_')[0] in ("slider", "counter") then 'part' else 'all'# + #if $widget().split('_')[0] in ("slider", "counter", "thermo") then 'part' else 'all'# GUI Hint -- cgit From 9121b75d68a0c90deee814edffe387480b52019b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 7 Mar 2011 18:40:57 -0800 Subject: qtgui-grc: minor tweaks to the various things --- gr-qtgui/grc/qtgui_chooser.xml | 4 ++-- gr-qtgui/grc/qtgui_entry.xml | 2 +- gr-qtgui/grc/qtgui_label.xml | 2 +- gr-qtgui/grc/qtgui_range.xml | 29 ++++++++++++++++++++--------- gr-qtgui/grc/qtgui_tab_widget.xml | 2 +- grc/blocks/variable_function_probe.xml | 7 +++++-- grc/python/flow_graph.tmpl | 1 + 7 files changed, 31 insertions(+), 16 deletions(-) diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml index 6f405d99d..cb5090289 100644 --- a/gr-qtgui/grc/qtgui_chooser.xml +++ b/gr-qtgui/grc/qtgui_chooser.xml @@ -53,8 +53,8 @@ self._$(id)_labels = map(str, self._$(id)_options) #if $widget() == 'combo_box' #set $win = 'self._%s_tool_bar'%$id $win = Qt.QToolBar(self) -$(win).addWidget(Qt.QLabel($label+": ", None)) -self._$(id)_combo_box = Qt.QComboBox(None) +$(win).addWidget(Qt.QLabel($label+": ")) +self._$(id)_combo_box = Qt.QComboBox() $(win).addWidget(self._$(id)_combo_box) for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) self._$(id)_callback = lambda i: self._$(id)_combo_box.setCurrentIndex(self._$(id)_options.index(i)) diff --git a/gr-qtgui/grc/qtgui_entry.xml b/gr-qtgui/grc/qtgui_entry.xml index 32c879420..1a98402a0 100644 --- a/gr-qtgui/grc/qtgui_entry.xml +++ b/gr-qtgui/grc/qtgui_entry.xml @@ -17,7 +17,7 @@ $win = Qt.QToolBar(self) #if not $label() #set $label = '"%s"'%$id #end if -$(win).addWidget(Qt.QLabel($label+": ", None)) +$(win).addWidget(Qt.QLabel($label+": ")) self._$(id)_line_edit = Qt.QLineEdit(str(self.$id)) self._$(id)_tool_bar.addWidget(self._$(id)_line_edit) self._$(id)_line_edit.returnPressed.connect( diff --git a/gr-qtgui/grc/qtgui_label.xml b/gr-qtgui/grc/qtgui_label.xml index 96354688e..5049118c4 100644 --- a/gr-qtgui/grc/qtgui_label.xml +++ b/gr-qtgui/grc/qtgui_label.xml @@ -17,7 +17,7 @@ $win = Qt.QToolBar(self) #if not $label() #set $label = '"%s"'%$id #end if -$(win).addWidget(Qt.QLabel($label+": ", None)) +$(win).addWidget(Qt.QLabel($label+": ")) self._$(id)_label = Qt.QLabel(str(self.$id)) self._$(id)_tool_bar.addWidget(self._$(id)_label) $(gui_hint()($win)) diff --git a/gr-qtgui/grc/qtgui_range.xml b/gr-qtgui/grc/qtgui_range.xml index 4d28de223..6b0555f98 100644 --- a/gr-qtgui/grc/qtgui_range.xml +++ b/gr-qtgui/grc/qtgui_range.xml @@ -11,7 +11,6 @@ QT GUI Widgets from PyQt4 import Qt import PyQt4.Qwt5 as Qwt - from gnuradio import eng_notation self.$(id) = $(id) = $value #set $win = 'self._%s_layout'%$id #if not $label() @@ -33,14 +32,22 @@ $(win).addWidget(self._$(id)_label) ######################################################################## #if $widget() == "thermo" ######################################################################## -$win = $(orient.layout)() -$(win).addWidget(Qt.QLabel($label)) +$win = Qt.QVBoxLayout() +self._$(id)_label = Qt.QLabel($label) self._$(id)_thermo = Qwt.QwtThermo() self._$(id)_thermo.setScalePosition(Qwt.QwtThermo.$orient.scalepos) self._$(id)_thermo.setRange($start, $stop) self._$(id)_thermo.setValue(self.$id) self._$(id)_thermo.$(orient.minfcn)($min_len) +#if 'horizontal' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignBottom | Qt.Qt.AlignHCenter) +$(win).addWidget(self._$(id)_label) $(win).addWidget(self._$(id)_thermo) +#elif 'vertical' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignTop) +$(win).addWidget(self._$(id)_thermo) +$(win).addWidget(self._$(id)_label) +#end if #end if ######################################################################## #if $widget() == "counter" @@ -58,15 +65,22 @@ self._$(id)_counter.valueChanged.connect(self.set_$(id)) ######################################################################## #if $widget() == "slider" ######################################################################## -$win = $(orient.layout)() +$win = Qt.QVBoxLayout() +self._$(id)_label = Qt.QLabel($label) self._$(id)_slider = Qwt.QwtSlider(None, Qt.$orient, Qwt.QwtSlider.$orient.scalepos, Qwt.QwtSlider.BgSlot) self._$(id)_slider.setRange($start, $stop, $step) self._$(id)_slider.setValue(self.$id) self._$(id)_slider.$(orient.minfcn)($min_len) self._$(id)_slider.valueChanged.connect(self.set_$(id)) +#if 'horizontal' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignBottom | Qt.Qt.AlignHCenter) +$(win).addWidget(self._$(id)_label) $(win).addWidget(self._$(id)_slider) -self._$(id)_num = Qt.QLabel(eng_notation.num_to_str($id)) -$(win).addWidget(self._$(id)_num) +#elif 'vertical' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignTop) +$(win).addWidget(self._$(id)_slider) +$(win).addWidget(self._$(id)_label) +#end if #end if ######################################################################## #if $widget() == "counter_slider" @@ -101,7 +115,6 @@ self._$(id)_counter.setValue($id) #end if #if $widget() == "slider" self._$(id)_slider.setValue($id) -self._$(id)_num.setText(eng_notation.num_to_str($id)) #end if #if $widget() == "counter_slider" self._$(id)_counter.setValue($id) @@ -161,14 +174,12 @@ self._$(id)_slider.setValue($id) Qt.Horizontal scalepos:BottomScale minfcn:setMinimumWidth - layout:Qt.QHBoxLayout diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml index efdeaa19a..f90054109 100644 --- a/gr-qtgui/grc/qtgui_tab_widget.xml +++ b/gr-qtgui/grc/qtgui_tab_widget.xml @@ -10,7 +10,7 @@ QT GUI Widgets from PyQt4 import Qt #set $win = 'self.%s'%$id -Qt.QTabWidget(None) +Qt.QTabWidget() #set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_tabs())] #for i, label in enumerate($all_labels) self.$(id)_widget_$(i) = Qt.QWidget() diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml index 49f48fc89..269966c70 100644 --- a/grc/blocks/variable_function_probe.xml +++ b/grc/blocks/variable_function_probe.xml @@ -13,7 +13,9 @@ #slurp def _$(id)_probe(): while True: - self.set_$(id)(self.$(block_id()).$(function_name())($(function_args()))) + val = self.$(block_id()).$(function_name())($(function_args())) + try: self.set_$(id)(val) + except AttributeError, e: pass time.sleep(1.0/($poll_rate)) _$(id)_thread = threading.Thread(target=_$(id)_probe) _$(id)_thread.daemon = True @@ -57,7 +59,8 @@ Set the values for block ID, function name, and function args appropriately: \ Block ID should be the ID of another block in this flow graph. \ Function name should be the name of a class method on that block. \ Function args are the parameters passed into that function. \ -For a function with no arguments, leave function args blank. +For a function with no arguments, leave function args blank. \ +When passing a string for the function arguments, quote the string literal: '"arg"'. The values will used literally, and generated into the following form: self.block_id.function_name(function_args) diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 070ad7ed1..1aea58838 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -235,6 +235,7 @@ if __name__ == '__main__': #elif $generate_options == 'qt_gui' qapp = Qt.QApplication(sys.argv) tb = $(class_name)($(', '.join($params_eq_list))) + tb.setWindowTitle("$title") #if $flow_graph.get_option('run') tb.start() #end if -- cgit From c86acebd1ab6adf994f49dab1669fcbbb6324637 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 7 Mar 2011 23:52:40 -0800 Subject: qtgui-grc: added suport in main template for theme icon --- grc/python/flow_graph.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 1aea58838..5aaa99793 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -63,6 +63,8 @@ class $(class_name)(gr.top_block, Qt.QWidget): def __init__($param_str): gr.top_block.__init__(self, "$title") Qt.QWidget.__init__(self) + self.setWindowTitle("$title") + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) self.top_layout = Qt.QVBoxLayout(self) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) @@ -235,7 +237,6 @@ if __name__ == '__main__': #elif $generate_options == 'qt_gui' qapp = Qt.QApplication(sys.argv) tb = $(class_name)($(', '.join($params_eq_list))) - tb.setWindowTitle("$title") #if $flow_graph.get_option('run') tb.start() #end if -- cgit From fcebe220ba4690a4c339daa3d0909aad7776e631 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 12 Mar 2011 18:02:28 -0800 Subject: qtgui: removed python directory that was added, never used --- gr-qtgui/python/.gitignore | 2 -- gr-qtgui/python/Makefile.am | 29 ----------------------------- 2 files changed, 31 deletions(-) delete mode 100644 gr-qtgui/python/.gitignore delete mode 100644 gr-qtgui/python/Makefile.am diff --git a/gr-qtgui/python/.gitignore b/gr-qtgui/python/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/gr-qtgui/python/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/gr-qtgui/python/Makefile.am b/gr-qtgui/python/Makefile.am deleted file mode 100644 index 5f6d22b17..000000000 --- a/gr-qtgui/python/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright 2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common - -qtguiformspythondir = $(grpythondir)/qtgui/forms - -qtguiformspython_PYTHON = \ - forms/__init__.py \ - forms/converters.py \ - forms/forms.py -- cgit