commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r9006 - in grc/trunk: examples/audio examples/simple e


From: jblum
Subject: [Commit-gnuradio] r9006 - in grc/trunk: examples/audio examples/simple examples/usrp examples/xmlrpc src/grc/elements src/grc/gui/elements src/grc_gnuradio src/grc_gnuradio/blocks src/grc_gnuradio/blocks/variables src/grc_gnuradio/data
Date: Thu, 24 Jul 2008 15:39:12 -0600 (MDT)

Author: jblum
Date: 2008-07-24 15:39:11 -0600 (Thu, 24 Jul 2008)
New Revision: 9006

Added:
   grc/trunk/src/grc_gnuradio/blocks/variables/parameter.xml
Modified:
   grc/trunk/examples/audio/dial_tone.grc
   grc/trunk/examples/simple/ber_simulation.grc
   grc/trunk/examples/usrp/usrp_two_tone_loopback.grc
   grc/trunk/examples/usrp/usrp_wbfm_receive.grc
   grc/trunk/examples/xmlrpc/xmlrpc_client.grc
   grc/trunk/examples/xmlrpc/xmlrpc_server.grc
   grc/trunk/src/grc/elements/Element.py
   grc/trunk/src/grc/gui/elements/Block.py
   grc/trunk/src/grc_gnuradio/FlowGraph.py
   grc/trunk/src/grc_gnuradio/Generator.py
   grc/trunk/src/grc_gnuradio/blocks/options.xml
   grc/trunk/src/grc_gnuradio/data/block_tree.xml
   grc/trunk/src/grc_gnuradio/data/default_flow_graph.grc.xml
   grc/trunk/src/grc_gnuradio/data/flow_graph.tmpl
Log:
added parameter block, category to options block

Modified: grc/trunk/examples/audio/dial_tone.grc
===================================================================
--- grc/trunk/examples/audio/dial_tone.grc      2008-07-24 20:10:52 UTC (rev 
9005)
+++ grc/trunk/examples/audio/dial_tone.grc      2008-07-24 21:39:11 UTC (rev 
9006)
@@ -1,23 +1,43 @@
 <?xml version='1.0' encoding='ASCII'?>
 <flow_graph>
-  <timestamp>Thu Jul 10 23:01:15 2008</timestamp>
+  <timestamp>Thu Jul 24 14:27:48 2008</timestamp>
   <block>
-    <key>variable</key>
+    <key>options</key>
     <param>
       <key>id</key>
-      <value>samp_rate</value>
+      <value>dial_tone</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>value</key>
-      <value>32000</value>
+      <key>title</key>
+      <value>Dial Tone</value>
     </param>
     <param>
+      <key>author</key>
+      <value>Example</value>
+    </param>
+    <param>
+      <key>description</key>
+      <value>example flow graph</value>
+    </param>
+    <param>
+      <key>window_size</key>
+      <value>1280, 1024</value>
+    </param>
+    <param>
+      <key>generate_options</key>
+      <value>wx_gui</value>
+    </param>
+    <param>
+      <key>category</key>
+      <value>Custom</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(10, 150)</value>
+      <value>(10, 10)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -306,38 +326,22 @@
     </param>
   </block>
   <block>
-    <key>options</key>
+    <key>variable</key>
     <param>
       <key>id</key>
-      <value>dial_tone</value>
+      <value>samp_rate</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>title</key>
-      <value>Dial Tone</value>
+      <key>value</key>
+      <value>32000</value>
     </param>
     <param>
-      <key>author</key>
-      <value>Example</value>
-    </param>
-    <param>
-      <key>description</key>
-      <value>example flow graph</value>
-    </param>
-    <param>
-      <key>window_size</key>
-      <value>1280, 1024</value>
-    </param>
-    <param>
-      <key>generate_options</key>
-      <value>wx_gui</value>
-    </param>
-    <param>
       <key>gui_coordinate</key>
-      <value>(10, 10)</value>
+      <value>(11, 171)</value>
     </param>
     <param>
       <key>gui_rotation</key>

Modified: grc/trunk/examples/simple/ber_simulation.grc
===================================================================
--- grc/trunk/examples/simple/ber_simulation.grc        2008-07-24 20:10:52 UTC 
(rev 9005)
+++ grc/trunk/examples/simple/ber_simulation.grc        2008-07-24 21:39:11 UTC 
(rev 9006)
@@ -1,23 +1,43 @@
 <?xml version='1.0' encoding='ASCII'?>
 <flow_graph>
-  <timestamp>Thu Jul 10 23:01:33 2008</timestamp>
+  <timestamp>Thu Jul 24 14:28:06 2008</timestamp>
   <block>
-    <key>import</key>
+    <key>options</key>
     <param>
       <key>id</key>
