diff options
author | Johnathan Corgan <jcorgan@corganenterprises.com> | 2011-03-14 20:07:36 -0700 |
---|---|---|
committer | Johnathan Corgan <jcorgan@corganenterprises.com> | 2011-03-14 20:07:36 -0700 |
commit | 22deb62a872413bdeff63e4fb565b4bcce2c6508 (patch) | |
tree | 79571572f1f130b5153019d70d31b2c868cf0b97 /grc/python/Generator.py | |
parent | f3d373492fe415ced2bbf0be3f8e6da66576fcdc (diff) | |
parent | 4d5096c8b084c5832256dc2cd8bb617ee93d94a4 (diff) |
Merge remote branch 'jblum/mergeme/qtgui/grc' into next
* jblum/mergeme/qtgui/grc: (27 commits)
qtgui: removed python directory that was added, never used
qtgui-grc: added suport in main template for theme icon
qtgui-grc: minor tweaks to the various things
qtgui-grc: added read-only thermo widget to range block
qtgui-grc: fix for list option working in chooser block
qtgui-grc: added check for pyqwt in config
grc: added function args to probe block and documentation
grc: rework the probe blocks and how they fit into grc
qtgui-grc: moved slider to range, added knob and gui tweaks
qtgui-grc: use a vboxlayout for the top_layout
qtgui-grc: made slider widget components (counter/slider) optional
qtgui-grc: add engineering notation to entry and label + other tweaks
qtgui-grc: enable start/stop control through qt widgets
qtgui-grc: rename the text entry and label blocks
grc-qtgui: creaded check box widget with qtgui, cleanup label code
grc-qtgui: added variable text box and static text widgets
grc-qtgui: pick correct signal overload for variable chooser
grc-qtgui: added radio button support, tweaks, more options
grc-qtgui: work on variable chooser block
grc: work on generator for gui flowgraphs to simplify generation
...
Diffstat (limited to 'grc/python/Generator.py')
-rw-r--r-- | grc/python/Generator.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/grc/python/Generator.py b/grc/python/Generator.py index d53802bef8..b669fa65af 100644 --- a/grc/python/Generator.py +++ b/grc/python/Generator.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -90,18 +90,20 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') imports = self._flow_graph.get_imports() variables = self._flow_graph.get_variables() parameters = self._flow_graph.get_parameters() - #list of variables with controls - controls = filter(lambda v: v.get_make(), variables) #list of blocks not including variables and imports and parameters and disabled - blocks = sorted(self._flow_graph.get_enabled_blocks(), lambda x, y: cmp(x.get_id(), y.get_id())) - probes = filter(lambda b: b.get_key().startswith('probe_'), blocks) #ensure probes are last in the block list - #get a list of notebooks and sort them according dependencies - notebooks = expr_utils.sort_objects( - filter(lambda b: b.get_key() == 'notebook', blocks), - lambda n: n.get_id(), lambda n: n.get_param('notebook').get_value(), + def _get_block_sort_text(block): + code = block.get_make().replace(block.get_id(), ' ') + try: code += block.get_param('notebook').get_value() #older gui markup w/ wxgui + except: pass + try: code += block.get_param('gui_hint').get_value() #newer gui markup w/ qtgui + except: pass + return code + blocks = expr_utils.sort_objects( + self._flow_graph.get_enabled_blocks(), + lambda b: b.get_id(), _get_block_sort_text ) #list of regular blocks (all blocks minus the special ones) - blocks = filter(lambda b: b not in (imports + parameters + variables + probes + notebooks), blocks) + probes + blocks = filter(lambda b: b not in (imports + parameters), blocks) #list of connections where each endpoint is enabled connections = filter(lambda c: not c.is_msg(), self._flow_graph.get_enabled_connections()) messages = filter(lambda c: c.is_msg(), self._flow_graph.get_enabled_connections()) @@ -125,8 +127,6 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') 'imports': imports, 'flow_graph': self._flow_graph, 'variables': variables, - 'notebooks': notebooks, - 'controls': controls, 'parameters': parameters, 'blocks': blocks, 'connections': connections, |