Merge branch 'wip/gr-noaa' of http://gnuradio.org/git/jcorgan into master
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Thu, 24 Sep 2009 01:17:15 +0000 (18:17 -0700)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Thu, 24 Sep 2009 01:17:15 +0000 (18:17 -0700)
* 'wip/gr-noaa' of http://gnuradio.org/git/jcorgan:
  Added README and updated configuration requirements
  Split HRPT script into live receive and post-processing
  Dumps HRPT frames to text file similar to specification document
  Added skeleton HRPT decoder block
  Updated HRPT receiver to read files recorded as shorts
  Add HRPT word output to deframer
  Reorganization of directories
  Added HRPT deframer block
  Changed synchronizer to output sliced bits.
  Updated HRPT blocks/scripts for testing.  Seeing good minor frame sync's.
  Implemented crude timing recovery using zero crossings but no resampling
  Work in progress, incomplete
  Update rx_poes script to filter prior to PLL.
  Created new gr-noaa top-level component.

grc/base/Block.py
grc/base/FlowGraph.py
grc/todo.txt

index cb21c3958a2f0e3da1fb32025ec747e32528ad1e..203e878e400650105806d155ec243483c3cacd4c 100644 (file)
@@ -233,12 +233,22 @@ class Block(Element):
                """
                Import this block's params from nested data.
                Any param keys that do not exist will be ignored.
+               Since params can be dynamically created based another param,
+               call rewrite, and repeat the load until the params stick.
+               This call to rewrite will also create any dynamic ports
+               that are needed for the connections creation phase.
                @param n the nested data odict
                """
-               params_n = n.findall('param')
-               for param_n in params_n:
-                       key = param_n.find('key')
-                       value = param_n.find('value')
-                       #the key must exist in this block's params
-                       if key in self.get_param_keys():
-                               self.get_param(key).set_value(value)
+               get_hash = lambda: reduce(lambda x, y: x ^ y, [hash(param) for param in self.get_params()], 0)
+               my_hash = 0
+               while get_hash() != my_hash:
+                       params_n = n.findall('param')
+                       for param_n in params_n:
+                               key = param_n.find('key')
+                               value = param_n.find('value')
+                               #the key must exist in this block's params
+                               if key in self.get_param_keys():
+                                       self.get_param(key).set_value(value)
+                       #store hash and call rewrite
+                       my_hash = get_hash()
+                       self.rewrite()
index ce370ca242036486d975c17676c9e0ab0a0cdfa8..7c51ef42a475a7fb0ba6fceff4465c2131c079a3 100644 (file)
@@ -184,7 +184,6 @@ class FlowGraph(Element):
                        #only load the block when the block key was valid
                        if block: block.import_data(block_n)
                        else: Messages.send_error_load('Block key "%s" not found in %s'%(key, self.get_parent()))
-               self.rewrite() #rewrite all blocks before connections are made (ex: nports)
                #build the connections
                for connection_n in connections_n:
                        #try to make the connection
index 7fa68e523aae4af0a2ad254a9d42edc83d4f5aae..b4e3af39d671f9a98b17079a124277c21514a845 100644 (file)
@@ -69,8 +69,6 @@
 * threads dont die on exit in probe and variable sink
 * align param titles in properties dialog
 * weird grid params misbehaving
-* the block's import data does not handle variable params
-  * call rewrite after load, if new params appear, try load again...
 
 ##################################################
 # Future