-      <value>import</value>
+      <value>ber_sim</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>import</key>
-      <value>import math</value>
+      <key>title</key>
+      <value>BER Simulation</value>
     </param>
     <param>
+      <key>author</key>
+      <value>Example</value>
+    </param>
+    <param>
+      <key>description</key>
+      <value>Adjust the noise and constellation... see what happens!</value>
+    </param>
+    <param>
+      <key>window_size</key>
+      <value>1280, 1024</value>
+    </param>
+    <param>
+      <key>generate_options</key>
+      <value>wx_gui</value>
+    </param>
+    <param>
+      <key>category</key>
+      <value>Custom</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(142, 152)</value>
+      <value>(16, 10)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -165,68 +185,6 @@
     </param>
   </block>
   <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>samp_rate</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>50e3</value>
-    </param>
-    <param>
-      <key>gui_coordinate</key>
-      <value>(20, 150)</value>
-    </param>
-    <param>
-      <key>gui_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>random_source_x</key>
-    <param>
-      <key>id</key>
-      <value>random_source_x</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>type</key>
-      <value>byte</value>
-    </param>
-    <param>
-      <key>min</key>
-      <value>0</value>
-    </param>
-    <param>
-      <key>max</key>
-      <value>len(const)</value>
-    </param>
-    <param>
-      <key>num_samps</key>
-      <value>1000000</value>
-    </param>
-    <param>
-      <key>repeat</key>
-      <value>False</value>
-    </param>
-    <param>
-      <key>gui_coordinate</key>
-      <value>(12, 228)</value>
-    </param>
-    <param>
-      <key>gui_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
     <key>wxgui_numbersink2</key>
     <param>
       <key>id</key>
@@ -306,22 +264,30 @@
     </param>
   </block>
   <block>
-    <key>variable</key>
+    <key>gr_throttle</key>
     <param>
       <key>id</key>
-      <value>noise</value>
+      <value>gr_throttle</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>value</key>
-      <value>.25</value>
+      <key>type</key>
+      <value>byte</value>
     </param>
     <param>
+      <key>samples_per_second</key>
+      <value>samp_rate</value>
+    </param>
+    <param>
+      <key>vlen</key>
+      <value>1</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(31, 381)</value>
+      <value>(397, 27)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -329,22 +295,30 @@
     </param>
   </block>
   <block>
-    <key>variable</key>
+    <key>blks2_error_rate</key>
     <param>
       <key>id</key>
-      <value>const</value>
+      <value>blks2_error_rate</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>value</key>
-      <value>1+1j, 1-1j, -1-1j, -1+1j</value>
+      <key>type</key>
+      <value>"BER"</value>
     </param>
     <param>
+      <key>win_size</key>
+      <value>1000000</value>
+    </param>
+    <param>
+      <key>bits_per_symbol</key>
+      <value>int(math.log(len(const))/math.log(2))</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(23, 461)</value>
+      <value>(670, 41)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -352,30 +326,26 @@
     </param>
   </block>
   <block>
-    <key>gr_throttle</key>
+    <key>gr_constellation_decoder_cb</key>
     <param>
       <key>id</key>
-      <value>gr_throttle</value>
+      <value>gr_constellation_decoder_cb</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>type</key>
-      <value>byte</value>
+      <key>sym_position</key>
+      <value>const</value>
     </param>
     <param>
-      <key>samples_per_second</key>
-      <value>samp_rate</value>
+      <key>sym_value_out</key>
+      <value>range(len(const))</value>
     </param>
     <param>
-      <key>vlen</key>
-      <value>1</value>
-    </param>
-    <param>
       <key>gui_coordinate</key>
-      <value>(397, 27)</value>
+      <value>(708, 224)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -383,10 +353,10 @@
     </param>
   </block>
   <block>
-    <key>blks2_error_rate</key>
+    <key>random_source_x</key>
     <param>
       <key>id</key>
-      <value>blks2_error_rate</value>
+      <value>random_source_x</value>
     </param>
     <param>
       <key>_enabled</key>
@@ -394,19 +364,27 @@
     </param>
     <param>
       <key>type</key>
-      <value>"BER"</value>
+      <value>byte</value>
     </param>
     <param>
-      <key>win_size</key>
+      <key>min</key>
+      <value>0</value>
+    </param>
+    <param>
+      <key>max</key>
+      <value>len(const)</value>
+    </param>
+    <param>
+      <key>num_samps</key>
       <value>1000000</value>
     </param>
     <param>
-      <key>bits_per_symbol</key>
-      <value>int(math.log(len(const))/math.log(2))</value>
+      <key>repeat</key>
+      <value>False</value>
     </param>
     <param>
       <key>gui_coordinate</key>
