commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8910 - in grc/trunk/src/grc_gnuradio: . data


From: jblum
Subject: [Commit-gnuradio] r8910 - in grc/trunk/src/grc_gnuradio: . data
Date: Wed, 16 Jul 2008 19:34:10 -0600 (MDT)

Author: jblum
Date: 2008-07-16 19:34:10 -0600 (Wed, 16 Jul 2008)
New Revision: 8910

Modified:
   grc/trunk/src/grc_gnuradio/FlowGraph.py
   grc/trunk/src/grc_gnuradio/Generator.py
   grc/trunk/src/grc_gnuradio/data/flow_graph.tmpl
Log:
different file modes for tb/hb, changed io sig

Modified: grc/trunk/src/grc_gnuradio/FlowGraph.py
===================================================================
--- grc/trunk/src/grc_gnuradio/FlowGraph.py     2008-07-17 00:55:55 UTC (rev 
8909)
+++ grc/trunk/src/grc_gnuradio/FlowGraph.py     2008-07-17 01:34:10 UTC (rev 
8910)
@@ -32,16 +32,23 @@
                Get an io signature for this flow graph.
                The pad key determines the directionality of the io signature.
                @param pad_key a string of pad_source or pad_sink
-               @return a string tuple of type, num_ports, port_size
+               @return a dict with: type, nports, vlen, size
                """
                pads = filter(lambda b: b.get_key() == pad_key, 
self.get_blocks())
-               if not pads: return '', '0', '0'
+               if not pads: return {
+                       'nports': '0',
+                       'type': '',
+                       'vlen': '0',
+                       'size': '0',
+               }
                pad = pads[0] #take only the first, user should not have more 
than 1
-               nports = pad.get_param('nports').to_code()
-               type = pad.get_param('type').to_code()
-               size = pad.get_param('type').get_opt('size')
-               vlen = pad.get_param('vlen').to_code()
-               return type, nports, "%s*%s"%(size, vlen)
+               #load io signature
+               return {
+                       'nports': pad.get_param('nports').to_code(),
+                       'type': pad.get_param('type').to_code(),
+                       'vlen': pad.get_param('vlen').to_code(),
+                       'size': pad.get_param('type').get_opt('size'),
+               }
 
        def get_input_signature(self):
                """!

Modified: grc/trunk/src/grc_gnuradio/Generator.py
===================================================================
--- grc/trunk/src/grc_gnuradio/Generator.py     2008-07-17 00:55:55 UTC (rev 
8909)
+++ grc/trunk/src/grc_gnuradio/Generator.py     2008-07-17 01:34:10 UTC (rev 
8910)
@@ -31,10 +31,10 @@
 PYEXEC = 'python'
 #>>> platform dependency! MacOS requires pythonw to run wx apps        #
 if sys.platform == 'darwin': PYEXEC = 'pythonw'
-
 PATH = os.path.abspath(os.path.dirname(__file__))
-
 FLOW_GRAPH_TEMPLATE = os.path.join(PATH, 'data', 'flow_graph.tmpl')
+TOP_BLOCK_FILE_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | 
stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP | stat.S_IROTH
+HIER_BLOCK_FILE_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | 
stat.S_IWGRP | stat.S_IROTH
 
 class Generator(object):
 
@@ -49,7 +49,9 @@
        def write(self):
                #generate
                open(self.get_file_path(), 'w').write(str(self))
-               mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | 
stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP | stat.S_IROTH
+               if self._flow_graph.get_option('generate_options') == 'hb':
+                       mode = HIER_BLOCK_FILE_MODE
+               else: mode = TOP_BLOCK_FILE_MODE
                os.chmod(self.get_file_path(), mode)
 
        def get_popen(self):

Modified: grc/trunk/src/grc_gnuradio/data/flow_graph.tmpl
===================================================================
--- grc/trunk/src/grc_gnuradio/data/flow_graph.tmpl     2008-07-17 00:55:55 UTC 
(rev 8909)
+++ grc/trunk/src/grc_gnuradio/data/flow_graph.tmpl     2008-07-17 01:34:10 UTC 
(rev 8910)
@@ -77,8 +77,8 @@
                gr.hier_block2.__init__(
                        self,
                        "$flow_graph.get_option('title')",
-                       gr.io_signature($in_sig[1], $in_sig[1], $in_sig[2]),
-                       gr.io_signature($out_sig[1], $out_sig[1], $out_sig[2]),
+                       gr.io_signature($in_sig.nports, $in_sig.nports, 
$in_sig.size*$in_sig.vlen),
+                       gr.io_signature($out_sig.nports, $out_sig.nports, 
$out_sig.size*$out_sig.vlen),
                )
 #end if
 





reply via email to

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