commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: jblum
Subject: [Commit-gnuradio] r10756 - in gnuradio/branches/developers/jblum/grc/grc: data/platforms/python data/platforms/python/blocks src/grc_gnuradio/wxgui
Date: Fri, 3 Apr 2009 01:16:00 -0600 (MDT)

Author: jblum
Date: 2009-04-03 01:16:00 -0600 (Fri, 03 Apr 2009)
New Revision: 10756

Removed:
   
gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui/callback_controls.py
Modified:
   
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_chooser.xml
   
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_slider.xml
   
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_text_box.xml
   
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/flow_graph.tmpl
   gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui/
   gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui/Makefile.am
   
gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui/top_block_gui.py
Log:
Switched GRC branch to use experimental forms w/ pubsub.
Forms are svn:external into grc src.
GRC top_block_gui is pubsubed for forms.



Modified: 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_chooser.xml
===================================================================
--- 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_chooser.xml
        2009-04-03 07:13:56 UTC (rev 10755)
+++ 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_chooser.xml
        2009-04-03 07:16:00 UTC (rev 10756)
@@ -1,22 +1,27 @@
 <?xml version="1.0"?>
 <!--
 ###################################################
-##Variable Chooser: a grc variable with multiple choices
+##Variable Chooser:
+##     a gui form with enumerated choices
+##     radio buttons, drop down, or button
 ###################################################
  -->
 <block>
        <name>Variable Chooser</name>
        <key>variable_chooser</key>
+       <import>from grc_gnuradio.wxgui import forms</import>
        <make>$value