-      <value>(670, 41)</value>
+      <value>(15, 244)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -414,26 +392,45 @@
     </param>
   </block>
   <block>
-    <key>gr_constellation_decoder_cb</key>
+    <key>variable</key>
     <param>
       <key>id</key>
-      <value>gr_constellation_decoder_cb</value>
+      <value>noise</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>sym_position</key>
+      <key>value</key>
+      <value>.25</value>
+    </param>
+    <param>
+      <key>gui_coordinate</key>
+      <value>(18, 386)</value>
+    </param>
+    <param>
+      <key>gui_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
       <value>const</value>
     </param>
     <param>
-      <key>sym_value_out</key>
-      <value>range(len(const))</value>
+      <key>_enabled</key>
+      <value>True</value>
     </param>
     <param>
+      <key>value</key>
+      <value>1+1j, 1-1j, -1-1j, -1+1j</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(708, 224)</value>
+      <value>(16, 461)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -441,38 +438,45 @@
     </param>
   </block>
   <block>
-    <key>options</key>
+    <key>variable</key>
     <param>
       <key>id</key>
-      <value>ber_sim</value>
+      <value>samp_rate</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>title</key>
-      <value>BER Simulation</value>
+      <key>value</key>
+      <value>50e3</value>
     </param>
     <param>
-      <key>author</key>
-      <value>Example</value>
+      <key>gui_coordinate</key>
+      <value>(20, 168)</value>
     </param>
     <param>
-      <key>description</key>
-      <value>Adjust the noise and constellation... see what happens!</value>
+      <key>gui_rotation</key>
+      <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>import</key>
     <param>
-      <key>window_size</key>
-      <value>1280, 1024</value>
+      <key>id</key>
+      <value>import</value>
     </param>
     <param>
-      <key>generate_options</key>
-      <value>wx_gui</value>
+      <key>_enabled</key>
+      <value>True</value>
     </param>
     <param>
+      <key>import</key>
+      <value>import math</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(16, 10)</value>
+      <value>(138, 168)</value>
     </param>
     <param>
       <key>gui_rotation</key>

Modified: grc/trunk/examples/usrp/usrp_two_tone_loopback.grc
===================================================================
--- grc/trunk/examples/usrp/usrp_two_tone_loopback.grc  2008-07-24 20:10:52 UTC 
(rev 9005)
+++ grc/trunk/examples/usrp/usrp_two_tone_loopback.grc  2008-07-24 21:39:11 UTC 
(rev 9006)
@@ -1,23 +1,43 @@
 <?xml version='1.0' encoding='ASCII'?>
 <flow_graph>
-  <timestamp>Thu Jul 10 23:02:01 2008</timestamp>
+  <timestamp>Thu Jul 24 14:27:46 2008</timestamp>
   <block>
-    <key>variable</key>
+    <key>options</key>
     <param>
       <key>id</key>
-      <value>samp_rate</value>
+      <value>top_block</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>value</key>
-      <value>64e6/200</value>
+      <key>title</key>
+      <value>USRP Loopback - 2 Tone</value>
     </param>
     <param>
+      <key>author</key>
+      <value>Example</value>
+    </param>
+    <param>
+      <key>description</key>
+      <value>Loopback test with basic rx and basic tx</value>
+    </param>
+    <param>
+      <key>window_size</key>
+      <value>1280, 1024</value>
+    </param>
+    <param>
+      <key>generate_options</key>
+      <value>wx_gui</value>
+    </param>
+    <param>
+      <key>category</key>
+      <value>Custom</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(10, 150)</value>
+      <value>(10, 10)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -80,29 +100,6 @@
     </param>
   </block>
   <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>tun_freq</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>int(100e6)</value>
-    </param>
-    <param>
-      <key>gui_coordinate</key>
-      <value>(109, 151)</value>
-    </param>
-    <param>
-      <key>gui_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
     <key>wxgui_fftsink2</key>
     <param>
       <key>id</key>
@@ -588,38 +585,45 @@
     </param>
   </block>
   <block>
-    <key>options</key>
+    <key>variable</key>
     <param>
       <key>id</key>
-      <value>top_block</value>
+      <value>samp_rate</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>title</key>
-      <value>USRP Loopback - 2 Tone</value>
+      <key>value</key>
+      <value>64e6/200</value>
     </param>
     <param>
-      <key>author</key>
-      <value>Example</value>
+      <key>gui_coordinate</key>
+      <value>(9, 166)</value>
     </param>
     <param>
-      <key>description</key>
-      <value>Loopback test with basic rx and basic tx</value>
+      <key>gui_rotation</key>
+      <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>variable</key>
     <param>
-      <key>window_size</key>
-      <value>1280, 1024</value>
+      <key>id</key>
+      <value>tun_freq</value>
     </param>
     <param>
