commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11325 - in gnuradio/branches/developers/jblum/grc/grc


From: jblum
Subject: [Commit-gnuradio] r11325 - in gnuradio/branches/developers/jblum/grc/grc: . blocks gui python
Date: Wed, 1 Jul 2009 23:59:48 -0600 (MDT)

Author: jblum
Date: 2009-07-01 23:59:47 -0600 (Wed, 01 Jul 2009)
New Revision: 11325

Modified:
   gnuradio/branches/developers/jblum/grc/grc/blocks/notebook.xml
   gnuradio/branches/developers/jblum/grc/grc/blocks/variable_check_box.xml
   gnuradio/branches/developers/jblum/grc/grc/blocks/variable_chooser.xml
   gnuradio/branches/developers/jblum/grc/grc/blocks/variable_slider.xml
   gnuradio/branches/developers/jblum/grc/grc/blocks/variable_static_text.xml
   gnuradio/branches/developers/jblum/grc/grc/blocks/variable_text_box.xml
   
gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_constellationsink2.xml
   gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_fftsink2.xml
   gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_histosink2.xml
   gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_numbersink2.xml
   gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_scopesink2.xml
   gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_waterfallsink2.xml
   gnuradio/branches/developers/jblum/grc/grc/gui/Param.py
   gnuradio/branches/developers/jblum/grc/grc/python/Param.py
   gnuradio/branches/developers/jblum/grc/grc/todo.txt
Log:
added notebook param to other wxgui blocks

Modified: gnuradio/branches/developers/jblum/grc/grc/blocks/notebook.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/notebook.xml      
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/notebook.xml      
2009-07-02 05:59:47 UTC (rev 11325)
@@ -8,15 +8,15 @@
        <name>Notebook</name>
        <key>notebook</key>
        <import>from grc_gnuradio import wxgui as grc_wxgui</import>
-       <make>self.$(id) = wx.Notebook(self.GetWin())
+       <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() 
or 'self'
+self.$(id) = wx.Notebook($(parent).GetWin())
 #for $label in $labels()
 self.$(id).AddPage(grc_wxgui.Panel(self.$(id)), "$label")
 #end for
-#set $grid_pos = $grid_pos()
-#if not grid_pos
-self.Add(self.$(id))
+#if not $grid_pos()
+$(parent).Add(self.$(id))
 #else
-self.GridAdd(self.$(id), $grid_pos[0], $grid_pos[1], $grid_pos[2], 
$grid_pos[3])
+$(parent).GridAdd(self.$(id), $(', '.join(map(str, $grid_pos()))))
 #end if</make>
        <param>
                <name>Labels</name>
@@ -30,10 +30,18 @@
                <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) &gt; 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>

Modified: 
gnuradio/branches/developers/jblum/grc/grc/blocks/variable_check_box.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/variable_check_box.xml    
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/variable_check_box.xml    
2009-07-02 05:59:47 UTC (rev 11325)
@@ -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 @@
                <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 @@
 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>

Modified: gnuradio/branches/developers/jblum/grc/grc/blocks/variable_chooser.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/variable_chooser.xml      
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/variable_chooser.xml      
2009-07-02 05:59:47 UTC (rev 11325)
@@ -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 @@
                <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 @@
 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>

Modified: gnuradio/branches/developers/jblum/grc/grc/blocks/variable_slider.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/variable_slider.xml       
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/variable_slider.xml       
2009-07-02 05:59:47 UTC (rev 11325)
@@ -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 @@
        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 @@
        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 @@
                <value></value>
                <type>grid_pos</type>
        </param>
+       <param>
+               <name>Notebook</name>
+               <key>notebook</key>
+               <value></value>
+               <type>notebook</type>
+       </param>
        <check>$min &lt;= $value &lt;= $max</check>
        <check>$min &lt; $max</check>
        <check>0 &lt; $num_steps &lt;= 1000</check>
@@ -125,5 +132,7 @@
 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>

Modified: 
gnuradio/branches/developers/jblum/grc/grc/blocks/variable_static_text.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/variable_static_text.xml  
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/variable_static_text.xml  
2009-07-02 05:59:47 UTC (rev 11325)
@@ -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 @@
                <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 @@
 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>

Modified: 
gnuradio/branches/developers/jblum/grc/grc/blocks/variable_text_box.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/variable_text_box.xml     
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/variable_text_box.xml     
2009-07-02 05:59:47 UTC (rev 11325)
@@ -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 @@
                <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 @@
 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>

Modified: 
gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_constellationsink2.xml
===================================================================
--- 
gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_constellationsink2.xml  
    2009-07-02 02:31:00 UTC (rev 11324)
