[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 36/101: grc: keep list of active ports in c
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 36/101: grc: keep list of active ports in core blocks |
Date: |
Thu, 16 Mar 2017 14:58:03 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch python3
in repository gnuradio.
commit db5ab0f2a0e694ca9149d66171e0dbbb87dd74da
Author: Sebastian Koslowski <address@hidden>
Date: Tue Jul 12 17:40:40 2016 +0200
grc: keep list of active ports in core blocks
---
grc/core/Block.py | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/grc/core/Block.py b/grc/core/Block.py
index 631dabc..9bcb6e6 100644
--- a/grc/core/Block.py
+++ b/grc/core/Block.py
@@ -101,6 +101,8 @@ class Block(Element):
self.port_counters = [itertools.count(), itertools.count()]
self.sources = self._init_ports(sources_n, direction='source')
self.sinks = self._init_ports(sinks_n, direction='sink')
+ self.active_sources = [] # on rewrite
+ self.active_sinks = [] # on rewrite
self.states = {'_enabled': True}
@@ -253,6 +255,9 @@ class Block(Element):
port.key = str(domain_specific_port_index[domain])
domain_specific_port_index[domain] += 1
+ self.active_sources = [p for p in self.get_sources_gui() if not
p.get_hide()]
+ self.active_sinks = [p for p in self.get_sinks_gui() if not
p.get_hide()]
+
def get_imports(self, raw=False):
"""
Resolve all import statements.
@@ -497,7 +502,10 @@ class Block(Element):
return self.sources + self.sinks
def get_ports_gui(self):
- return self.filter_bus_port(self.sources) +
self.filter_bus_port(self.sinks)
+ return self.get_sources_gui() + self.get_sinks_gui()
+
+ def active_ports(self):
+ return itertools.chain(self.active_sources, self.active_sinks)
def get_children(self):
return self.get_ports() + self.params.values()
@@ -711,10 +719,12 @@ class Block(Element):
except:
return ''
- def back_ofthe_bus(self, portlist):
+ @staticmethod
+ def back_ofthe_bus(portlist):
portlist.sort(key=lambda p: p._type == 'bus')
- def filter_bus_port(self, ports):
+ @staticmethod
+ def filter_bus_port(ports):
buslist = [p for p in ports if p._type == 'bus']
return buslist or ports
- [Commit-gnuradio] [gnuradio] 06/101: grc: gtk3: update props dialog, (continued)
- [Commit-gnuradio] [gnuradio] 06/101: grc: gtk3: update props dialog, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 17/101: grc-refactor: move more port type color stuff to gui, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 09/101: grc-refactor: replace some unnecessary getters, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 24/101: grc-refactor: the hopeless cause of bus ports..., git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 25/101: Merge branch 'next_grcwg' into gtk3 (v3.7.10 release), git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 34/101: grc: fix parent getter in rewrite_epy_block, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 13/101: grc-refactor: Connections, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 28/101: grc: refactor: block state handling, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 26/101: grc: gtk3: enable block comments, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 12/101: grc-refactor: remove odict, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 36/101: grc: keep list of active ports in core blocks,
git <=
- [Commit-gnuradio] [gnuradio] 23/101: grc-refactor: make block.params a dict, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 29/101: grc: refactor: block states are no longer hidden params, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 37/101: grc: refactor: fixup selection code and core connection changes, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 22/101: grc-refactor: Block: make more public attribs, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 35/101: grc: gtk3: quick fix for file dialogs, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 41/101: grc: gtk3: fix PythonEditorParam widget, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 02/101: gtk3: add flowgraph draw code and other gtk3 fixes (WIP), git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 21/101: grc-refactor: Block: remove key getters, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 31/101: grc: gtk3: refactor connection draw code, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 14/101: grc-refactor: rewrite tree-api in core, git, 2017/03/16