-      <key>generate_options</key>
-      <value>wx_gui</value>
+      <key>_enabled</key>
+      <value>True</value>
     </param>
     <param>
+      <key>value</key>
+      <value>int(100e6)</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(10, 10)</value>
+      <value>(116, 166)</value>
     </param>
     <param>
       <key>gui_rotation</key>

Modified: grc/trunk/examples/usrp/usrp_wbfm_receive.grc
===================================================================
--- grc/trunk/examples/usrp/usrp_wbfm_receive.grc       2008-07-24 20:10:52 UTC 
(rev 9005)
+++ grc/trunk/examples/usrp/usrp_wbfm_receive.grc       2008-07-24 21:39:11 UTC 
(rev 9006)
@@ -1,23 +1,43 @@
 <?xml version='1.0' encoding='ASCII'?>
 <flow_graph>
-  <timestamp>Thu Jul 10 23:02:11 2008</timestamp>
+  <timestamp>Thu Jul 24 14:27:45 2008</timestamp>
   <block>
-    <key>variable</key>
+    <key>options</key>
     <param>
       <key>id</key>
-      <value>decim</value>
+      <value>top_block</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>value</key>
-      <value>200</value>
+      <key>title</key>
+      <value>USRP WBFM Receive</value>
     </param>
     <param>
+      <key>author</key>
+      <value>Example</value>
+    </param>
+    <param>
+      <key>description</key>
+      <value>WBFM Receive with Basic RX or TV RX</value>
+    </param>
+    <param>
+      <key>window_size</key>
+      <value>1280, 1024</value>
+    </param>
+    <param>
+      <key>generate_options</key>
+      <value>wx_gui</value>
+    </param>
+    <param>
+      <key>category</key>
+      <value>Custom</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(124, 154)</value>
+      <value>(10, 10)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -385,38 +405,22 @@
     </param>
   </block>
   <block>
-    <key>options</key>
+    <key>variable</key>
     <param>
       <key>id</key>
-      <value>top_block</value>
+      <value>decim</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>title</key>
-      <value>USRP WBFM Receive</value>
+      <key>value</key>
+      <value>200</value>
     </param>
     <param>
-      <key>author</key>
-      <value>Example</value>
-    </param>
-    <param>
-      <key>description</key>
-      <value>WBFM Receive with Basic RX or TV RX</value>
-    </param>
-    <param>
-      <key>window_size</key>
-      <value>1280, 1024</value>
-    </param>
-    <param>
-      <key>generate_options</key>
-      <value>wx_gui</value>
-    </param>
-    <param>
       <key>gui_coordinate</key>
-      <value>(10, 10)</value>
+      <value>(14, 173)</value>
     </param>
     <param>
       <key>gui_rotation</key>

Modified: grc/trunk/examples/xmlrpc/xmlrpc_client.grc
===================================================================
--- grc/trunk/examples/xmlrpc/xmlrpc_client.grc 2008-07-24 20:10:52 UTC (rev 
9005)
+++ grc/trunk/examples/xmlrpc/xmlrpc_client.grc 2008-07-24 21:39:11 UTC (rev 
9006)
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='ASCII'?>
 <flow_graph>
-  <timestamp>Thu Jul 10 23:06:23 2008</timestamp>
+  <timestamp>Thu Jul 24 14:27:44 2008</timestamp>
   <block>
     <key>options</key>
     <param>
@@ -32,31 +32,12 @@
       <value>wx_gui</value>
     </param>
     <param>
-      <key>gui_coordinate</key>
-      <value>(10, 10)</value>
+      <key>category</key>
+      <value>Custom</value>
     </param>
     <param>
-      <key>gui_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>samp_rate</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>32000</value>
-    </param>
-    <param>
       <key>gui_coordinate</key>
-      <value>(10, 150)</value>
+      <value>(10, 10)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -305,4 +286,27 @@
       <value>0</value>
     </param>
   </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>samp_rate</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>32000</value>
+    </param>
+    <param>
+      <key>gui_coordinate</key>
+      <value>(13, 172)</value>
+    </param>
+    <param>
+      <key>gui_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
 </flow_graph>
\ No newline at end of file

Modified: grc/trunk/examples/xmlrpc/xmlrpc_server.grc
===================================================================
--- grc/trunk/examples/xmlrpc/xmlrpc_server.grc 2008-07-24 20:10:52 UTC (rev 
9005)
+++ grc/trunk/examples/xmlrpc/xmlrpc_server.grc 2008-07-24 21:39:11 UTC (rev 
9006)
@@ -1,23 +1,43 @@
 <?xml version='1.0' encoding='ASCII'?>
 <flow_graph>
-  <timestamp>Thu Jul 10 23:02:53 2008</timestamp>
+  <timestamp>Thu Jul 24 14:27:42 2008</timestamp>
   <block>
