$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 Sinkqtgui_sink_xGraphical Sinks
+ from PyQt4 import Qtfrom gnuradio.qtgui import qtguifrom gnuradio.gr import firdesimport 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)
OnTrue
OffFalse
+
+ 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
+
11
+
22
+
33
+
44
+
55
+
+
+ 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 Slidervariable_qtgui_sliderVariablesfrom PyQt4 import Qtimport PyQt4.Qwt5 as Qwtself.$(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)
step1real
- partOrientation
@@ -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
+
Realreal
+
Intint
+
Stringstring
+
Anyraw
+
+
+
+ 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_optionswx_guienum
- #if $generate_options() == 'wx_gui' then 'part' else 'none'#
WX GUIwx_gui
--
cgit
From f0537a7da4571bd6aaab273a0588eaef04121648 Mon Sep 17 00:00:00 2001
From: Josh Blum
Date: Fri, 21 Jan 2011 15:20:45 -0800
Subject: grc: moved wxgui blocks and python into gr-wxgui/grc
Prefixed wxgui blocks with WX GUI in the block names.
Added category to wxgui variables blocks (not in the main block tree.xml)
---
config/grc_gr_wxgui.m4 | 1 +
gr-wxgui/Makefile.am | 2 +-
gr-wxgui/grc/.gitignore | 2 +
gr-wxgui/grc/Makefile.am | 44 ++++++
gr-wxgui/grc/__init__.py | 22 +++
gr-wxgui/grc/panel.py | 49 +++++++
gr-wxgui/grc/top_block_gui.py | 74 ++++++++++
gr-wxgui/grc/variable_check_box.xml | 85 +++++++++++
gr-wxgui/grc/variable_chooser.xml | 123 ++++++++++++++++
gr-wxgui/grc/variable_slider.xml | 139 ++++++++++++++++++
gr-wxgui/grc/variable_static_text.xml | 98 +++++++++++++
gr-wxgui/grc/variable_text_box.xml | 102 +++++++++++++
gr-wxgui/grc/wxgui_constellationsink2.xml | 139 ++++++++++++++++++
gr-wxgui/grc/wxgui_fftsink2.xml | 232 ++++++++++++++++++++++++++++++
gr-wxgui/grc/wxgui_histosink2.xml | 77 ++++++++++
gr-wxgui/grc/wxgui_numbersink2.xml | 192 +++++++++++++++++++++++++
gr-wxgui/grc/wxgui_scopesink2.xml | 186 ++++++++++++++++++++++++
gr-wxgui/grc/wxgui_termsink.xml | 55 +++++++
gr-wxgui/grc/wxgui_waterfallsink2.xml | 189 ++++++++++++++++++++++++
grc/blocks/Makefile.am | 12 --
grc/blocks/block_tree.xml | 5 -
grc/blocks/variable_check_box.xml | 84 -----------
grc/blocks/variable_chooser.xml | 122 ----------------
grc/blocks/variable_slider.xml | 138 ------------------
grc/blocks/variable_static_text.xml | 97 -------------
grc/blocks/variable_text_box.xml | 101 -------------
grc/blocks/wxgui_constellationsink2.xml | 139 ------------------
grc/blocks/wxgui_fftsink2.xml | 232 ------------------------------
grc/blocks/wxgui_histosink2.xml | 77 ----------
grc/blocks/wxgui_numbersink2.xml | 192 -------------------------
grc/blocks/wxgui_scopesink2.xml | 186 ------------------------
grc/blocks/wxgui_termsink.xml | 55 -------
grc/blocks/wxgui_waterfallsink2.xml | 189 ------------------------
grc/grc_gnuradio/Makefile.am | 6 -
grc/grc_gnuradio/wxgui/__init__.py | 22 ---
grc/grc_gnuradio/wxgui/panel.py | 49 -------
grc/grc_gnuradio/wxgui/top_block_gui.py | 74 ----------
grc/python/Platform.py | 2 +-
38 files changed, 1811 insertions(+), 1782 deletions(-)
create mode 100644 gr-wxgui/grc/.gitignore
create mode 100644 gr-wxgui/grc/Makefile.am
create mode 100644 gr-wxgui/grc/__init__.py
create mode 100644 gr-wxgui/grc/panel.py
create mode 100644 gr-wxgui/grc/top_block_gui.py
create mode 100644 gr-wxgui/grc/variable_check_box.xml
create mode 100644 gr-wxgui/grc/variable_chooser.xml
create mode 100644 gr-wxgui/grc/variable_slider.xml
create mode 100644 gr-wxgui/grc/variable_static_text.xml
create mode 100644 gr-wxgui/grc/variable_text_box.xml
create mode 100644 gr-wxgui/grc/wxgui_constellationsink2.xml
create mode 100644 gr-wxgui/grc/wxgui_fftsink2.xml
create mode 100644 gr-wxgui/grc/wxgui_histosink2.xml
create mode 100644 gr-wxgui/grc/wxgui_numbersink2.xml
create mode 100644 gr-wxgui/grc/wxgui_scopesink2.xml
create mode 100644 gr-wxgui/grc/wxgui_termsink.xml
create mode 100644 gr-wxgui/grc/wxgui_waterfallsink2.xml
delete mode 100644 grc/blocks/variable_check_box.xml
delete mode 100644 grc/blocks/variable_chooser.xml
delete mode 100644 grc/blocks/variable_slider.xml
delete mode 100644 grc/blocks/variable_static_text.xml
delete mode 100644 grc/blocks/variable_text_box.xml
delete mode 100644 grc/blocks/wxgui_constellationsink2.xml
delete mode 100644 grc/blocks/wxgui_fftsink2.xml
delete mode 100644 grc/blocks/wxgui_histosink2.xml
delete mode 100644 grc/blocks/wxgui_numbersink2.xml
delete mode 100644 grc/blocks/wxgui_scopesink2.xml
delete mode 100644 grc/blocks/wxgui_termsink.xml
delete mode 100644 grc/blocks/wxgui_waterfallsink2.xml
delete mode 100644 grc/grc_gnuradio/wxgui/__init__.py
delete mode 100644 grc/grc_gnuradio/wxgui/panel.py
delete mode 100644 grc/grc_gnuradio/wxgui/top_block_gui.py
diff --git a/config/grc_gr_wxgui.m4 b/config/grc_gr_wxgui.m4
index c443f7c6c..17925fcc5 100644
--- a/config/grc_gr_wxgui.m4
+++ b/config/grc_gr_wxgui.m4
@@ -36,6 +36,7 @@ AC_DEFUN([GRC_GR_WXGUI],[
AC_CONFIG_FILES([ \
gr-wxgui/Makefile \
gr-wxgui/gr-wxgui.pc \
+ gr-wxgui/grc/Makefile \
gr-wxgui/src/Makefile \
gr-wxgui/src/python/Makefile \
gr-wxgui/src/python/plotter/Makefile \
diff --git a/gr-wxgui/Makefile.am b/gr-wxgui/Makefile.am
index cee66e587..cfc7a429c 100644
--- a/gr-wxgui/Makefile.am
+++ b/gr-wxgui/Makefile.am
@@ -27,7 +27,7 @@ EXTRA_DIST += \
README.gl
if PYTHON
-SUBDIRS = src
+SUBDIRS = src grc
etcdir = $(gr_prefsdir)
dist_etc_DATA = gr-wxgui.conf
diff --git a/gr-wxgui/grc/.gitignore b/gr-wxgui/grc/.gitignore
new file mode 100644
index 000000000..b336cc7ce
--- /dev/null
+++ b/gr-wxgui/grc/.gitignore
@@ -0,0 +1,2 @@
+/Makefile
+/Makefile.in
diff --git a/gr-wxgui/grc/Makefile.am b/gr-wxgui/grc/Makefile.am
new file mode 100644
index 000000000..26217077a
--- /dev/null
+++ b/gr-wxgui/grc/Makefile.am
@@ -0,0 +1,44 @@
+#
+# Copyright 2011 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
+
+grcblocksdir = $(grc_blocksdir)
+dist_grcblocks_DATA = \
+ variable_check_box.xml \
+ variable_chooser.xml \
+ variable_slider.xml \
+ variable_static_text.xml \
+ variable_text_box.xml \
+ wxgui_constellationsink2.xml \
+ wxgui_fftsink2.xml \
+ wxgui_histosink2.xml \
+ wxgui_numbersink2.xml \
+ wxgui_scopesink2.xml \
+ wxgui_termsink.xml \
+ wxgui_waterfallsink2.xml
+
+#The wxgui module contains a top_block + wxgui frame.
+wxgui_pythondir = $(pythondir)/grc_gnuradio/wxgui
+wxgui_python_PYTHON = \
+ __init__.py \
+ panel.py \
+ top_block_gui.py
diff --git a/gr-wxgui/grc/__init__.py b/gr-wxgui/grc/__init__.py
new file mode 100644
index 000000000..81427253b
--- /dev/null
+++ b/gr-wxgui/grc/__init__.py
@@ -0,0 +1,22 @@
+# Copyright 2008, 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 top_block_gui import top_block_gui
+from panel import Panel
diff --git a/gr-wxgui/grc/panel.py b/gr-wxgui/grc/panel.py
new file mode 100644
index 000000000..e62133cac
--- /dev/null
+++ b/gr-wxgui/grc/panel.py
@@ -0,0 +1,49 @@
+# 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.
+#
+
+import wx
+
+class Panel(wx.Panel):
+ def __init__(self, parent, orient=wx.VERTICAL):
+ wx.Panel.__init__(self, parent)
+ self._box = wx.BoxSizer(orient)
+ self._grid = wx.GridBagSizer(5, 5)
+ self.Add(self._grid)
+ self.SetSizer(self._box)
+
+ def GetWin(self): return self
+
+ def Add(self, win):
+ """
+ Add a window to the wx vbox.
+ @param win the wx window
+ """
+ self._box.Add(win, 0, wx.EXPAND)
+
+ def GridAdd(self, win, row, col, row_span=1, col_span=1):
+ """
+ Add a window to the wx grid at the given position.
+ @param win the wx window
+ @param row the row specification (integer >= 0)
+ @param col the column specification (integer >= 0)
+ @param row_span the row span specification (integer >= 1)
+ @param col_span the column span specification (integer >= 1)
+ """
+ self._grid.Add(win, wx.GBPosition(row, col), wx.GBSpan(row_span, col_span), wx.EXPAND)
diff --git a/gr-wxgui/grc/top_block_gui.py b/gr-wxgui/grc/top_block_gui.py
new file mode 100644
index 000000000..333ccf1c1
--- /dev/null
+++ b/gr-wxgui/grc/top_block_gui.py
@@ -0,0 +1,74 @@
+# Copyright 2008, 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.
+#
+
+import wx
+from gnuradio import gr
+import panel
+
+default_gui_size = (200, 100)
+
+class top_block_gui(gr.top_block):
+ """gr top block with wx gui app and grid sizer."""
+
+ def __init__(self, title='', size=default_gui_size):
+ """
+ Initialize the gr top block.
+ Create the wx gui elements.
+ @param title the main window title
+ @param size the main window size tuple in pixels
+ @param icon the file path to an icon or None
+ """
+ #initialize
+ gr.top_block.__init__(self)
+ self._size = size
+ #create gui elements
+ self._app = wx.App()
+ self._frame = wx.Frame(None, title=title)
+ self._panel = panel.Panel(self._frame)
+ self.Add = self._panel.Add
+ self.GridAdd = self._panel.GridAdd
+ self.GetWin = self._panel.GetWin
+
+ def SetIcon(self, *args, **kwargs): self._frame.SetIcon(*args, **kwargs)
+
+ def Run(self, start=True):
+ """
+ Setup the wx gui elements.
+ Start the gr top block.
+ Block with the wx main loop.
+ """
+ #set minimal window size
+ self._frame.SetSizeHints(*self._size)
+ #create callback for quit
+ def _quit(event):
+ self.stop(); self.wait()
+ self._frame.Destroy()
+ #setup app
+ self._frame.Bind(wx.EVT_CLOSE, _quit)
+ self._sizer = wx.BoxSizer(wx.VERTICAL)
+ self._sizer.Add(self._panel, 0, wx.EXPAND)
+ self._frame.SetSizerAndFit(self._sizer)
+ self._frame.SetAutoLayout(True)
+ self._frame.Show(True)
+ self._app.SetTopWindow(self._frame)
+ #start flow graph
+ if start: self.start()
+ #blocking main loop
+ self._app.MainLoop()
diff --git a/gr-wxgui/grc/variable_check_box.xml b/gr-wxgui/grc/variable_check_box.xml
new file mode 100644
index 000000000..d1e4d990c
--- /dev/null
+++ b/gr-wxgui/grc/variable_check_box.xml
@@ -0,0 +1,85 @@
+
+
+
+ WX GUI Check Box
+ variable_check_box
+ Variables
+ from gnuradio.wxgui import forms
+ self.$(id) = $(id) = $value
+ #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+#set $win = 'self._%s_check_box'%$id
+$win = forms.check_box(
+ parent=$(parent).GetWin(),
+ value=self.$id,
+ callback=self.set_$(id),
+ #if $label()
+ label=$label,
+ #else
+ label='$id',
+ #end if
+ true=$true,
+ false=$false,
+)
+#if not $grid_pos()
+$(parent).Add($win)
+#else
+$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
+#end if
+ self.set_$(id)($value)
+ self._$(id)_check_box.set_value($id)
+
+ Label
+ label
+
+ string
+ #if $label() then 'none' else 'part'#
+
+
+ Default Value
+ value
+ True
+ raw
+
+
+ True
+ true
+ True
+ raw
+
+
+ False
+ false
+ False
+ raw
+
+
+ Grid Position
+ grid_pos
+
+ grid_pos
+
+
+ Notebook
+ notebook
+
+ notebook
+
+ $value in ($true, $false)
+
+This block creates a variable with a check box form. \
+Leave the label blank to use the variable id as the label.
+
+A check box form can switch between two states; \
+the default being True and False. \
+Override True and False to use alternative states.
+
+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/gr-wxgui/grc/variable_chooser.xml b/gr-wxgui/grc/variable_chooser.xml
new file mode 100644
index 000000000..99bf4389c
--- /dev/null
+++ b/gr-wxgui/grc/variable_chooser.xml
@@ -0,0 +1,123 @@
+
+
+
+ WX GUI Chooser
+ variable_chooser
+ Variables
+ from gnuradio.wxgui import forms
+ self.$(id) = $(id) = $value
+ #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+#set $win = 'self._%s_chooser'%$id
+$win = forms.$(type)(
+ parent=$(parent).GetWin(),
+ value=self.$id,
+ callback=self.set_$(id),
+ #if $label()
+ label=$label,
+ #else
+ label='$id',
+ #end if
+ choices=$choices,
+ labels=$labels,
+#if $type() == 'radio_buttons'
+ style=$style,
+#end if
+)
+#if not $grid_pos()
+$(parent).Add($win)
+#else
+$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
+#end if
+ self.set_$(id)($value)
+ self._$(id)_chooser.set_value($id)
+
+ Label
+ label
+
+ string
+ #if $label() then 'none' else 'part'#
+
+
+ Default Value
+ value
+ 1
+ raw
+
+
+ Choices
+ choices
+ [1, 2, 3]
+ raw
+
+
+ Labels
+ labels
+ []
+ raw
+
+
+ Type
+ type
+ drop_down
+ enum
+
+
+
+ Grid Position
+ grid_pos
+
+ grid_pos
+
+
+ Notebook
+ notebook
+
+ notebook
+
+ $value in $choices
+ not $labels or len($labels) == len($choices)
+
+This block creates a variable with a drop down, radio buttons, or a button. \
+Leave the label blank to use the variable id as the label. \
+The value index is the index of a particular choice, \
+which defines the default choice when the flow graph starts. \
+The choices must be a list of possible values. \
+Leave labels empty to use the choices as the labels.
+
+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/gr-wxgui/grc/variable_slider.xml b/gr-wxgui/grc/variable_slider.xml
new file mode 100644
index 000000000..09aa4d3d7
--- /dev/null
+++ b/gr-wxgui/grc/variable_slider.xml
@@ -0,0 +1,139 @@
+
+
+
+ WX GUI Slider
+ variable_slider
+ Variables
+ from gnuradio.wxgui import forms
+ self.$(id) = $(id) = $value
+ #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+#set $win = '_%s_sizer'%$id
+$win = wx.BoxSizer(wx.VERTICAL)
+self._$(id)_text_box = forms.text_box(
+ parent=$(parent).GetWin(),
+ sizer=$win,
+ value=self.$id,
+ callback=self.set_$(id),
+ #if $label()
+ label=$label,
+ #else
+ label='$id',
+ #end if
+ converter=forms.$(converver)(),
+ proportion=0,
+)
+self._$(id)_slider = forms.slider(
+ parent=$(parent).GetWin(),
+ sizer=$win,
+ value=self.$id,
+ callback=self.set_$(id),
+ minimum=$min,
+ maximum=$max,
+ num_steps=$num_steps,
+ style=$style,
+ cast=$(converver.slider_cast),
+ proportion=1,
+)
+#if not $grid_pos()
+$(parent).Add($win)
+#else
+$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
+#end if
+ self.set_$(id)($value)
+ self._$(id)_slider.set_value($id)
+ self._$(id)_text_box.set_value($id)
+
+ Label
+ label
+
+ string
+ #if $label() then 'none' else 'part'#
+
+
+ Default Value
+ value
+ 50
+ real
+
+
+ Minimum
+ min
+ 0
+ real
+
+
+ Maximum
+ max
+ 100
+ real
+
+
+ Num Steps
+ num_steps
+ 100
+ int
+ part
+
+
+ Style
+ style
+ wx.SL_HORIZONTAL
+ enum
+ part
+
+
+
+ Grid Position
+ grid_pos
+
+ grid_pos
+
+
+ Notebook
+ notebook
+
+ notebook
+
+ $min <= $value <= $max
+ $min < $max
+ 0 < $num_steps <= 1000
+
+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 minimum and the maximum. \
+The number of steps must be between 0 and 1000.
+
+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/gr-wxgui/grc/variable_static_text.xml b/gr-wxgui/grc/variable_static_text.xml
new file mode 100644
index 000000000..d7bb30eea
--- /dev/null
+++ b/gr-wxgui/grc/variable_static_text.xml
@@ -0,0 +1,98 @@
+
+
+
+ WX GUI Static Text
+ variable_static_text
+ Variables
+ from gnuradio.wxgui import forms
+ self.$(id) = $(id) = $value
+ #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+#set $win = 'self._%s_static_text'%$id
+$win = forms.static_text(
+ parent=$(parent).GetWin(),
+ value=self.$id,
+ callback=self.set_$(id),
+ #if $label()
+ label=$label,
+ #else
+ label='$id',
+ #end if
+ #if $formatter()
+ converter=forms.$(converver)(formatter=$formatter),
+ #else
+ converter=forms.$(converver)(),
+ #end if
+)
+#if not $grid_pos()
+$(parent).Add($win)
+#else
+$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
+#end if
+ self.set_$(id)($value)
+ self._$(id)_static_text.set_value($id)
+
+ Label
+ label
+
+ string
+ #if $label() then 'none' else 'part'#
+
+
+ Default Value
+ value
+ 0
+ raw
+
+
+ Converter
+ converver
+ float_converter
+ enum
+
+ Float
+ float_converter
+
+
+ Integer
+ int_converter
+
+
+ String
+ str_converter
+
+
+
+ Formatter
+ formatter
+ None
+ raw
+ part
+
+
+ Grid Position
+ grid_pos
+
+ grid_pos
+
+
+ Notebook
+ notebook
+
+ notebook
+
+
+This block creates a variable with a static text form. \
+Leave the label blank to use the variable id as the label.
+
+Format should be a function/lambda that converts a value into a string or None for the default formatter.
+
+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/gr-wxgui/grc/variable_text_box.xml b/gr-wxgui/grc/variable_text_box.xml
new file mode 100644
index 000000000..c5416aee7
--- /dev/null
+++ b/gr-wxgui/grc/variable_text_box.xml
@@ -0,0 +1,102 @@
+
+
+
+ WX GUI Text Box
+ variable_text_box
+ Variables
+ from gnuradio.wxgui import forms
+ self.$(id) = $(id) = $value
+ #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+#set $win = 'self._%s_text_box'%$id
+$win = forms.text_box(
+ parent=$(parent).GetWin(),
+ value=self.$id,
+ callback=self.set_$(id),
+ #if $label()
+ label=$label,
+ #else
+ label='$id',
+ #end if
+ #if $formatter()
+ converter=forms.$(converver)(formatter=$formatter),
+ #else
+ converter=forms.$(converver)(),
+ #end if
+)
+#if not $grid_pos()
+$(parent).Add($win)
+#else
+$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
+#end if
+ self.set_$(id)($value)
+ self._$(id)_text_box.set_value($id)
+
+ Label
+ label
+
+ string
+ #if $label() then 'none' else 'part'#
+
+
+ Default Value
+ value
+ 0
+ raw
+
+
+ Converter
+ converver
+ float_converter
+ enum
+
+ Float
+ float_converter
+
+
+ Integer
+ int_converter
+
+
+ String
+ str_converter
+
+
+ Evaluate
+ eval_converter
+
+
+
+ Formatter
+ formatter
+ None
+ raw
+ part
+
+
+ Grid Position
+ grid_pos
+
+ grid_pos
+
+
+ Notebook
+ notebook
+
+ notebook
+
+
+This block creates a variable with a text box. \
+Leave the label blank to use the variable id as the label.
+
+Format should be a function/lambda that converts a value into a string or None for the default formatter.
+
+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/gr-wxgui/grc/wxgui_constellationsink2.xml b/gr-wxgui/grc/wxgui_constellationsink2.xml
new file mode 100644
index 000000000..881c6eba3
--- /dev/null
+++ b/gr-wxgui/grc/wxgui_constellationsink2.xml
@@ -0,0 +1,139 @@
+
+
+
+ WX GUI Constellation Sink
+ wxgui_constellationsink2
+ from gnuradio.wxgui import constsink_gl
+ #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+constsink_gl.const_sink_c(
+ $(parent).GetWin(),
+ title=$title,
+ sample_rate=$samp_rate,
+ frame_rate=$frame_rate,
+ const_size=$const_size,
+ M=$M,
+ theta=$theta,
+ alpha=$alpha,
+ fmax=$fmax,
+ mu=$mu,
+ gain_mu=$gain_mu,
+ symbol_rate=$symbol_rate,
+ omega_limit=$omega_limit,
+#if $win_size()
+ size=$win_size,
+#end if
+)
+#if not $grid_pos()
+$(parent).Add(self.$(id).win)
+#else
+$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
+#end if
+ set_sample_rate($samp_rate)
+
+ Title
+ title
+ Constellation Plot
+ string
+
+
+ Sample Rate
+ samp_rate
+ samp_rate
+ real
+
+
+ Frame Rate
+ frame_rate
+ 5
+ real
+
+
+ Constellation Size
+ const_size
+ 2048
+ real
+
+
+ M
+ M
+ 4
+ int
+
+
+ Theta
+ theta
+ 0
+ real
+
+
+ Alpha
+ alpha
+ 0.005
+ real
+
+
+ Max Freq
+ fmax
+ 0.06
+ real
+
+
+ Mu
+ mu
+ 0.5
+ real
+
+
+ Gain Mu
+ gain_mu
+ 0.005
+ real
+
+
+ Symbol Rate
+ symbol_rate
+ samp_rate/4.
+ real
+
+
+ Omega Limit
+ omega_limit
+ 0.005
+ real
+
+
+ Window Size
+ win_size
+
+ int_vector
+ #if $win_size() then 'none' else 'part'#
+
+
+ Grid Position
+ grid_pos
+
+ grid_pos
+
+
+ Notebook
+ notebook
+
+ notebook
+
+ not $win_size or len($win_size) == 2
+
+ in
+ complex
+
+
+Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels.
+
+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/gr-wxgui/grc/wxgui_fftsink2.xml b/gr-wxgui/grc/wxgui_fftsink2.xml
new file mode 100644
index 000000000..b06220d1e
--- /dev/null
+++ b/gr-wxgui/grc/wxgui_fftsink2.xml
@@ -0,0 +1,232 @@
+
+
+
+ WX GUI FFT Sink
+ wxgui_fftsink2
+ from gnuradio import window
+ from gnuradio.wxgui import fftsink2
+ #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+fftsink2.$(type.fcn)(
+ $(parent).GetWin(),
+ baseband_freq=$baseband_freq,
+ y_per_div=$y_per_div,
+ y_divs=$y_divs,
+ ref_level=$ref_level,
+ ref_scale=$ref_scale,
+ sample_rate=$samp_rate,
+ fft_size=$fft_size,
+ fft_rate=$fft_rate,
+ average=$average,
+ avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#,
+ title=$title,
+ peak_hold=$peak_hold,
+#if $win()
+ win=$win,
+#end if
+#if $win_size()
+ size=$win_size,
+#end if
+)
+#if not $grid_pos()
+$(parent).Add(self.$(id).win)
+#else
+$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
+#end if
+ set_baseband_freq($baseband_freq)
+ set_sample_rate($samp_rate)
+
+ Type
+ type
+ complex
+ enum
+
+ Complex
+ complex
+ fcn:fft_sink_c
+
+
+ Float
+ float
+ fcn:fft_sink_f
+
+
+
+ Title
+ title
+ FFT Plot
+ string
+
+
+ Sample Rate
+ samp_rate
+ samp_rate
+ real
+
+
+ Baseband Freq
+ baseband_freq
+ 0
+ real
+
+
+ Y per Div
+ y_per_div
+ 10
+ enum
+
+ 1 dB
+ 1
+
+
+ 2 dB
+ 2
+
+
+ 5 dB
+ 5
+
+
+ 10 dB
+ 10
+
+
+ 20 dB
+ 20
+
+
+
+ Y Divs
+ y_divs
+ 10
+ int
+
+
+ Ref Level (dB)
+ ref_level
+ 50
+ real
+
+
+ Ref Scale (p2p)
+ ref_scale
+ 2.0
+ real
+
+
+ FFT Size
+ fft_size
+ 1024
+ int
+
+
+ Refresh Rate
+ fft_rate
+ 30
+ int
+
+
+ Peak Hold
+ peak_hold
+ False
+ enum
+ #if $peak_hold() == 'True' then 'none' else 'part'#
+
+ On
+ True
+
+
+ Off
+ False
+
+
+
+ Average
+ average
+ False
+ enum
+ part
+
+ On
+ True
+
+
+ Off
+ False
+
+
+
+ Average Alpha
+ avg_alpha
+ 0
+ real
+ #if $average() == 'True' then 'none' else 'all'#
+
+
+ Window
+ win
+ None
+ raw
+ #if $win() is None then 'part' else 'none'#
+
+ Automatic
+ None
+
+
+ Blackman-Harris
+ window.blackmanharris
+
+
+ Hamming
+ window.hamming
+
+
+ Hanning
+ window.hanning
+
+
+ Rectangular
+ window.rectangular
+
+
+ Flattop
+ window.flattop
+
+
+
+ Window Size
+ win_size
+
+ int_vector
+ #if $win_size() then 'none' else 'part'#
+
+
+ Grid Position
+ grid_pos
+
+ grid_pos
+
+
+ Notebook
+ notebook
+
+ notebook
+
+ not $win_size or len($win_size) == 2
+
+ in
+ $type
+
+
+Set Average Alpha to 0 for automatic setting.
+
+Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels.
+
+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/gr-wxgui/grc/wxgui_histosink2.xml b/gr-wxgui/grc/wxgui_histosink2.xml
new file mode 100644
index 000000000..2f475fe2e
--- /dev/null
+++ b/gr-wxgui/grc/wxgui_histosink2.xml
@@ -0,0 +1,77 @@
+
+
+
+ WX GUI Histo Sink
+ wxgui_histosink2
+ from gnuradio.wxgui import histosink_gl
+ #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+histosink_gl.histo_sink_f(
+ $(parent).GetWin(),
+ title=$title,
+ num_bins=$num_bins,
+ frame_size=$frame_size,
+#if $win_size()
+ size=$win_size,
+#end if
+)
+#if not $grid_pos()
+$(parent).Add(self.$(id).win)
+#else
+$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
+#end if
+ set_num_bins($num_bins)
+ set_frame_size($frame_size)
+
+ Title
+ title
+ Histogram Plot
+ string
+
+
+ Num Bins
+ num_bins
+ 27
+ int
+
+
+ Frame Size
+ frame_size
+ 1000
+ int
+
+
+ Window Size
+ win_size
+
+ int_vector
+ #if $win_size() then 'none' else 'part'#
+
+
+ Grid Position
+ grid_pos
+
+ grid_pos
+
+
+ Notebook
+ notebook
+
+ notebook
+
+ not $win_size or len($win_size) == 2
+
+ in
+ float
+
+
+Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels.
+
+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/gr-wxgui/grc/wxgui_numbersink2.xml b/gr-wxgui/grc/wxgui_numbersink2.xml
new file mode 100644
index 000000000..b3b4cb254
--- /dev/null
+++ b/gr-wxgui/grc/wxgui_numbersink2.xml
@@ -0,0 +1,192 @@
+
+
+
+ WX GUI Number Sink
+ wxgui_numbersink2
+ from gnuradio.wxgui import numbersink2
+ #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+numbersink2.$(type.fcn)(
+ $(parent).GetWin(),
+ unit=$units,
+ minval=$min_value,
+ maxval=$max_value,
+ factor=$factor,
+ decimal_places=$decimal_places,
+ ref_level=$ref_level,
+ sample_rate=$samp_rate,
+ number_rate=$number_rate,
+ average=$average,
+ avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#,
+ label=$title,
+ peak_hold=$peak_hold,
+ show_gauge=$show_gauge,
+#if $win_size()
+ size=$win_size,
+#end if
+)
+#if not $grid_pos()
+$(parent).Add(self.$(id).win)
+#else
+$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
+#end if
+
+ Type
+ type
+ complex
+ enum
+
+ Complex
+ complex
+ fcn:number_sink_c
+
+
+ Float
+ float
+ fcn:number_sink_f
+
+
+
+ Title
+ title
+ Number Plot
+ string
+
+
+ Units
+ units
+ Units
+ string
+
+
+ Sample Rate
+ samp_rate
+ samp_rate
+ real
+
+
+ Min Value
+ min_value
+ -100
+ real
+
+
+ Max Value
+ max_value
+ 100
+ real
+
+
+ Factor
+ factor
+ 1.0
+ real
+
+
+ Decimal Places
+ decimal_places
+ 10
+ int
+
+
+ Reference Level
+ ref_level
+ 0
+ real
+
+
+ Number Rate
+ number_rate
+ 15
+ int
+
+
+ Peak Hold
+ peak_hold
+ False
+ enum
+ #if $peak_hold() == 'True' then 'none' else 'part'#
+
+ On
+ True
+
+
+ Off
+ False
+
+
+
+ Average
+ average
+ False
+ enum
+ part
+
+ On
+ True
+
+
+ Off
+ False
+
+
+
+ Average Alpha
+ avg_alpha
+ 0
+ real
+ #if $average() == 'True' then 'none' else 'all'#
+
+
+ Show Gauge
+ show_gauge
+ True
+ enum
+
+ Show
+ True
+
+
+ Hide
+ False
+
+
+
+ Window Size
+ win_size
+
+ int_vector
+ #if $win_size() then 'none' else 'part'#
+
+
+ Grid Position
+ grid_pos
+
+ grid_pos
+
+
+ Notebook
+ notebook
+
+ notebook
+
+ not $win_size or len($win_size) == 2
+
+ in
+ $type
+
+
+Set Average Alpha to 0 for automatic setting.
+
+Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels.
+
+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.
+
+Incoming numbers are multiplied by the factor, and then added-to by the reference level.
+
+
diff --git a/gr-wxgui/grc/wxgui_scopesink2.xml b/gr-wxgui/grc/wxgui_scopesink2.xml
new file mode 100644
index 000000000..43922f45e
--- /dev/null
+++ b/gr-wxgui/grc/wxgui_scopesink2.xml
@@ -0,0 +1,186 @@
+
+
+
+ WX GUI Scope Sink
+ wxgui_scopesink2
+ from gnuradio.wxgui import scopesink2
+ from gnuradio import gr
+ #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+scopesink2.$(type.fcn)(
+ $(parent).GetWin(),
+ title=$title,
+ sample_rate=$samp_rate,
+ v_scale=$v_scale,
+ v_offset=$v_offset,
+ t_scale=$t_scale,
+ ac_couple=$ac_couple,
+ xy_mode=$xy_mode,
+ num_inputs=$num_inputs,
+ trig_mode=$trig_mode,
+ y_axis_label=$y_axis_label,
+#if $win_size()
+ size=$win_size,
+#end if
+)
+#if not $grid_pos()
+$(parent).Add(self.$(id).win)
+#else
+$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
+#end if
+ set_sample_rate($samp_rate)
+
+ Type
+ type
+ complex
+ enum
+
+ Complex
+ complex
+ fcn:scope_sink_c
+
+
+ Float
+ float
+ fcn:scope_sink_f
+
+
+
+ Title
+ title
+ Scope Plot
+ string
+
+
+ Sample Rate
+ samp_rate
+ samp_rate
+ real
+
+
+ V Scale
+ v_scale
+ 0
+ real
+ #if $v_scale() then 'none' else 'part'#
+
+
+ V Offset
+ v_offset
+ 0
+ real
+ #if $v_offset() then 'none' else 'part'#
+
+
+ T Scale
+ t_scale
+ 0
+ real
+ #if $t_scale() then 'none' else 'part'#
+
+
+ AC Couple
+ ac_couple
+ False
+ bool
+ #if $ac_couple() then 'none' else 'part'#
+
-
-
- Grid Position
- grid_pos
-
- grid_pos
-
-
- Notebook
- notebook
-
- notebook
-
- $value in $choices
- not $labels or len($labels) == len($choices)
-
-This block creates a variable with a drop down, radio buttons, or a button. \
-Leave the label blank to use the variable id as the label. \
-The value index is the index of a particular choice, \
-which defines the default choice when the flow graph starts. \
-The choices must be a list of possible values. \
-Leave labels empty to use the choices as the labels.
-
-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/blocks/variable_slider.xml b/grc/blocks/variable_slider.xml
deleted file mode 100644
index c13d20856..000000000
--- a/grc/blocks/variable_slider.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
- Variable Slider
- variable_slider
- from gnuradio.wxgui import forms
- self.$(id) = $(id) = $value
- #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
-#set $win = '_%s_sizer'%$id
-$win = wx.BoxSizer(wx.VERTICAL)
-self._$(id)_text_box = forms.text_box(
- parent=$(parent).GetWin(),
- sizer=$win,
- value=self.$id,
- callback=self.set_$(id),
- #if $label()
- label=$label,
- #else
- label='$id',
- #end if
- converter=forms.$(converver)(),
- proportion=0,
-)
-self._$(id)_slider = forms.slider(
- parent=$(parent).GetWin(),
- sizer=$win,
- value=self.$id,
- callback=self.set_$(id),
- minimum=$min,
- maximum=$max,
- num_steps=$num_steps,
- style=$style,
- cast=$(converver.slider_cast),
- proportion=1,
-)
-#if not $grid_pos()
-$(parent).Add($win)
-#else
-$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
-#end if
- self.set_$(id)($value)
- self._$(id)_slider.set_value($id)
- self._$(id)_text_box.set_value($id)
-
- Label
- label
-
- string
- #if $label() then 'none' else 'part'#
-
-
- Default Value
- value
- 50
- real
-
-
- Minimum
- min
- 0
- real
-
-
- Maximum
- max
- 100
- real
-
-
- Num Steps
- num_steps
- 100
- int
- part
-
-
- Style
- style
- wx.SL_HORIZONTAL
- enum
- part
-
-
-
- Grid Position
- grid_pos
-
- grid_pos
-
-
- Notebook
- notebook
-
- notebook
-
- $min <= $value <= $max
- $min < $max
- 0 < $num_steps <= 1000
-
-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 minimum and the maximum. \
-The number of steps must be between 0 and 1000.
-
-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/blocks/variable_static_text.xml b/grc/blocks/variable_static_text.xml
deleted file mode 100644
index c866b998d..000000000
--- a/grc/blocks/variable_static_text.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
- Variable Static Text
- variable_static_text
- from gnuradio.wxgui import forms
- self.$(id) = $(id) = $value
- #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
-#set $win = 'self._%s_static_text'%$id
-$win = forms.static_text(
- parent=$(parent).GetWin(),
- value=self.$id,
- callback=self.set_$(id),
- #if $label()
- label=$label,
- #else
- label='$id',
- #end if
- #if $formatter()
- converter=forms.$(converver)(formatter=$formatter),
- #else
- converter=forms.$(converver)(),
- #end if
-)
-#if not $grid_pos()
-$(parent).Add($win)
-#else
-$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
-#end if
- self.set_$(id)($value)
- self._$(id)_static_text.set_value($id)
-
- Label
- label
-
- string
- #if $label() then 'none' else 'part'#
-
-
- Default Value
- value
- 0
- raw
-
-
- Converter
- converver
- float_converter
- enum
-
- Float
- float_converter
-
-
- Integer
- int_converter
-
-
- String
- str_converter
-
-
-
- Formatter
- formatter
- None
- raw
- part
-
-
- Grid Position
- grid_pos
-
- grid_pos
-
-
- Notebook
- notebook
-
- notebook
-
-
-This block creates a variable with a static text form. \
-Leave the label blank to use the variable id as the label.
-
-Format should be a function/lambda that converts a value into a string or None for the default formatter.
-
-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/blocks/variable_text_box.xml b/grc/blocks/variable_text_box.xml
deleted file mode 100644
index 1b4b4355e..000000000
--- a/grc/blocks/variable_text_box.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
- Variable Text Box
- variable_text_box
- from gnuradio.wxgui import forms
- self.$(id) = $(id) = $value
- #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
-#set $win = 'self._%s_text_box'%$id
-$win = forms.text_box(
- parent=$(parent).GetWin(),
- value=self.$id,
- callback=self.set_$(id),
- #if $label()
- label=$label,
- #else
- label='$id',
- #end if
- #if $formatter()
- converter=forms.$(converver)(formatter=$formatter),
- #else
- converter=forms.$(converver)(),
- #end if
-)
-#if not $grid_pos()
-$(parent).Add($win)
-#else
-$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
-#end if
- self.set_$(id)($value)
- self._$(id)_text_box.set_value($id)
-
- Label
- label
-
- string
- #if $label() then 'none' else 'part'#
-
-
- Default Value
- value
- 0
- raw
-
-
- Converter
- converver
- float_converter
- enum
-
- Float
- float_converter
-
-
- Integer
- int_converter
-
-
- String
- str_converter
-
-
- Evaluate
- eval_converter
-
-
-
- Formatter
- formatter
- None
- raw
- part
-
-
- Grid Position
- grid_pos
-
- grid_pos
-
-
- Notebook
- notebook
-
- notebook
-
-
-This block creates a variable with a text box. \
-Leave the label blank to use the variable id as the label.
-
-Format should be a function/lambda that converts a value into a string or None for the default formatter.
-
-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/blocks/wxgui_constellationsink2.xml b/grc/blocks/wxgui_constellationsink2.xml
deleted file mode 100644
index 598b55064..000000000
--- a/grc/blocks/wxgui_constellationsink2.xml
+++ /dev/null
@@ -1,139 +0,0 @@
-
-
-
- Constellation Sink
- wxgui_constellationsink2
- from gnuradio.wxgui import constsink_gl
- #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
-constsink_gl.const_sink_c(
- $(parent).GetWin(),
- title=$title,
- sample_rate=$samp_rate,
- frame_rate=$frame_rate,
- const_size=$const_size,
- M=$M,
- theta=$theta,
- alpha=$alpha,
- fmax=$fmax,
- mu=$mu,
- gain_mu=$gain_mu,
- symbol_rate=$symbol_rate,
- omega_limit=$omega_limit,
-#if $win_size()
- size=$win_size,
-#end if
-)
-#if not $grid_pos()
-$(parent).Add(self.$(id).win)
-#else
-$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
-#end if
- set_sample_rate($samp_rate)
-
- Title
- title
- Constellation Plot
- string
-
-
- Sample Rate
- samp_rate
- samp_rate
- real
-
-
- Frame Rate
- frame_rate
- 5
- real
-
-
- Constellation Size
- const_size
- 2048
- real
-
-
- M
- M
- 4
- int
-
-
- Theta
- theta
- 0
- real
-
-
- Alpha
- alpha
- 0.005
- real
-
-
- Max Freq
- fmax
- 0.06
- real
-
-
- Mu
- mu
- 0.5
- real
-
-
- Gain Mu
- gain_mu
- 0.005
- real
-
-
- Symbol Rate
- symbol_rate
- samp_rate/4.
- real
-
-
- Omega Limit
- omega_limit
- 0.005
- real
-
-
- Window Size
- win_size
-
- int_vector
- #if $win_size() then 'none' else 'part'#
-
-
- Grid Position
- grid_pos
-
- grid_pos
-
-
- Notebook
- notebook
-
- notebook
-
- not $win_size or len($win_size) == 2
-
- in
- complex
-
-
-Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels.
-
-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/blocks/wxgui_fftsink2.xml b/grc/blocks/wxgui_fftsink2.xml
deleted file mode 100644
index 8df8f90d0..000000000
--- a/grc/blocks/wxgui_fftsink2.xml
+++ /dev/null
@@ -1,232 +0,0 @@
-
-
-
- FFT Sink
- wxgui_fftsink2
- from gnuradio import window
- from gnuradio.wxgui import fftsink2
- #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
-fftsink2.$(type.fcn)(
- $(parent).GetWin(),
- baseband_freq=$baseband_freq,
- y_per_div=$y_per_div,
- y_divs=$y_divs,
- ref_level=$ref_level,
- ref_scale=$ref_scale,
- sample_rate=$samp_rate,
- fft_size=$fft_size,
- fft_rate=$fft_rate,
- average=$average,
- avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#,
- title=$title,
- peak_hold=$peak_hold,
-#if $win()
- win=$win,
-#end if
-#if $win_size()
- size=$win_size,
-#end if
-)
-#if not $grid_pos()
-$(parent).Add(self.$(id).win)
-#else
-$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
-#end if
- set_baseband_freq($baseband_freq)
- set_sample_rate($samp_rate)
-
- Type
- type
- complex
- enum
-
- Complex
- complex
- fcn:fft_sink_c
-
-
- Float
- float
- fcn:fft_sink_f
-
-
-
- Title
- title
- FFT Plot
- string
-
-
- Sample Rate
- samp_rate
- samp_rate
- real
-
-
- Baseband Freq
- baseband_freq
- 0
- real
-
-
- Y per Div
- y_per_div
- 10
- enum
-
- 1 dB
- 1
-
-
- 2 dB
- 2
-
-
- 5 dB
- 5
-
-
- 10 dB
- 10
-
-
- 20 dB
- 20
-
-
-
- Y Divs
- y_divs
- 10
- int
-
-
- Ref Level (dB)
- ref_level
- 50
- real
-
-
- Ref Scale (p2p)
- ref_scale
- 2.0
- real
-
-
- FFT Size
- fft_size
- 1024
- int
-
-
- Refresh Rate
- fft_rate
- 30
- int
-
-
- Peak Hold
- peak_hold
- False
- enum
- #if $peak_hold() == 'True' then 'none' else 'part'#
-
- On
- True
-
-
- Off
- False
-
-
-
- Average
- average
- False
- enum
- part
-
- On
- True
-
-
- Off
- False
-
-
-
- Average Alpha
- avg_alpha
- 0
- real
- #if $average() == 'True' then 'none' else 'all'#
-
-
- Window
- win
- None
- raw
- #if $win() is None then 'part' else 'none'#
-
- Automatic
- None
-
-
- Blackman-Harris
- window.blackmanharris
-
-
- Hamming
- window.hamming
-
-
- Hanning
- window.hanning
-
-
- Rectangular
- window.rectangular
-
-
- Flattop
- window.flattop
-
-
-
- Window Size
- win_size
-
- int_vector
- #if $win_size() then 'none' else 'part'#
-
-
- Grid Position
- grid_pos
-
- grid_pos
-
-
- Notebook
- notebook
-
- notebook
-
- not $win_size or len($win_size) == 2
-
- in
- $type
-
-
-Set Average Alpha to 0 for automatic setting.
-
-Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels.
-
-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/blocks/wxgui_histosink2.xml b/grc/blocks/wxgui_histosink2.xml
deleted file mode 100644
index 9edf9650d..000000000
--- a/grc/blocks/wxgui_histosink2.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
- Histo Sink
- wxgui_histosink2
- from gnuradio.wxgui import histosink_gl
- #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
-histosink_gl.histo_sink_f(
- $(parent).GetWin(),
- title=$title,
- num_bins=$num_bins,
- frame_size=$frame_size,
-#if $win_size()
- size=$win_size,
-#end if
-)
-#if not $grid_pos()
-$(parent).Add(self.$(id).win)
-#else
-$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
-#end if
- set_num_bins($num_bins)
- set_frame_size($frame_size)
-
- Title
- title
- Histogram Plot
- string
-
-
- Num Bins
- num_bins
- 27
- int
-
-
- Frame Size
- frame_size
- 1000
- int
-
-
- Window Size
- win_size
-
- int_vector
- #if $win_size() then 'none' else 'part'#
-
-
- Grid Position
- grid_pos
-
- grid_pos
-
-
- Notebook
- notebook
-
- notebook
-
- not $win_size or len($win_size) == 2
-
- in
- float
-
-
-Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels.
-
-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/blocks/wxgui_numbersink2.xml b/grc/blocks/wxgui_numbersink2.xml
deleted file mode 100644
index ad93dec08..000000000
--- a/grc/blocks/wxgui_numbersink2.xml
+++ /dev/null
@@ -1,192 +0,0 @@
-
-
-
- Number Sink
- wxgui_numbersink2
- from gnuradio.wxgui import numbersink2
- #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
-numbersink2.$(type.fcn)(
- $(parent).GetWin(),
- unit=$units,
- minval=$min_value,
- maxval=$max_value,
- factor=$factor,
- decimal_places=$decimal_places,
- ref_level=$ref_level,
- sample_rate=$samp_rate,
- number_rate=$number_rate,
- average=$average,
- avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#,
- label=$title,
- peak_hold=$peak_hold,
- show_gauge=$show_gauge,
-#if $win_size()
- size=$win_size,
-#end if
-)
-#if not $grid_pos()
-$(parent).Add(self.$(id).win)
-#else
-$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
-#end if
-
- Type
- type
- complex
- enum
-
- Complex
- complex
- fcn:number_sink_c
-
-
- Float
- float
- fcn:number_sink_f
-
-
-
- Title
- title
- Number Plot
- string
-
-
- Units
- units
- Units
- string
-
-
- Sample Rate
- samp_rate
- samp_rate
- real
-
-
- Min Value
- min_value
- -100
- real
-
-
- Max Value
- max_value
- 100
- real
-
-
- Factor
- factor
- 1.0
- real
-
-
- Decimal Places
- decimal_places
- 10
- int
-
-
- Reference Level
- ref_level
- 0
- real
-
-
- Number Rate
- number_rate
- 15
- int
-
-
- Peak Hold
- peak_hold
- False
- enum
- #if $peak_hold() == 'True' then 'none' else 'part'#
-
- On
- True
-
-
- Off
- False
-
-
-
- Average
- average
- False
- enum
- part
-
- On
- True
-
-
- Off
- False
-
-
-
- Average Alpha
- avg_alpha
- 0
- real
- #if $average() == 'True' then 'none' else 'all'#
-
-
- Show Gauge
- show_gauge
- True
- enum
-
- Show
- True
-
-
- Hide
- False
-
-
-
- Window Size
- win_size
-
- int_vector
- #if $win_size() then 'none' else 'part'#
-
-
- Grid Position
- grid_pos
-
- grid_pos
-
-
- Notebook
- notebook
-
- notebook
-
- not $win_size or len($win_size) == 2
-
- in
- $type
-
-
-Set Average Alpha to 0 for automatic setting.
-
-Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels.
-
-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.
-
-Incoming numbers are multiplied by the factor, and then added-to by the reference level.
-
-
diff --git a/grc/blocks/wxgui_scopesink2.xml b/grc/blocks/wxgui_scopesink2.xml
deleted file mode 100644
index ef0377373..000000000
--- a/grc/blocks/wxgui_scopesink2.xml
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-
- Scope Sink
- wxgui_scopesink2
- from gnuradio.wxgui import scopesink2
- from gnuradio import gr
- #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
-scopesink2.$(type.fcn)(
- $(parent).GetWin(),
- title=$title,
- sample_rate=$samp_rate,
- v_scale=$v_scale,
- v_offset=$v_offset,
- t_scale=$t_scale,
- ac_couple=$ac_couple,
- xy_mode=$xy_mode,
- num_inputs=$num_inputs,
- trig_mode=$trig_mode,
- y_axis_label=$y_axis_label,
-#if $win_size()
- size=$win_size,
-#end if
-)
-#if not $grid_pos()
-$(parent).Add(self.$(id).win)
-#else
-$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
-#end if
- set_sample_rate($samp_rate)
-
- Type
- type
- complex
- enum
-
- Complex
- complex
- fcn:scope_sink_c
-
-
- Float
- float
- fcn:scope_sink_f
-
-
-
- Title
- title
- Scope Plot
- string
-
-
- Sample Rate
- samp_rate
- samp_rate
- real
-
-
- V Scale
- v_scale
- 0
- real
- #if $v_scale() then 'none' else 'part'#
-
-
- V Offset
- v_offset
- 0
- real
- #if $v_offset() then 'none' else 'part'#
-
-
- T Scale
- t_scale
- 0
- real
- #if $t_scale() then 'none' else 'part'#
-
-
- AC Couple
- ac_couple
- False
- bool
- #if $ac_couple() then 'none' else 'part'#
-
-
-
- Y Axis Label
- y_axis_label
- Counts
- string
-
- not $win_size or len($win_size) == 2
- not $xy_mode or '$type' == 'complex' or $num_inputs != 1
-
- in
- $type
- $num_inputs
-
-
-Set the V Scale to 0 for the scope to auto-scale.
-
-Set the T Scale to 0 for automatic setting.
-
-XY Mode allows the scope to initialize as an XY plotter.
-
-Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels.
-
-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/blocks/wxgui_termsink.xml b/grc/blocks/wxgui_termsink.xml
deleted file mode 100644
index 985d89b58..000000000
--- a/grc/blocks/wxgui_termsink.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
- Terminal Sink
- wxgui_termsink
-
- from gnuradio.wxgui import termsink
-
- #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
-termsink.termsink(
- parent=$(parent).GetWin(),
-#if $win_size()
- size=$win_size,
-#end if
- msgq=$(id)_msgq_in,
-)
-#if not $grid_pos()
-$(parent).Add(self.$(id))
-#else
-$(parent).GridAdd(self.$(id), $(', '.join(map(str, $grid_pos()))))
-#end if
-
-
- Window Size
- win_size
-
- int_vector
- #if $win_size() then 'none' else 'part'#
-
-
- Grid Position
- grid_pos
-
- grid_pos
-
-
-
- Notebook
- notebook
-
- notebook
-
-
- not $win_size or len($win_size) == 2
-
-
- in
- msg
-
-
-
diff --git a/grc/blocks/wxgui_waterfallsink2.xml b/grc/blocks/wxgui_waterfallsink2.xml
deleted file mode 100644
index 3de67597f..000000000
--- a/grc/blocks/wxgui_waterfallsink2.xml
+++ /dev/null
@@ -1,189 +0,0 @@
-
-
-
- Waterfall Sink
- wxgui_waterfallsink2
- from gnuradio import window
- from gnuradio.wxgui import waterfallsink2
- #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
-waterfallsink2.$(type.fcn)(
- $(parent).GetWin(),
- baseband_freq=$baseband_freq,
- dynamic_range=$dynamic_range,
- ref_level=$ref_level,
- ref_scale=$ref_scale,
- sample_rate=$samp_rate,
- fft_size=$fft_size,
- fft_rate=$fft_rate,
- average=$average,
- avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#,
- title=$title,
-#if $win()
- win=$win,
-#end if
-#if $win_size()
- size=$win_size,
-#end if
-)
-#if not $grid_pos()
-$(parent).Add(self.$(id).win)
-#else
-$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
-#end if
- set_baseband_freq($baseband_freq)
- set_sample_rate($samp_rate)
-
- Type
- type
- complex
- enum
-
- Complex
- complex
- fcn:waterfall_sink_c
-
-
- Float
- float
- fcn:waterfall_sink_f
-
-
-
- Title
- title
- Waterfall Plot
- string
-
-
- Sample Rate
- samp_rate
- samp_rate
- real
-
-
- Baseband Freq
- baseband_freq
- 0
- real
-
-
- Dynamic Range
- dynamic_range
- 100
- real
-
-
- Reference Level
- ref_level
- 50
- real
-
-
- Ref Scale (p2p)
- ref_scale
- 2.0
- real
-
-
- FFT Size
- fft_size
- 512
- int
-
-
- FFT Rate
- fft_rate
- 15
- int
-
-
- Average
- average
- False
- enum
- part
-
- On
- True
-
-
- Off
- False
-
-
-
- Average Alpha
- avg_alpha
- 0
- real
- #if $average() == 'True' then 'none' else 'all'#
-
-
- Window
- win
- None
- raw
- #if $win() is None then 'part' else 'none'#
-
- Automatic
- None
-
-
- Blackman-Harris
- window.blackmanharris
-
-
- Hamming
- window.hamming
-
-
- Hanning
- window.hanning
-
-
- Rectangular
- window.rectangular
-
-
- Flattop
- window.flattop
-
-
-
- Window Size
- win_size
-
- int_vector
- #if $win_size() then 'none' else 'part'#
-
-
- Grid Position
- grid_pos
-
- grid_pos
-
-
- Notebook
- notebook
-
- notebook
-
- not $win_size or len($win_size) == 2
-
- in
- $type
-
-
-Set Average Alpha to 0 for automatic setting.
-
-Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels.
-
-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/grc_gnuradio/Makefile.am b/grc/grc_gnuradio/Makefile.am
index 63bb72822..c53d07b4e 100644
--- a/grc/grc_gnuradio/Makefile.am
+++ b/grc/grc_gnuradio/Makefile.am
@@ -42,9 +42,3 @@ usrp_python_PYTHON = \
usrp/common.py \
usrp/dual_usrp.py \
usrp/simple_usrp.py
-
-wxgui_pythondir = $(grc_gnuradio_prefix)/wxgui
-wxgui_python_PYTHON = \
- wxgui/__init__.py \
- wxgui/panel.py \
- wxgui/top_block_gui.py
diff --git a/grc/grc_gnuradio/wxgui/__init__.py b/grc/grc_gnuradio/wxgui/__init__.py
deleted file mode 100644
index 81427253b..000000000
--- a/grc/grc_gnuradio/wxgui/__init__.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2008, 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 top_block_gui import top_block_gui
-from panel import Panel
diff --git a/grc/grc_gnuradio/wxgui/panel.py b/grc/grc_gnuradio/wxgui/panel.py
deleted file mode 100644
index e62133cac..000000000
--- a/grc/grc_gnuradio/wxgui/panel.py
+++ /dev/null
@@ -1,49 +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.
-#
-
-import wx
-
-class Panel(wx.Panel):
- def __init__(self, parent, orient=wx.VERTICAL):
- wx.Panel.__init__(self, parent)
- self._box = wx.BoxSizer(orient)
- self._grid = wx.GridBagSizer(5, 5)
- self.Add(self._grid)
- self.SetSizer(self._box)
-
- def GetWin(self): return self
-
- def Add(self, win):
- """
- Add a window to the wx vbox.
- @param win the wx window
- """
- self._box.Add(win, 0, wx.EXPAND)
-
- def GridAdd(self, win, row, col, row_span=1, col_span=1):
- """
- Add a window to the wx grid at the given position.
- @param win the wx window
- @param row the row specification (integer >= 0)
- @param col the column specification (integer >= 0)
- @param row_span the row span specification (integer >= 1)
- @param col_span the column span specification (integer >= 1)
- """
- self._grid.Add(win, wx.GBPosition(row, col), wx.GBSpan(row_span, col_span), wx.EXPAND)
diff --git a/grc/grc_gnuradio/wxgui/top_block_gui.py b/grc/grc_gnuradio/wxgui/top_block_gui.py
deleted file mode 100644
index 333ccf1c1..000000000
--- a/grc/grc_gnuradio/wxgui/top_block_gui.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright 2008, 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.
-#
-
-import wx
-from gnuradio import gr
-import panel
-
-default_gui_size = (200, 100)
-
-class top_block_gui(gr.top_block):
- """gr top block with wx gui app and grid sizer."""
-
- def __init__(self, title='', size=default_gui_size):
- """
- Initialize the gr top block.
- Create the wx gui elements.
- @param title the main window title
- @param size the main window size tuple in pixels
- @param icon the file path to an icon or None
- """
- #initialize
- gr.top_block.__init__(self)
- self._size = size
- #create gui elements
- self._app = wx.App()
- self._frame = wx.Frame(None, title=title)
- self._panel = panel.Panel(self._frame)
- self.Add = self._panel.Add
- self.GridAdd = self._panel.GridAdd
- self.GetWin = self._panel.GetWin
-
- def SetIcon(self, *args, **kwargs): self._frame.SetIcon(*args, **kwargs)
-
- def Run(self, start=True):
- """
- Setup the wx gui elements.
- Start the gr top block.
- Block with the wx main loop.
- """
- #set minimal window size
- self._frame.SetSizeHints(*self._size)
- #create callback for quit
- def _quit(event):
- self.stop(); self.wait()
- self._frame.Destroy()
- #setup app
- self._frame.Bind(wx.EVT_CLOSE, _quit)
- self._sizer = wx.BoxSizer(wx.VERTICAL)
- self._sizer.Add(self._panel, 0, wx.EXPAND)
- self._frame.SetSizerAndFit(self._sizer)
- self._frame.SetAutoLayout(True)
- self._frame.Show(True)
- self._app.SetTopWindow(self._frame)
- #start flow graph
- if start: self.start()
- #blocking main loop
- self._app.MainLoop()
diff --git a/grc/python/Platform.py b/grc/python/Platform.py
index 04db0b9b0..ec3f94096 100644
--- a/grc/python/Platform.py
+++ b/grc/python/Platform.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
+Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
--
cgit
From 47f621a14c9a6e3696155dd5a223da40bcb7721c Mon Sep 17 00:00:00 2001
From: Josh Blum
Date: Sun, 27 Feb 2011 23:18:11 -0800
Subject: grc: work on generator for gui flowgraphs to simplify generation
generator does not differentiate between notebooks and controls,
they are all block, but block are now sorted by variables present in the make
also adjusted categories listed in the wx and qt widget related blocks
---
gr-qtgui/grc/qtgui_sink_x.xml | 2 +-
gr-qtgui/grc/qtgui_tab_widget.xml | 3 +-
gr-qtgui/grc/qtgui_variable_chooser.xml | 6 +--
gr-qtgui/grc/qtgui_variable_slider.xml | 2 +-
gr-wxgui/grc/Makefile.am | 1 +
gr-wxgui/grc/notebook.xml | 70 +++++++++++++++++++++++++++++++
gr-wxgui/grc/variable_check_box.xml | 2 +-
gr-wxgui/grc/variable_chooser.xml | 2 +-
gr-wxgui/grc/variable_slider.xml | 2 +-
gr-wxgui/grc/variable_static_text.xml | 2 +-
gr-wxgui/grc/variable_text_box.xml | 2 +-
gr-wxgui/grc/wxgui_constellationsink2.xml | 1 +
gr-wxgui/grc/wxgui_fftsink2.xml | 1 +
gr-wxgui/grc/wxgui_histosink2.xml | 1 +
gr-wxgui/grc/wxgui_numbersink2.xml | 1 +
gr-wxgui/grc/wxgui_scopesink2.xml | 1 +
gr-wxgui/grc/wxgui_termsink.xml | 1 +
gr-wxgui/grc/wxgui_waterfallsink2.xml | 1 +
grc/blocks/Makefile.am | 3 +-
grc/blocks/block_tree.xml | 17 +-------
grc/blocks/notebook.xml | 69 ------------------------------
grc/python/Generator.py | 28 ++++++-------
grc/python/Param.py | 2 +-
grc/python/flow_graph.tmpl | 30 ++-----------
24 files changed, 110 insertions(+), 140 deletions(-)
create mode 100644 gr-wxgui/grc/notebook.xml
delete mode 100644 grc/blocks/notebook.xml
diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml
index 6e5c9549b..7a5f5ec13 100644
--- a/gr-qtgui/grc/qtgui_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_sink_x.xml
@@ -7,7 +7,7 @@
QT GUI Sinkqtgui_sink_x
- Graphical Sinks
+ QT GUI Widgetsfrom PyQt4 import Qtfrom gnuradio.qtgui import qtguifrom gnuradio.gr import firdes
diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml
index 66597b454..3c4edfd35 100644
--- a/gr-qtgui/grc/qtgui_tab_widget.xml
+++ b/gr-qtgui/grc/qtgui_tab_widget.xml
@@ -7,9 +7,10 @@
QT GUI Tab Widgetqtgui_tab_widget
+ QT GUI Widgetsfrom PyQt4 import Qt#set $win = 'self.%s'%$id
-$win = Qt.QTabWidget(None)
+Qt.QTabWidget(None)
#for i, label in enumerate([$label0, $label1, $label2, $label3, $label4])
#if int($num_tabs()) > $i
self.$(id)_widget_$(i) = Qt.QWidget()
diff --git a/gr-qtgui/grc/qtgui_variable_chooser.xml b/gr-qtgui/grc/qtgui_variable_chooser.xml
index 46e302bc7..d9c9c8f3f 100644
--- a/gr-qtgui/grc/qtgui_variable_chooser.xml
+++ b/gr-qtgui/grc/qtgui_variable_chooser.xml
@@ -1,14 +1,14 @@
QT GUI Chooservariable_qtgui_chooser
- Variables
+ QT GUI Widgetsfrom PyQt4 import Qtimport PyQt4.Qwt5 as Qwtself.$(id) = $(id) = $value
diff --git a/gr-qtgui/grc/qtgui_variable_slider.xml b/gr-qtgui/grc/qtgui_variable_slider.xml
index 4eeb7a29b..68000fa2f 100644
--- a/gr-qtgui/grc/qtgui_variable_slider.xml
+++ b/gr-qtgui/grc/qtgui_variable_slider.xml
@@ -8,7 +8,7 @@
QT GUI Slidervariable_qtgui_slider
- Variables
+ QT GUI Widgetsfrom PyQt4 import Qtimport PyQt4.Qwt5 as Qwtself.$(id) = $(id) = $value
diff --git a/gr-wxgui/grc/Makefile.am b/gr-wxgui/grc/Makefile.am
index 26217077a..d8c7b3471 100644
--- a/gr-wxgui/grc/Makefile.am
+++ b/gr-wxgui/grc/Makefile.am
@@ -23,6 +23,7 @@ include $(top_srcdir)/Makefile.common
grcblocksdir = $(grc_blocksdir)
dist_grcblocks_DATA = \
+ notebook.xml \
variable_check_box.xml \
variable_chooser.xml \
variable_slider.xml \
diff --git a/gr-wxgui/grc/notebook.xml b/gr-wxgui/grc/notebook.xml
new file mode 100644
index 000000000..bb3de51cb
--- /dev/null
+++ b/gr-wxgui/grc/notebook.xml
@@ -0,0 +1,70 @@
+
+
+
+ WX GUI Notebook
+ notebook
+ WX GUI Widgets
+ 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
+
+ Top
+ wx.NB_TOP
+
+
+ Right
+ wx.NB_RIGHT
+
+
+ Bottom
+ wx.NB_BOTTOM
+
+
+ Left
+ wx.NB_LEFT
+
+
+
+ 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/gr-wxgui/grc/variable_check_box.xml b/gr-wxgui/grc/variable_check_box.xml
index d1e4d990c..0c7bd1081 100644
--- a/gr-wxgui/grc/variable_check_box.xml
+++ b/gr-wxgui/grc/variable_check_box.xml
@@ -8,7 +8,7 @@
WX GUI Check Boxvariable_check_box
- Variables
+ WX GUI Widgetsfrom gnuradio.wxgui import formsself.$(id) = $(id) = $value#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
diff --git a/gr-wxgui/grc/variable_chooser.xml b/gr-wxgui/grc/variable_chooser.xml
index 99bf4389c..e16e88c5d 100644
--- a/gr-wxgui/grc/variable_chooser.xml
+++ b/gr-wxgui/grc/variable_chooser.xml
@@ -9,7 +9,7 @@
WX GUI Chooservariable_chooser
- Variables
+ WX GUI Widgetsfrom gnuradio.wxgui import formsself.$(id) = $(id) = $value#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
diff --git a/gr-wxgui/grc/variable_slider.xml b/gr-wxgui/grc/variable_slider.xml
index 09aa4d3d7..5e3c175aa 100644
--- a/gr-wxgui/grc/variable_slider.xml
+++ b/gr-wxgui/grc/variable_slider.xml
@@ -8,7 +8,7 @@
WX GUI Slidervariable_slider
- Variables
+ WX GUI Widgetsfrom gnuradio.wxgui import formsself.$(id) = $(id) = $value#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
diff --git a/gr-wxgui/grc/variable_static_text.xml b/gr-wxgui/grc/variable_static_text.xml
index d7bb30eea..cd122e76a 100644
--- a/gr-wxgui/grc/variable_static_text.xml
+++ b/gr-wxgui/grc/variable_static_text.xml
@@ -8,7 +8,7 @@
WX GUI Static Textvariable_static_text
- Variables
+ WX GUI Widgetsfrom gnuradio.wxgui import formsself.$(id) = $(id) = $value#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
diff --git a/gr-wxgui/grc/variable_text_box.xml b/gr-wxgui/grc/variable_text_box.xml
index c5416aee7..afff839cf 100644
--- a/gr-wxgui/grc/variable_text_box.xml
+++ b/gr-wxgui/grc/variable_text_box.xml
@@ -8,7 +8,7 @@
WX GUI Text Boxvariable_text_box
- Variables
+ WX GUI Widgetsfrom gnuradio.wxgui import formsself.$(id) = $(id) = $value#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
diff --git a/gr-wxgui/grc/wxgui_constellationsink2.xml b/gr-wxgui/grc/wxgui_constellationsink2.xml
index 881c6eba3..c200790f9 100644
--- a/gr-wxgui/grc/wxgui_constellationsink2.xml
+++ b/gr-wxgui/grc/wxgui_constellationsink2.xml
@@ -7,6 +7,7 @@
WX GUI Constellation Sinkwxgui_constellationsink2
+ WX GUI Widgetsfrom gnuradio.wxgui import constsink_gl#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
constsink_gl.const_sink_c(
diff --git a/gr-wxgui/grc/wxgui_fftsink2.xml b/gr-wxgui/grc/wxgui_fftsink2.xml
index b06220d1e..9b35ab848 100644
--- a/gr-wxgui/grc/wxgui_fftsink2.xml
+++ b/gr-wxgui/grc/wxgui_fftsink2.xml
@@ -7,6 +7,7 @@
WX GUI FFT Sinkwxgui_fftsink2
+ WX GUI Widgetsfrom gnuradio import windowfrom gnuradio.wxgui import fftsink2#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
diff --git a/gr-wxgui/grc/wxgui_histosink2.xml b/gr-wxgui/grc/wxgui_histosink2.xml
index 2f475fe2e..f4f6a2959 100644
--- a/gr-wxgui/grc/wxgui_histosink2.xml
+++ b/gr-wxgui/grc/wxgui_histosink2.xml
@@ -7,6 +7,7 @@
WX GUI Histo Sinkwxgui_histosink2
+ WX GUI Widgetsfrom gnuradio.wxgui import histosink_gl#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
histosink_gl.histo_sink_f(
diff --git a/gr-wxgui/grc/wxgui_numbersink2.xml b/gr-wxgui/grc/wxgui_numbersink2.xml
index b3b4cb254..255926610 100644
--- a/gr-wxgui/grc/wxgui_numbersink2.xml
+++ b/gr-wxgui/grc/wxgui_numbersink2.xml
@@ -7,6 +7,7 @@
WX GUI Number Sinkwxgui_numbersink2
+ WX GUI Widgetsfrom gnuradio.wxgui import numbersink2#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
numbersink2.$(type.fcn)(
diff --git a/gr-wxgui/grc/wxgui_scopesink2.xml b/gr-wxgui/grc/wxgui_scopesink2.xml
index 43922f45e..dbf983e11 100644
--- a/gr-wxgui/grc/wxgui_scopesink2.xml
+++ b/gr-wxgui/grc/wxgui_scopesink2.xml
@@ -7,6 +7,7 @@
WX GUI Scope Sinkwxgui_scopesink2
+ WX GUI Widgetsfrom gnuradio.wxgui import scopesink2from gnuradio import gr#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
diff --git a/gr-wxgui/grc/wxgui_termsink.xml b/gr-wxgui/grc/wxgui_termsink.xml
index ae15b98a6..3e35c7578 100644
--- a/gr-wxgui/grc/wxgui_termsink.xml
+++ b/gr-wxgui/grc/wxgui_termsink.xml
@@ -7,6 +7,7 @@
WX GUI Terminal Sinkwxgui_termsink
+ WX GUI Widgetsfrom gnuradio.wxgui import termsink
diff --git a/gr-wxgui/grc/wxgui_waterfallsink2.xml b/gr-wxgui/grc/wxgui_waterfallsink2.xml
index 9789994be..7c646c3b2 100644
--- a/gr-wxgui/grc/wxgui_waterfallsink2.xml
+++ b/gr-wxgui/grc/wxgui_waterfallsink2.xml
@@ -7,6 +7,7 @@
WX GUI Waterfall Sinkwxgui_waterfallsink2
+ WX GUI Widgetsfrom gnuradio import windowfrom gnuradio.wxgui import waterfallsink2#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am
index 40353a1fa..d9ec0896e 100644
--- a/grc/blocks/Makefile.am
+++ b/grc/blocks/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2008-2010 Free Software Foundation, Inc.
+# Copyright 2008-2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -197,7 +197,6 @@ dist_ourdata_DATA = \
import.xml \
low_pass_filter.xml \
note.xml \
- notebook.xml \
options.xml \
pad_sink.xml \
pad_source.xml \
diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml
index 782d6ca9b..50c463f55 100644
--- a/grc/blocks/block_tree.xml
+++ b/grc/blocks/block_tree.xml
@@ -38,17 +38,6 @@
pad_sinkvirtual_sink
+
+
+ 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
+
Floatrealconv:float
+
Integerintconv:int
+
Stringstringconv:str
+
Anyrawconv:eval
+
+
+ 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
+
Floatrealconv:float
+
Integerintconv:int
+
Stringstringconv:str
+
Anyrawconv:eval
+
+
+ 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
-
Realreal
-
Intint
-
Stringstring
-
Anyraw
-
-
- Num Options
- num_opts
- 3
- enum
-
List0
-
11
-
22
-
33
-
44
-
55
-
-
- 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
-
-
-
- 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
-
+
+
+ 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
+
Floatrealconv:float
+
Integerintconv:int
+
Stringstringconv:str
+
Booleanboolconv:bool
+
Anyrawconv:eval
+
+
+ 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
-
Floatrealconv:float
-
Integerintconv:int
-
Stringstringconv:str
-
Booleanboolconv:bool
-
Anyrawconv:eval
-
-
- 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
-
Floatrealconv:float
-
Integerintconv:int
-
Stringstringconv:str
-
Booleanboolconv:bool
-
Anyrawconv:eval
-
-
- 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()Truebool
-#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_entryQT GUI Widgetsfrom PyQt4 import Qt
+ from gnuradio import eng_notationself.$(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))Labellabel
@@ -37,11 +38,11 @@ $(gui_hint()($win))
intenumpart
-
+
+
+ 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
-
-
-
- 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
-
- Complex
- complex
- fcn:c
-
-
- Float
- float
- fcn:f
-
-
- Int
- int
- fcn:i
-
-
- Short
- short
- fcn:s
-
-
- Byte
- byte
- fcn:b
-
-
-
- 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_xgr_vector_sink_xgr_null_sinkgr_file_sink
@@ -261,7 +260,7 @@
gr_probe_avg_mag_sqrd_xgr_probe_density_bgr_probe_mpsk_snr_c
- probe_function
+ gr_probe_signal_fUSRP
@@ -276,6 +275,7 @@
Variablesvariablevariable_config
+ variable_function_probeparameter
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^2gr_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)Typetype
@@ -43,18 +38,11 @@
1real
-
- 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 Densitygr_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)Alphaalpha
@@ -30,8 +26,7 @@
inbyte
-
- 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 SNRgr_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
-
- SNR
- snr
-
-
- Signal Mean
- signal_mean
-
-
- Noise Variance
- noise_variance
-
-
Alphaalpha1real
-
- Probe Rate
- probe_rate
- 10
- real
-
incomplex
-
- 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_numberstring
+
+ 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)
Countercounter
Sliderslider
Knobknob
+
Thermothermo
OrientationorientQt.Horizontalenum
- #if $widget() == "slider" then 'part' else 'all'#
+ #if $widget() in ("slider", "thermo") then 'part' else 'all'#
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 Widgetsfrom 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