+++ 
gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_constellationsink2.xml  
    2009-07-02 05:59:47 UTC (rev 11325)
@@ -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 @@
                <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>

Modified: gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_fftsink2.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_fftsink2.xml        
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_fftsink2.xml        
2009-07-02 05:59:47 UTC (rev 11325)
@@ -8,7 +8,7 @@
        <name>FFT Sink</name>
        <key>wxgui_fftsink2</key>
        <import>from gnuradio.wxgui import fftsink2</import>
-       <make>#set $parent = $notebook() and 
'self.%s.GetPage(%s)'%($notebook()) or 'self'
+       <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() 
or 'self'
 fftsink2.$(type.fcn)(
        $(parent).GetWin(),
        baseband_freq=$baseband_freq,
@@ -23,11 +23,10 @@
        title=$title,
        peak_hold=$peak_hold,
 )
-#set $grid_pos = $grid_pos()
-#if not grid_pos
+#if not $grid_pos()
 $(parent).Add(self.$(id).win)
 #else
-$(parent).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>

Modified: gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_histosink2.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_histosink2.xml      
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_histosink2.xml      
2009-07-02 05:59:47 UTC (rev 11325)
@@ -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 @@
                <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>

Modified: 
gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_numbersink2.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_numbersink2.xml     
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_numbersink2.xml     
2009-07-02 05:59:47 UTC (rev 11325)
@@ -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 @@
                <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 @@
 
 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>

Modified: gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_scopesink2.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_scopesink2.xml      
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_scopesink2.xml      
2009-07-02 05:59:47 UTC (rev 11325)
@@ -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 @@
                <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 @@
 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>

Modified: 
gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_waterfallsink2.xml
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_waterfallsink2.xml  
2009-07-02 02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/wxgui_waterfallsink2.xml  
2009-07-02 05:59:47 UTC (rev 11325)
@@ -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 @@
                <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 @@
 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>

Modified: gnuradio/branches/developers/jblum/grc/grc/gui/Param.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/gui/Param.py     2009-07-02 
02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/gui/Param.py     2009-07-02 
05:59:47 UTC (rev 11325)
@@ -25,8 +25,7 @@
 
 PARAM_MARKUP_TMPL="""\
 #set $foreground = $param.is_valid() and 'black' or 'red'
-#set $value = not $param.is_valid() and 'error' or repr($param)
-<span foreground="$foreground" font_desc="Sans 
7.5"><b>$encode($param.get_name()): </b>$encode($value)</span>"""
+<span foreground="$foreground" font_desc="Sans 
7.5"><b>$encode($param.get_name()): </b>$encode(repr($param))</span>"""
 
 PARAM_LABEL_MARKUP_TMPL="""\
 #set $foreground = $param.is_valid() and 'black' or 'red'

Modified: gnuradio/branches/developers/jblum/grc/grc/python/Param.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/python/Param.py  2009-07-02 
02:31:00 UTC (rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/python/Param.py  2009-07-02 
05:59:47 UTC (rev 11325)
@@ -104,6 +104,7 @@
                Get the repr (nice string format) for this param.
                @return the string representation
                """
+               if not self.is_valid(): return self.get_value()
                if self.get_value() in self.get_option_keys(): return 
self.get_option(self.get_value()).get_name()
                ##################################################
                # display logic for numbers

Modified: gnuradio/branches/developers/jblum/grc/grc/todo.txt
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/todo.txt 2009-07-02 02:31:00 UTC 
(rev 11324)
+++ gnuradio/branches/developers/jblum/grc/grc/todo.txt 2009-07-02 05:59:47 UTC 
(rev 11325)
@@ -23,6 +23,7 @@
   * gr_ofdm_mapper_bcv
   * gr_ofdm_sampler
 * size params for the graphical sinks
+* callbacks for set average on fft, waterfall, number sinks
 
 ##################################################
 # Features
@@ -41,8 +42,6 @@
 * configuration option for adding block paths
 * orientations for ports (top, right, bottom, left)
   * source defaults to right, sink defaults to left
-* grid params take a notebook argument
-  * add a wx notebook block
 * separation of variables and gui controls
 * speedup w/ background layer and animation layer
 * multiple doxygen directories (doc_dir becomes doc_path)
@@ -69,6 +68,9 @@
 * params dialog needs to dynamically update for all params
   * will not update for non-enum params
   * needs to account for added or removed params
+  * example with grid params need update after notebook change
+* notebooks need to be organized in dependency hierarchy
+  * use expr utils
 
 ##################################################
 # Future





reply via email to

[Prev in Thread] Current Thread [Next in Thread]