-    <key>variable</key>
+    <key>options</key>
     <param>
       <key>id</key>
-      <value>samp_rate</value>
+      <value>server_block</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>value</key>
-      <value>32000</value>
+      <key>title</key>
+      <value>XMLRPC Server</value>
     </param>
     <param>
+      <key>author</key>
+      <value>Example</value>
+    </param>
+    <param>
+      <key>description</key>
+      <value>example flow graph</value>
+    </param>
+    <param>
+      <key>window_size</key>
+      <value>1280, 1024</value>
+    </param>
+    <param>
+      <key>generate_options</key>
+      <value>wx_gui</value>
+    </param>
+    <param>
+      <key>category</key>
+      <value>Custom</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(10, 150)</value>
+      <value>(10, 10)</value>
     </param>
     <param>
       <key>gui_rotation</key>
@@ -71,52 +91,6 @@
     <key>variable</key>
     <param>
       <key>id</key>
-      <value>freq</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>1000</value>
-    </param>
-    <param>
-      <key>gui_coordinate</key>
-      <value>(14, 230)</value>
-    </param>
-    <param>
-      <key>gui_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
-      <value>ampl</value>
-    </param>
-    <param>
-      <key>_enabled</key>
-      <value>True</value>
-    </param>
-    <param>
-      <key>value</key>
-      <value>1</value>
-    </param>
-    <param>
-      <key>gui_coordinate</key>
-      <value>(13, 309)</value>
-    </param>
-    <param>
-      <key>gui_rotation</key>
-      <value>0</value>
-    </param>
-  </block>
-  <block>
-    <key>variable</key>
-    <param>
-      <key>id</key>
       <value>offset</value>
     </param>
     <param>
@@ -321,44 +295,74 @@
     </param>
   </block>
   <block>
-    <key>options</key>
+    <key>variable</key>
     <param>
       <key>id</key>
-      <value>server_block</value>
+      <value>samp_rate</value>
     </param>
     <param>
       <key>_enabled</key>
       <value>True</value>
     </param>
     <param>
-      <key>title</key>
-      <value>XMLRPC Server</value>
+      <key>value</key>
+      <value>32000</value>
     </param>
     <param>
-      <key>author</key>
-      <value>Example</value>
+      <key>gui_coordinate</key>
+      <value>(11, 160)</value>
     </param>
     <param>
-      <key>description</key>
-      <value>example flow graph</value>
+      <key>gui_rotation</key>
+      <value>0</value>
     </param>
+  </block>
+  <block>
+    <key>variable</key>
     <param>
-      <key>window_size</key>
-      <value>1280, 1024</value>
+      <key>id</key>
+      <value>freq</value>
     </param>
     <param>
-      <key>generate_options</key>
-      <value>wx_gui</value>
+      <key>_enabled</key>
+      <value>True</value>
     </param>
     <param>
+      <key>value</key>
+      <value>1000</value>
+    </param>
+    <param>
       <key>gui_coordinate</key>
-      <value>(10, 10)</value>
+      <value>(11, 237)</value>
     </param>
     <param>
       <key>gui_rotation</key>
       <value>0</value>
     </param>
   </block>
+  <block>
+    <key>variable</key>
+    <param>
+      <key>id</key>
+      <value>ampl</value>
+    </param>
+    <param>
+      <key>_enabled</key>
+      <value>True</value>
+    </param>
+    <param>
+      <key>value</key>
+      <value>1</value>
+    </param>
+    <param>
+      <key>gui_coordinate</key>
+      <value>(13, 315)</value>
+    </param>
+    <param>
+      <key>gui_rotation</key>
+      <value>0</value>
+    </param>
+  </block>
   <connection>
     <source_block_id>gr_sig_source_x</source_block_id>
     <sink_block_id>gr_throttle</sink_block_id>

Modified: grc/trunk/src/grc/elements/Element.py
===================================================================
--- grc/trunk/src/grc/elements/Element.py       2008-07-24 20:10:52 UTC (rev 
9005)
+++ grc/trunk/src/grc/elements/Element.py       2008-07-24 21:39:11 UTC (rev 
9006)
@@ -21,19 +21,19 @@
 address@hidden Josh Blum
 
 class Element(object):
-       
+
        def __init__(self, parent=None):
                self._parent = parent
                self._error_messages = []
                self.flag()
-               
+
        def test(self):
                """
                Test the element against failures.
                Overload this method in sub-classes.
                """
                pass
-               
+
        def validate(self):
                """
                Validate the data in this element.
@@ -41,22 +41,22 @@
                Overload this method in sub-classes.
                """
                pass
-               
+
        def is_valid(self):
                self._error_messages = []#reset err msgs
                try: self.validate()
                except: pass
                return not self.get_error_messages()