-self._$(id)_control = grc_wxgui.$(type)_control(
-       window=self.GetWin(),
-       callback=self.set_$(id),
+self['$id'] = $id
+self.subscribe('$id', self.set_$(id))
+self._$(id)_control = forms.$(type)(
+       parent=self.GetWin(),
+       ps=self,
+       key='$id',
        #if $label.eval
        label=$label,
        #else
        label='$id',
        #end if
-       value=$value,
        choices=$choices,
        labels=$labels,
 #if $type.eval == 'radio_buttons'
@@ -74,16 +79,16 @@
        <param>
                <name>Style</name>
                <key>style</key>
-               <value>wx.HORIZONTAL</value>
+               <value>wx.RA_HORIZONTAL</value>
                <type>enum</type>
                <hide>#if $type.eval == 'radio_buttons' then 'part' else 
'all'#</hide>
                <option>
                        <name>Horizontal</name>
-                       <key>wx.HORIZONTAL</key>
+                       <key>wx.RA_HORIZONTAL</key>
                </option>
                <option>
                        <name>Vertical</name>
-                       <key>wx.VERTICAL</key>
+                       <key>wx.RA_VERTICAL</key>
                </option>
        </param>
        <param>

Modified: 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_slider.xml
===================================================================
--- 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_slider.xml
 2009-04-03 07:13:56 UTC (rev 10755)
+++ 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_slider.xml
 2009-04-03 07:16:00 UTC (rev 10756)
@@ -1,33 +1,47 @@
 <?xml version="1.0"?>
 <!--
 ###################################################
-##Variable Slider: a grc variable with key, value, min, max, step
+##Variable Slider:
+##     a combined slider and text box form
 ###################################################
  -->
 <block>
        <name>Variable Slider</name>
        <key>variable_slider</key>
+       <import>from grc_gnuradio.wxgui import forms</import>
        <make>$value
-self._$(id)_control = grc_wxgui.slider_control(
-       window=self.GetWin(),
-       callback=self.set_$(id),
+self['$id'] = $id
+self.subscribe('$id', self.set_$(id))
+self._$(id)_sizer = wx.BoxSizer(wx.VERTICAL)
+forms.text_box(
+       parent=self.GetWin(),
+       sizer=self._$(id)_sizer,
+       ps=self,
+       key='$id',
        #if $label.eval
        label=$label,
        #else
        label='$id',
        #end if
-       value=$id,
-       min=$min,
-       max=$max,
+       converter=forms.$(converver)(),
+)
+forms.slider(
+       parent=self.GetWin(),
+       sizer=self._$(id)_sizer,
+       ps=self,
+       key='$id',
+       minimum=$min,
+       maximum=$max,
        num_steps=$num_steps,
-       slider_length=$slider_length,
+       length=$slider_length,
        style=$style,
+       cast=$(converver.slider_cast),
 )
 #set $grid_pos = $grid_pos.eval
 #if not grid_pos
-self.Add(self._$(id)_control)
+self.Add(self._$(id)_sizer)
 #else
-self.GridAdd(self._$(id)_control, $grid_pos[0], $grid_pos[1], $grid_pos[2], 
$grid_pos[3])
+self.GridAdd(self._$(id)_sizer, $grid_pos[0], $grid_pos[1], $grid_pos[2], 
$grid_pos[3])
 #end if</make>
        <param>
                <name>Label</name>
@@ -70,19 +84,35 @@
        <param>
                <name>Style</name>
                <key>style</key>
-               <value>wx.HORIZONTAL</value>
+               <value>wx.SL_HORIZONTAL</value>
                <type>enum</type>
                <hide>part</hide>
                <option>
                        <name>Horizontal</name>
-                       <key>wx.HORIZONTAL</key>
+                       <key>wx.SL_HORIZONTAL</key>
                </option>
                <option>
                        <name>Vertical</name>
-                       <key>wx.VERTICAL</key>
+                       <key>wx.SL_VERTICAL</key>
                </option>
        </param>
        <param>
+               <name>Converter</name>
+               <key>converver</key>
+               <value>float_converter</value>
+               <type>enum</type>
+               <option>
+                       <name>Float</name>
+                       <key>float_converter</key>
+                       <opt>slider_cast:float</opt>
+               </option>
+               <option>
+                       <name>Integer</name>
+                       <key>int_converter</key>
+                       <opt>slider_cast:int</opt>
+               </option>
+       </param>
+       <param>
                <name>Grid Position</name>
                <key>grid_pos</key>
                <value></value>

Modified: 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_text_box.xml
===================================================================
--- 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_text_box.xml
       2009-04-03 07:13:56 UTC (rev 10755)
+++ 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/blocks/variable_text_box.xml
       2009-04-03 07:16:00 UTC (rev 10756)
@@ -1,22 +1,27 @@
 <?xml version="1.0"?>
 <!--
 ###################################################
-##Variable Text Box: a grc variable with key, value
+##Variable Text Box:
+##     a gui text box form
 ###################################################
  -->
 <block>
        <name>Variable Text Box</name>
        <key>variable_text_box</key>
+       <import>from grc_gnuradio.wxgui import forms</import>
        <make>$value
-self._$(id)_control = grc_wxgui.text_box_control(
-       window=self.GetWin(),
-       callback=self.set_$(id),
+self['$id'] = $id
+self.subscribe('$id', self.set_$(id))
+self._$(id)_control = forms.text_box(
+       parent=self.GetWin(),
+       ps=self,
+       key='$id',
        #if $label.eval
        label=$label,
        #else
        label='$id',
        #end if
-       value=$id,
+       converter=forms.$(converver)(),
 )
 #set $grid_pos = $grid_pos.eval
 #if not grid_pos
@@ -37,6 +42,28 @@
                <type>raw</type>
        </param>
        <param>
+               <name>Converter</name>
+               <key>converver</key>
+               <value>float_converter</value>
+               <type>enum</type>
+               <option>
+                       <name>Float</name>
+                       <key>float_converter</key>
+               </option>
+               <option>
+                       <name>Integer</name>
+                       <key>int_converter</key>
+               </option>
+               <option>
+                       <name>String</name>
+                       <key>str_converter</key>
+               </option>
+               <option>
+                       <name>Evaluate</name>
+                       <key>eval_converter</key>
+               </option>
+       </param>
+       <param>
                <name>Grid Position</name>
                <key>grid_pos</key>
                <value></value>

Modified: 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/flow_graph.tmpl
===================================================================
--- 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/flow_graph.tmpl
    2009-04-03 07:13:56 UTC (rev 10755)
+++ 
gnuradio/branches/developers/jblum/grc/grc/data/platforms/python/flow_graph.tmpl
    2009-04-03 07:16:00 UTC (rev 10756)
@@ -170,9 +170,6 @@
        #for $callback in $var_id2cbs[$id]
                self.$callback
        #end for
-       #if $var.get_key() in ('variable_chooser', 'variable_slider', 
'variable_text_box')
-               self._$(id)_control.set_value(self.$id)
-       #end if
 
 #end for
 ########################################################


Property changes on: 
gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui
___________________________________________________________________
Added: svn:externals
   + forms 
http://gnuradio.org/svn/gnuradio/branches/features/experimental-gui/forms


Modified: 
gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui/Makefile.am   
    2009-04-03 07:13:56 UTC (rev 10755)
+++ 
gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui/Makefile.am   
    2009-04-03 07:16:00 UTC (rev 10756)
@@ -22,8 +22,12 @@
 include $(top_srcdir)/grc/Makefile.inc
 
 ourpythondir = $(grc_gnuradio_prefix)/wxgui
-
 ourpython_PYTHON = \
        __init__.py \
-       callback_controls.py \
        top_block_gui.py
+
+oursubpythondir = $(grc_gnuradio_prefix)/wxgui/forms
+oursubpython_PYTHON = \
+       forms/__init__.py \
+       forms/converters.py \
+       forms/forms.py

Modified: 
gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui/top_block_gui.py
===================================================================
--- 
gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui/top_block_gui.py
  2009-04-03 07:13:56 UTC (rev 10755)
+++ 
gnuradio/branches/developers/jblum/grc/grc/src/grc_gnuradio/wxgui/top_block_gui.py
  2009-04-03 07:16:00 UTC (rev 10756)
@@ -21,10 +21,11 @@
 import wx
 import sys, os
 from gnuradio import gr
+from gnuradio.gr.pubsub import pubsub
 
 default_gui_size = (200, 100)
 
-class top_block_gui(gr.top_block):
+class top_block_gui(gr.top_block, pubsub):
        """gr top block with wx gui app and grid sizer."""
 
        def __init__(self, title='', size=default_gui_size, icon=None):
@@ -37,6 +38,7 @@
                """
                #initialize
                gr.top_block.__init__(self)
+               pubsub.__init__(self)
                self._size = size
                #set the icon
                if icon and os.path.isfile(icon): self._icon = icon





reply via email to

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