diff options
Diffstat (limited to 'grc/blocks')
-rw-r--r-- | grc/blocks/Makefile.am | 1 | ||||
-rw-r--r-- | grc/blocks/block_tree.xml | 2 | ||||
-rw-r--r-- | grc/blocks/notebook.xml | 69 | ||||
-rw-r--r-- | grc/blocks/options.xml | 15 | ||||
-rw-r--r-- | grc/blocks/variable_check_box.xml | 21 | ||||
-rw-r--r-- | grc/blocks/variable_chooser.xml | 21 | ||||
-rw-r--r-- | grc/blocks/variable_slider.xml | 27 | ||||
-rw-r--r-- | grc/blocks/variable_static_text.xml | 21 | ||||
-rw-r--r-- | grc/blocks/variable_text_box.xml | 21 | ||||
-rw-r--r-- | grc/blocks/wxgui_constellationsink2.xml | 20 | ||||
-rw-r--r-- | grc/blocks/wxgui_fftsink2.xml | 20 | ||||
-rw-r--r-- | grc/blocks/wxgui_histosink2.xml | 20 | ||||
-rw-r--r-- | grc/blocks/wxgui_numbersink2.xml | 20 | ||||
-rw-r--r-- | grc/blocks/wxgui_scopesink2.xml | 20 | ||||
-rw-r--r-- | grc/blocks/wxgui_waterfallsink2.xml | 20 |
15 files changed, 242 insertions, 76 deletions
diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index d6df9fca4..025c261f4 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -185,6 +185,7 @@ 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 4f9b1cd2e..9eda2fdcf 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -293,5 +293,7 @@ <block>xmlrpc_server</block> <block>xmlrpc_client</block> + + <block>notebook</block> </cat> </cat> diff --git a/grc/blocks/notebook.xml b/grc/blocks/notebook.xml new file mode 100644 index 000000000..d41db9e2d --- /dev/null +++ b/grc/blocks/notebook.xml @@ -0,0 +1,69 @@ +<?xml version="1.0"?> +<!-- +################################################### +##WX GUI Notebook +################################################### + --> +<block> + <name>Notebook</name> + <key>notebook</key> + <import>from grc_gnuradio import wxgui as grc_wxgui</import> + <make>#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</make> + <param> + <name>Tab Orientation</name> + <key>style</key> + <value>wx.NB_TOP</value> + <type>enum</type> + <option> + <name>Top</name> + <key>wx.NB_TOP</key> + </option> + <option> + <name>Right</name> + <key>wx.NB_RIGHT</key> + </option> + <option> + <name>Bottom</name> + <key>wx.NB_BOTTOM</key> + </option> + <option> + <name>Left</name> + <key>wx.NB_LEFT</key> + </option> + </param> + <param> + <name>Labels</name> + <key>labels</key> + <value>['tab1', 'tab2', 'tab3']</value> + <type>raw</type> + </param> + <param> + <name>Grid Position</name> + <key>grid_pos</key> + <value></value> + <type>grid_pos</type> + </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> + <check>isinstance($labels, (list, tuple))</check> + <check>all(map(lambda x: isinstance(x, str), $labels))</check> + <check>len($labels) > 0</check> + <doc> +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. + </doc> +</block> diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index 06ede76f0..18d6e2f0c 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -20,7 +20,8 @@ from gnuradio.eng_option import eng_option #end if </import> <make></make> - <callback>self.start($autostart)</callback> + <callback>if $run: self.start() +else: self.stop(); self.wait()</callback> <param> <name>Title</name> <key>title</key> @@ -76,12 +77,12 @@ from gnuradio.eng_option import eng_option <hide>#if $generate_options() == 'hb' then 'none' else 'all'#</hide> </param> <param> - <name>Autostart</name> - <key>autostart</key> + <name>Run</name> + <key>run</key> <value>True</value> <type>bool</type> <hide>#if $generate_options() == 'wx_gui' - #if str($autostart) == 'True' + #if str($run) == 'True' part#slurp #else none#slurp @@ -90,11 +91,11 @@ none#slurp all#slurp #end if</hide> <option> - <name>Yes</name> + <name>Autostart</name> <key>True</key> </option> <option> - <name>No</name> + <name>Off</name> <key>False</key> </option> </param> @@ -135,7 +136,7 @@ The generate options controls the type of code generated. \ Non-graphical flow graphs should avoid using graphical sinks or graphical variable controls. In a graphical application, \ -autostart can be controlled by a variable to start and stop the flowgraph at runtime. +run can be controlled by a variable to start and stop the flowgraph at runtime. The id of this block determines the name of the generated file and the name of the class. \ For example, an id of my_block will generate the file my_block.py and class my_block(gr.... diff --git a/grc/blocks/variable_check_box.xml b/grc/blocks/variable_check_box.xml index 7054ca1eb..a703703c7 100644 --- a/grc/blocks/variable_check_box.xml +++ b/grc/blocks/variable_check_box.xml @@ -10,8 +10,10 @@ <key>variable_check_box</key> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> - <make>self._$(id)_check_box = forms.check_box( - parent=self.GetWin(), + <make>#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() @@ -22,11 +24,10 @@ true=$true, false=$false, ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self._$(id)_check_box) +#if not $grid_pos() +$(parent).Add($win) #else -self.GridAdd(self._$(id)_check_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) #end if</make> <callback>self.set_$(id)($value)</callback> <callback>self._$(id)_check_box.set_value($id)</callback> @@ -61,6 +62,12 @@ self.GridAdd(self._$(id)_check_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $g <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <check>$value in ($true, $false)</check> <doc> This block creates a variable with a check box form. \ @@ -71,5 +78,7 @@ 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. </doc> </block> diff --git a/grc/blocks/variable_chooser.xml b/grc/blocks/variable_chooser.xml index 2bf199872..ee41f26db 100644 --- a/grc/blocks/variable_chooser.xml +++ b/grc/blocks/variable_chooser.xml @@ -11,8 +11,10 @@ <key>variable_chooser</key> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> - <make>self._$(id)_chooser = forms.$(type)( - parent=self.GetWin(), + <make>#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() @@ -26,11 +28,10 @@ style=$style, #end if ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self._$(id)_chooser) +#if not $grid_pos() +$(parent).Add($win) #else -self.GridAdd(self._$(id)_chooser, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) #end if</make> <callback>self.set_$(id)($value)</callback> <callback>self._$(id)_chooser.set_value($id)</callback> @@ -98,6 +99,12 @@ self.GridAdd(self._$(id)_chooser, $grid_pos[0], $grid_pos[1], $grid_pos[2], $gri <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <check>$value in $choices</check> <check>not $labels or len($labels) == len($choices)</check> <doc> @@ -109,5 +116,7 @@ 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. </doc> </block> diff --git a/grc/blocks/variable_slider.xml b/grc/blocks/variable_slider.xml index 875ae74af..c13d20856 100644 --- a/grc/blocks/variable_slider.xml +++ b/grc/blocks/variable_slider.xml @@ -10,10 +10,12 @@ <key>variable_slider</key> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> - <make>_$(id)_sizer = wx.BoxSizer(wx.VERTICAL) + <make>#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=self.GetWin(), - sizer=_$(id)_sizer, + parent=$(parent).GetWin(), + sizer=$win, value=self.$id, callback=self.set_$(id), #if $label() @@ -25,8 +27,8 @@ self._$(id)_text_box = forms.text_box( proportion=0, ) self._$(id)_slider = forms.slider( - parent=self.GetWin(), - sizer=_$(id)_sizer, + parent=$(parent).GetWin(), + sizer=$win, value=self.$id, callback=self.set_$(id), minimum=$min, @@ -36,11 +38,10 @@ self._$(id)_slider = forms.slider( cast=$(converver.slider_cast), proportion=1, ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(_$(id)_sizer) +#if not $grid_pos() +$(parent).Add($win) #else -self.GridAdd(_$(id)_sizer, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) #end if</make> <callback>self.set_$(id)($value)</callback> <callback>self._$(id)_slider.set_value($id)</callback> @@ -114,6 +115,12 @@ self.GridAdd(_$(id)_sizer, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3 <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <check>$min <= $value <= $max</check> <check>$min < $max</check> <check>0 < $num_steps <= 1000</check> @@ -125,5 +132,7 @@ 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. </doc> </block> diff --git a/grc/blocks/variable_static_text.xml b/grc/blocks/variable_static_text.xml index 4be80a9bb..c866b998d 100644 --- a/grc/blocks/variable_static_text.xml +++ b/grc/blocks/variable_static_text.xml @@ -10,8 +10,10 @@ <key>variable_static_text</key> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> - <make>self._$(id)_static_text = forms.static_text( - parent=self.GetWin(), + <make>#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() @@ -25,11 +27,10 @@ converter=forms.$(converver)(), #end if ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self._$(id)_static_text) +#if not $grid_pos() +$(parent).Add($win) #else -self.GridAdd(self._$(id)_static_text, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) #end if</make> <callback>self.set_$(id)($value)</callback> <callback>self._$(id)_static_text.set_value($id)</callback> @@ -77,6 +78,12 @@ self.GridAdd(self._$(id)_static_text, $grid_pos[0], $grid_pos[1], $grid_pos[2], <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <doc> This block creates a variable with a static text form. \ Leave the label blank to use the variable id as the label. @@ -84,5 +91,7 @@ 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. </doc> </block> diff --git a/grc/blocks/variable_text_box.xml b/grc/blocks/variable_text_box.xml index 65d491ba0..1b4b4355e 100644 --- a/grc/blocks/variable_text_box.xml +++ b/grc/blocks/variable_text_box.xml @@ -10,8 +10,10 @@ <key>variable_text_box</key> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> - <make>self._$(id)_text_box = forms.text_box( - parent=self.GetWin(), + <make>#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() @@ -25,11 +27,10 @@ converter=forms.$(converver)(), #end if ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self._$(id)_text_box) +#if not $grid_pos() +$(parent).Add($win) #else -self.GridAdd(self._$(id)_text_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) #end if</make> <callback>self.set_$(id)($value)</callback> <callback>self._$(id)_text_box.set_value($id)</callback> @@ -81,6 +82,12 @@ self.GridAdd(self._$(id)_text_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $gr <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <doc> This block creates a variable with a text box. \ Leave the label blank to use the variable id as the label. @@ -88,5 +95,7 @@ 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. </doc> </block> diff --git a/grc/blocks/wxgui_constellationsink2.xml b/grc/blocks/wxgui_constellationsink2.xml index 471c9f4a8..5969d8405 100644 --- a/grc/blocks/wxgui_constellationsink2.xml +++ b/grc/blocks/wxgui_constellationsink2.xml @@ -8,8 +8,9 @@ <name>Constellation Sink</name> <key>wxgui_constellationsink2</key> <import>from gnuradio.wxgui import constsink_gl</import> - <make>constsink_gl.const_sink_c( - self.GetWin(), + <make>#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, @@ -23,11 +24,10 @@ symbol_rate=$symbol_rate, omega_limit=$omega_limit, ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self.$(id).win) +#if not $grid_pos() +$(parent).Add(self.$(id).win) #else -self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) #end if</make> <callback>set_sample_rate($samp_rate)</callback> <param> @@ -108,11 +108,19 @@ self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <sink> <name>in</name> <type>complex</type> </sink> <doc> 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. </doc> </block> diff --git a/grc/blocks/wxgui_fftsink2.xml b/grc/blocks/wxgui_fftsink2.xml index d7763cb25..faeca37e3 100644 --- a/grc/blocks/wxgui_fftsink2.xml +++ b/grc/blocks/wxgui_fftsink2.xml @@ -8,8 +8,9 @@ <name>FFT Sink</name> <key>wxgui_fftsink2</key> <import>from gnuradio.wxgui import fftsink2</import> - <make>fftsink2.$(type.fcn)( - self.GetWin(), + <make>#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, @@ -22,11 +23,10 @@ title=$title, peak_hold=$peak_hold, ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self.$(id).win) +#if not $grid_pos() +$(parent).Add(self.$(id).win) #else -self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) #end if</make> <callback>set_baseband_freq($baseband_freq)</callback> <callback>set_sample_rate($samp_rate)</callback> @@ -157,6 +157,12 @@ self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <sink> <name>in</name> <type>$type</type> @@ -165,5 +171,7 @@ self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos Set Average Alpha to 0 for automatic setting. 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. </doc> </block> diff --git a/grc/blocks/wxgui_histosink2.xml b/grc/blocks/wxgui_histosink2.xml index 4de57b1c4..454a4932c 100644 --- a/grc/blocks/wxgui_histosink2.xml +++ b/grc/blocks/wxgui_histosink2.xml @@ -8,17 +8,17 @@ <name>Histo Sink</name> <key>wxgui_histosink2</key> <import>from gnuradio.wxgui import histosink_gl</import> - <make>histosink_gl.histo_sink_f( - self.GetWin(), + <make>#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, ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self.$(id).win) +#if not $grid_pos() +$(parent).Add(self.$(id).win) #else -self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) #end if</make> <callback>set_num_bins($num_bins)</callback> <callback>set_frame_size($frame_size)</callback> @@ -46,11 +46,19 @@ self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <sink> <name>in</name> <type>float</type> </sink> <doc> 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. </doc> </block> diff --git a/grc/blocks/wxgui_numbersink2.xml b/grc/blocks/wxgui_numbersink2.xml index 7cc90b697..cc66cdcb0 100644 --- a/grc/blocks/wxgui_numbersink2.xml +++ b/grc/blocks/wxgui_numbersink2.xml @@ -8,8 +8,9 @@ <name>Number Sink</name> <key>wxgui_numbersink2</key> <import>from gnuradio.wxgui import numbersink2</import> - <make>numbersink2.$(type.fcn)( - self.GetWin(), + <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' +numbersink2.$(type.fcn)( + $(parent).GetWin(), unit=$units, minval=$min_value, maxval=$max_value, @@ -24,11 +25,10 @@ peak_hold=$peak_hold, show_gauge=$show_gauge, ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self.$(id).win) +#if not $grid_pos() +$(parent).Add(self.$(id).win) #else -self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) #end if</make> <param> <name>Type</name> @@ -157,6 +157,12 @@ self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <sink> <name>in</name> <type>$type</type> @@ -166,6 +172,8 @@ Set Average Alpha to 0 for automatic setting. 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. </doc> </block> diff --git a/grc/blocks/wxgui_scopesink2.xml b/grc/blocks/wxgui_scopesink2.xml index 78c39f80d..503d52972 100644 --- a/grc/blocks/wxgui_scopesink2.xml +++ b/grc/blocks/wxgui_scopesink2.xml @@ -9,8 +9,9 @@ <key>wxgui_scopesink2</key> <import>from gnuradio.wxgui import scopesink2</import> <import>from gnuradio import gr</import> - <make>scopesink2.$(type.fcn)( - self.GetWin(), + <make>#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, @@ -19,11 +20,10 @@ xy_mode=$xy_mode, num_inputs=$num_inputs, ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self.$(id).win) +#if not $grid_pos() +$(parent).Add(self.$(id).win) #else -self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) #end if</make> <callback>set_sample_rate($samp_rate)</callback> <param> @@ -108,6 +108,12 @@ self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <check>not $xy_mode or '$type' == 'complex' or $num_inputs != 1</check> <sink> <name>in</name> @@ -122,5 +128,7 @@ Set the T Scale to 0 for automatic setting. XY Mode allows the scope to initialize as an XY plotter. 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. </doc> </block> diff --git a/grc/blocks/wxgui_waterfallsink2.xml b/grc/blocks/wxgui_waterfallsink2.xml index 6d76ee867..c7d53f9f2 100644 --- a/grc/blocks/wxgui_waterfallsink2.xml +++ b/grc/blocks/wxgui_waterfallsink2.xml @@ -8,8 +8,9 @@ <name>Waterfall Sink</name> <key>wxgui_waterfallsink2</key> <import>from gnuradio.wxgui import waterfallsink2</import> - <make>waterfallsink2.$(type.fcn)( - self.GetWin(), + <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' +waterfallsink2.$(type.fcn)( + $(parent).GetWin(), baseband_freq=$baseband_freq, y_per_div=$y_per_div, ref_level=$ref_level, @@ -20,11 +21,10 @@ avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#, title=$title, ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self.$(id).win) +#if not $grid_pos() +$(parent).Add(self.$(id).win) #else -self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) #end if</make> <callback>set_baseband_freq($baseband_freq)</callback> <callback>set_sample_rate($samp_rate)</callback> @@ -114,6 +114,12 @@ self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos <value></value> <type>grid_pos</type> </param> + <param> + <name>Notebook</name> + <key>notebook</key> + <value></value> + <type>notebook</type> + </param> <sink> <name>in</name> <type>$type</type> @@ -122,5 +128,7 @@ self.GridAdd(self.$(id).win, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos Set Average Alpha to 0 for automatic setting. 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. </doc> </block> |