-               
+
        def _add_error_message(self, msg):
                self._error_messages.append(msg)
-               
-       def get_error_messages(self): 
+
+       def get_error_messages(self):
                return self._error_messages
-       
+
        def get_parent(self):
                return self._parent
-               
+
        def _exit_with_error(self, error):
                parent = self
                #build hier list of elements
@@ -69,35 +69,35 @@
                for i, element in enumerate(elements + [error]):
                        err_str = err_str + '\n' + ''.join('   '*(i+2)) + 
str(element)
                err_str = err_str + '\n'
-               exit(err_str)           
-               
+               exit(err_str)
+
        ##############################################
        ## Update flagging
-       ##############################################                  
+       ##############################################
        def is_flagged(self): return self._flag
-       def flag(self): 
+       def flag(self):
                self._flag = True
                if self.get_parent(): self.get_parent().flag()
-       def deflag(self): 
+       def deflag(self):
                self._flag = False
-               if self.get_parent(): self.get_parent().deflag()        
-               
+               if self.get_parent(): self.get_parent().deflag()
+
        ##############################################
        ## Type testing methods
-       ##############################################          
-               
+       ##############################################
+
        def is_element(self): return True
-       
+
        def is_platform(self): return False
-       
+
        def is_flow_graph(self): return False
-       
+
        def is_connection(self): return False
-       
+
        def is_block(self): return False
-       
+
        def is_source(self): return False
-       
+
        def is_sink(self): return False
-       
+
        def is_param(self): return False

Modified: grc/trunk/src/grc/gui/elements/Block.py
===================================================================
--- grc/trunk/src/grc/gui/elements/Block.py     2008-07-24 20:10:52 UTC (rev 
9005)
+++ grc/trunk/src/grc/gui/elements/Block.py     2008-07-24 21:39:11 UTC (rev 
9006)
@@ -132,8 +132,8 @@
                #display the params (except for the special params id and 
position)
                from grc import Preferences
                if Preferences.show_params():
-                       if not Preferences.show_id(): hidden_prefs.append('id')
                        for param in filter(lambda p: not 
(p.get_key().startswith('gui_') or p.get_key().startswith('_')), 
self.get_params()):
+                               if not Preferences.show_id() and 
param.get_key() == 'id': continue
                                layout = param.get_layout()
                                layouts.append(layout)
                                w,h = layout.get_pixel_size()

Modified: grc/trunk/src/grc_gnuradio/FlowGraph.py
===================================================================
--- grc/trunk/src/grc_gnuradio/FlowGraph.py     2008-07-24 20:10:52 UTC (rev 
9005)
+++ grc/trunk/src/grc_gnuradio/FlowGraph.py     2008-07-24 21:39:11 UTC (rev 
9006)
@@ -78,7 +78,8 @@
        def get_variables(self):
                """!
                Get a list of all variables in this flow graph namespace.
-               @return a sorted list of variable blocks
+               Exclude paramterized variables.
+               @return a sorted list of variable blocks in order of dependency 
(indep -> dep)
                """
                variables = filter(lambda b: b.get_key() in ('variable', 
'variable_slider', 'variable_chooser', 'variable_text_box'), self.get_blocks())
                #map var id to variable block
@@ -91,6 +92,14 @@
                variables = [id2var[id] for id in sorted_ids]
                return variables
 
+       def get_parameters(self):
+               """!
+               Get a list of all paramterized variables in this flow graph 
namespace.
+               @return a list of paramterized variables
+               """
+               parameters = filter(lambda b: b.get_key() == 'parameter', 
self.get_blocks())
+               return parameters
+
        def evaluate(self, expr):
                """!
                Evaluate the expression.
@@ -106,6 +115,14 @@
                        for imp in self.get_imports():
                                try: exec imp in n
                                except: pass
+                       #load parameters
+                       np = dict()
+                       for parameter in self.get_parameters():
+                               try:
+                                       e = 
eval(parameter.get_param('value').to_code(), n, n)
+                                       np[parameter.get_id()] = e
+                               except: pass
+                       n.update(np) #merge param namespace
                        #load variables
                        for variable in self.get_variables():
                                try:

Modified: grc/trunk/src/grc_gnuradio/Generator.py
===================================================================
--- grc/trunk/src/grc_gnuradio/Generator.py     2008-07-24 20:10:52 UTC (rev 
9005)
+++ grc/trunk/src/grc_gnuradio/Generator.py     2008-07-24 21:39:11 UTC (rev 
9006)
@@ -79,19 +79,20 @@
                """
                imports = self._flow_graph.get_imports()
                variables = self._flow_graph.get_variables()
+               parameters = self._flow_graph.get_parameters()
                #list of blocks not including variables and imports, not 
