[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 05/10: grc: Generator warning for flowgraph
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 05/10: grc: Generator warning for flowgraphs with a throttle and an external source/sink |
Date: |
Tue, 26 Aug 2014 19:40:07 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit bcee01bf9bb04eeda82158e564949d79715bfca3
Author: Marcus Müller <address@hidden>
Date: Mon Aug 25 23:14:39 2014 +0200
grc: Generator warning for flowgraphs with a throttle and an external
source/sink
The Generator will now issue a warning that it is usually wrong to use
any hardware flow control and a throttle block at the same time.
---
gr-blocks/grc/blocks_udp_source.xml | 1 +
grc/python/Generator.py | 12 +++++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/gr-blocks/grc/blocks_udp_source.xml
b/gr-blocks/grc/blocks_udp_source.xml
index bca1dff..3b434c1 100644
--- a/gr-blocks/grc/blocks_udp_source.xml
+++ b/gr-blocks/grc/blocks_udp_source.xml
@@ -7,6 +7,7 @@
<block>
<name>UDP Source</name>
<key>blocks_udp_source</key>
+ <throttle>1</throttle>
<import>from gnuradio import blocks</import>
<make>blocks.udp_source($type.size*$vlen, $ipaddr, $port, $psize,
$eof)</make>
<callback>set_mtu($mtu)</callback>
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index eb24b75..92f36cf 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -59,11 +59,17 @@ class Generator(object):
def write(self):
#do throttle warning
- throttled = any(map(lambda b: b.throttle(),
self._flow_graph.get_enabled_blocks()))
- if not throttled and self._generate_options != 'hb':
+ throttling_blocks = filter(lambda b: b.throttle(),
self._flow_graph.get_enabled_blocks())
+ if not throttling_blocks and self._generate_options != 'hb':
Messages.send_warning('''\
-This flow graph may not have flow control: no audio or usrp blocks found. \
+This flow graph may not have flow control: no audio or RF hardware blocks
found. \
Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
+ if len(throttling_blocks) > 1:
+ keys = set(map(lambda b: b.get_key(), throttling_blocks))
+ if len(keys) > 1 and 'blocks_throttle' in keys:
+ Messages.send_warning('''\
+This flow graph contains a throttle block and another rate limiting block,
e.g. a hardware source or sink. \
+This is usually undesired. Consider removing the throttle block.''')
#generate
open(self.get_file_path(), 'w').write(str(self))
if self._generate_options == 'hb':
- [Commit-gnuradio] [gnuradio] branch master updated (99e0c0a -> 5af1200), git, 2014/08/26
- [Commit-gnuradio] [gnuradio] 10/10: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2014/08/26
- [Commit-gnuradio] [gnuradio] 04/10: grc: moving xml pi into nested data, git, 2014/08/26
- [Commit-gnuradio] [gnuradio] 09/10: Merge branch 'maint', git, 2014/08/26
- [Commit-gnuradio] [gnuradio] 07/10: grc: Small fixes to make menu items consistent., git, 2014/08/26
- [Commit-gnuradio] [gnuradio] 03/10: grc: adding version information to flowgraph files using XML processing instructions, git, 2014/08/26
- [Commit-gnuradio] [gnuradio] 08/10: grc: clean-up toolbar, git, 2014/08/26
- [Commit-gnuradio] [gnuradio] 06/10: grc: added save_reports action., git, 2014/08/26
- [Commit-gnuradio] [gnuradio] 01/10: grc: Reloading blocks forces reload for all open flow graphs., git, 2014/08/26
- [Commit-gnuradio] [gnuradio] 05/10: grc: Generator warning for flowgraphs with a throttle and an external source/sink,
git <=
- [Commit-gnuradio] [gnuradio] 02/10: grc: Reload marks page as modified only if an error occured during import (i.e. ports no longer exist), git, 2014/08/26