including disabled blocks
                blocks = sorted(self._flow_graph.get_blocks(), lambda x, y: 
cmp(x.get_id(), y.get_id()))
-               blocks = filter(lambda b: b not in (imports + variables) and 
b.get_enabled(), blocks)
+               blocks = filter(lambda b: b not in (imports + parameters + 
variables) and b.get_enabled(), blocks)
                #list of connections where each endpoint is enabled
                connections = filter(lambda c: c.get_enabled(), 
self._flow_graph.get_connections())
                #list of callbacks
                callbacks = sum([block.get_callbacks() for block in 
self._flow_graph.get_blocks()], [])
                #list of variable names
-               var_ids = [var.get_id() for var in variables]
+               var_ids = [var.get_id() for var in parameters + variables]
                #map var id to the expression (prepend self.)
                var_id2expr = dict(
                        [(var.get_id(), 
expr_utils.expr_prepend(var.get_make().split('\n')[0], var_ids, 'self.'))
-                       for var in variables]
+                       for var in parameters + variables]
                )
                #create graph structure for variables
                variable_graph = expr_utils.get_graph(var_id2expr)
@@ -117,6 +118,7 @@
                        'imports': imports,
                        'flow_graph': self._flow_graph,
                        'variables': variables,
+                       'parameters': parameters,
                        'blocks': blocks,
                        'connections': connections,
                        'gui_type': 
self._flow_graph.get_option('generate_options'),

Modified: grc/trunk/src/grc_gnuradio/blocks/options.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/options.xml       2008-07-24 20:10:52 UTC 
(rev 9005)
+++ grc/trunk/src/grc_gnuradio/blocks/options.xml       2008-07-24 21:39:11 UTC 
(rev 9006)
@@ -58,6 +58,12 @@
                        <key>hb</key>
                </option>
        </param>
+       <param>
+               <name>Category</name>
+               <key>category</key>
+               <value>Custom</value>
+               <type>string</type>
+       </param>
        <check>len($window_size) == 2</check>
        <check>300 &lt;= $(window_size)[0] &lt;= 2048</check>
        <check>300 &lt;= $(window_size)[1] &lt;= 2048</check>
@@ -75,5 +81,8 @@
 
 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....
+
+The category parameter determines the placement of the block in the block 
selection window. \
+The category only applies when creating hier blocks.
        </doc>
 </block>

Added: grc/trunk/src/grc_gnuradio/blocks/variables/parameter.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/variables/parameter.xml                   
        (rev 0)
+++ grc/trunk/src/grc_gnuradio/blocks/variables/parameter.xml   2008-07-24 
21:39:11 UTC (rev 9006)
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Parameter block: a grc variable with key, value
+###################################################
+ -->
+<block>
+       <name>Parameter</name>
+       <key>parameter</key>
+       <make>$value</make>
+       <param>
+               <name>Label</name>
+               <key>label</key>
+               <value></value>
+               <type>string</type>
+       </param>
+       <param>
+               <name>Value</name>
+               <key>value</key>
+               <value>0</value>
+               <type>raw</type>
+       </param>
+       <doc>
+This block represents a parameter to the flow graph, \
+used when the flow graph is instantiated as a hier block.
+
+The paramater value cannot depend on any variables.
+
+Leave the label blank to use the parameter id as the label.
+       </doc>
+</block>

Modified: grc/trunk/src/grc_gnuradio/data/block_tree.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/data/block_tree.xml      2008-07-24 20:10:52 UTC 
(rev 9005)
+++ grc/trunk/src/grc_gnuradio/data/block_tree.xml      2008-07-24 21:39:11 UTC 
(rev 9006)
@@ -243,6 +243,7 @@
                <block>variable_chooser</block>
                <block>variable_text_box</block>
                <block>variable_sink</block>
+               <block>parameter</block>
        </cat>
        <cat>
                <name>Misc</name>

Modified: grc/trunk/src/grc_gnuradio/data/default_flow_graph.grc.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/data/default_flow_graph.grc.xml  2008-07-24 
20:10:52 UTC (rev 9005)
+++ grc/trunk/src/grc_gnuradio/data/default_flow_graph.grc.xml  2008-07-24 
21:39:11 UTC (rev 9006)
@@ -33,7 +33,7 @@
                </param>
                <param>
                        <key>gui_coordinate</key>
-                       <value>(10, 150)</value>
+                       <value>(10, 170)</value>
                </param>
                <param>
                        <key>gui_rotation</key>

Modified: grc/trunk/src/grc_gnuradio/data/flow_graph.tmpl
===================================================================
--- grc/trunk/src/grc_gnuradio/data/flow_graph.tmpl     2008-07-24 20:10:52 UTC 
(rev 9005)
+++ grc/trunk/src/grc_gnuradio/data/flow_graph.tmpl     2008-07-24 21:39:11 UTC 
(rev 9006)
@@ -5,6 +5,7 @@
 address@hidden imports the import statements
 address@hidden flow_graph the flow_graph
 address@hidden variables the variable blocks
address@hidden parameters the paramater blocks
 address@hidden blocks the signal blocks
 address@hidden connections the connections
 address@hidden gui_type the type of gui (wx gui or no gui)
@@ -30,24 +31,14 @@
 #end for
 
 ########################################################
-##Create Variables
-##     Write out the first line the variable make.
-########################################################
-#for $var in $variables
-       #set $code = $var.get_make().splitlines()[0]
-$var.get_id() = $code
-#end for
-
-########################################################
 ##Create Class
 ##     Write the class declaration for a top or hier block.
-##     The variable names are the arguments to __init__.
-##     The variable declaration above provide default values.
+##     The parameter names are the arguments to __init__.
 ##     Determine the absolute icon path (wx gui only).
 ##     Setup the IO signature (hier block only).
 ########################################################
 #set $class_name = $flow_graph.get_option('id')
-#set $var_ids_str = ', '.join(['self'] + ['%s=%s'%(var.get_id(), var.get_id()) 
for var in $variables])
+#set $param_str = ', '.join(['self'] + ['%s=%s'%(param.get_id(), 
param.get_make()) for param in $parameters])
 #if $gui_type == 'wx_gui'
        #import os
        #from grc.Constants import MAIN_WINDOW_PREFIX,DATA_DIR
@@ -59,7 +50,7 @@
        #end if
 class $(class_name)(grc_wxgui.top_block_gui):
 
-       def __init__($var_ids_str):
+       def __init__($param_str):
                grc_wxgui.top_block_gui.__init__(
                        self,
                        title="$MAIN_WINDOW_PREFIX - Executing: 
$flow_graph.get_option('title')",
@@ -68,14 +59,14 @@
 #elif $gui_type == 'no_gui'
 class $(class_name)(gr.top_block):
 
-       def __init__($var_ids_str):
+       def __init__($param_str):
                gr.top_block.__init__(self, "$flow_graph.get_option('title')")
 #elif $gui_type == 'hb'
        #set $in_sig = $flow_graph.get_input_signature()
        #set $out_sig = $flow_graph.get_output_signature()
 class $(class_name)(gr.hier_block2):
 
-       def __init__($var_ids_str):
+       def __init__($param_str):
                gr.hier_block2.__init__(
                        self,
                        "$flow_graph.get_option('title')",
@@ -85,31 +76,43 @@
 #end if
 
 ########################################################
+##Create Parameters
+##     Set the parameter to a property of self..
+########################################################
+#if $parameters
+               $DIVIDER
+               # Parameters
+               $DIVIDER
+#end if
+#for $param in $parameters
+               self.$param.get_id() = $param.get_id()
+#end for
+
+########################################################
 ##Create Variables
-##     Remove the first line of the variable make,
-##     This line will be handled in the main section.
 ##     Set the variable to a property of self.
-##     Write the variable make (minus the first line).
-##     Indent the variable make with 2 tabs.
+##     Write the variable make, and indent with 2 tabs.
 ########################################################
+#if $variables
                $DIVIDER
                # Variables
                $DIVIDER
+#end if
 #for $var in $variables
+       #set $code = '\n\t\t'.join($var.get_make().splitlines())
+               $var.get_id() = $code
                self.$var.get_id() = $var.get_id()
-       #set $code = '\n\t\t'.join($var.get_make().splitlines()[1:])
-       #if $code
-               $code
-       #end if
 #end for
 
 ########################################################
 ##Create Blocks
 ##     Write the block make, and indent with 2 tabs.
 ########################################################
+#if $blocks
                $DIVIDER
                # Blocks
                $DIVIDER
+#end if
 #for $blk in filter(lambda b: b.get_make(), $blocks)
        #set $code = '\n\t\t'.join($blk.get_make().splitlines())
                $("self.%s = %s"%($blk.get_id(), $code))
@@ -120,9 +123,11 @@
 ##     The port name should be the id of the parent block.
 ##     However, port names for IO pads should be self.
 ########################################################
+#if $connections
                $DIVIDER
                # Connections
                $DIVIDER
+#end if
 #for $con in $connections
        #set $source = $con.get_source()
        #set $sink = $con.get_sink()
@@ -150,7 +155,7 @@
 ##     Write a set method for this variable that calls the callbacks
 ##     and sets the direct variable dependencies.
 ########################################################
-#for $var in $variables
+#for $var in $parameters + $variables
        #set $id = $var.get_id()
        def set_$(id)(self, $id):
                self.$id = $id





reply via email to

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