[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r8439 - in grc/trunk: . notes src/grc src/grc_gnuradio
From: |
jblum |
Subject: |
[Commit-gnuradio] r8439 - in grc/trunk: . notes src/grc src/grc_gnuradio src/grc_gnuradio/blocks |
Date: |
Sat, 17 May 2008 22:14:30 -0600 (MDT) |
Author: jblum
Date: 2008-05-17 22:14:27 -0600 (Sat, 17 May 2008)
New Revision: 8439
Removed:
grc/trunk/notes/programming_style.txt
Modified:
grc/trunk/Makefile
grc/trunk/notes/todo.txt
grc/trunk/readme.txt
grc/trunk/setup.py
grc/trunk/src/grc/Constants.py
grc/trunk/src/grc_gnuradio/FlowGraph.py
grc/trunk/src/grc_gnuradio/Param.py
grc/trunk/src/grc_gnuradio/blocks/options.xml
grc/trunk/src/grc_gnuradio/extract_docs.py
Log:
eval namespace cache, updated docs, makefile options
Modified: grc/trunk/Makefile
===================================================================
--- grc/trunk/Makefile 2008-05-17 18:14:07 UTC (rev 8438)
+++ grc/trunk/Makefile 2008-05-18 04:14:27 UTC (rev 8439)
@@ -23,21 +23,23 @@
DOCS_DEST = /usr/local/share/doc/
all:
- @echo Options: build, install, docs_install, clean
-
-docs_install:
- mkdir -p $(DOCS_DEST)
- wget $(DOCS_URL) -O - | tar -xzv -C $(DOCS_DEST)
+ @echo Options: build, clean, install, uninstall, docs_install,
docs_uninstall
build: clean
- python setup.py build
+ python setup.py build
+clean:
+ if [ -d build ]; then rm -rf build; fi
+
install: build
python setup.py install
uninstall:
rm -rf `python -c "import grc,os;print os.path.dirname(grc.__file__)"`*
-
-clean:
- if [ -d build ]; then rm -rf build; fi
-
+
+docs_install:
+ mkdir -p $(DOCS_DEST)
+ wget $(DOCS_URL) -O - | tar -xzv -C $(DOCS_DEST)
+
+docs_uninstall:
+ rm -rf $(DOCS_DEST)grc*
Deleted: grc/trunk/notes/programming_style.txt
Modified: grc/trunk/notes/todo.txt
===================================================================
--- grc/trunk/notes/todo.txt 2008-05-17 18:14:07 UTC (rev 8438)
+++ grc/trunk/notes/todo.txt 2008-05-18 04:14:27 UTC (rev 8439)
@@ -14,7 +14,6 @@
-create sub-flow graphs to be used in larger flow graphs
-copy and paste blocks
-disable blocks (grey out, keep in design file, but generate ignores)
--eval cache
-param display, better string truncate
-param editor, expand entry boxes in focus
-change param dialog to panel within main window
Modified: grc/trunk/readme.txt
===================================================================
--- grc/trunk/readme.txt 2008-05-17 18:14:07 UTC (rev 8438)
+++ grc/trunk/readme.txt 2008-05-18 04:14:27 UTC (rev 8439)
@@ -7,7 +7,7 @@
You will also find a "creative common license" for the grc icon.
Intructions for GRC are available at:
-http://gnuradio.org/trac/wiki/GNURadioCompanion
+http://joshknows.com/pages/grc_gnuradio.html#intro
If you have questions, problems, suggestions, or want to contribute,
please email me at jblum at jhu dot edu
Modified: grc/trunk/setup.py
===================================================================
--- grc/trunk/setup.py 2008-05-17 18:14:07 UTC (rev 8438)
+++ grc/trunk/setup.py 2008-05-18 04:14:27 UTC (rev 8439)
@@ -23,8 +23,6 @@
from distutils.core import setup
-VERSION = __import__('src/grc/Constants').VERSION
-
PACKAGES = [
'grc',
'grc.elements',
@@ -62,7 +60,6 @@
setup(
name='GRC',
- version=VERSION,
description='GNURadio Companion',
author='Josh Blum',
author_email='address@hidden',
Modified: grc/trunk/src/grc/Constants.py
===================================================================
--- grc/trunk/src/grc/Constants.py 2008-05-17 18:14:07 UTC (rev 8438)
+++ grc/trunk/src/grc/Constants.py 2008-05-18 04:14:27 UTC (rev 8439)
@@ -27,7 +27,7 @@
######################################################################################################
##The current version of this code
-VERSION = 'reloaded (alpha)'
+VERSION = 'reloaded (trunk)'
##The name to appear in the main window for a flow graph that has not been
saved to file.
NEW_FLOGRAPH_TITLE = 'untitled'
Modified: grc/trunk/src/grc_gnuradio/FlowGraph.py
===================================================================
--- grc/trunk/src/grc_gnuradio/FlowGraph.py 2008-05-17 18:14:07 UTC (rev
8438)
+++ grc/trunk/src/grc_gnuradio/FlowGraph.py 2008-05-18 04:14:27 UTC (rev
8439)
@@ -27,23 +27,27 @@
class FlowGraph(_FlowGraph):
def evaluate(self, expr):
- """
+ """!
Evaluate the expression.
@param expr the string expression
@throw Exception bad expression
@return the evaluated data
"""
- n = dict() #namespace
- #load imports
- for block in filter(lambda b: b.get_key() == 'import',
self.get_blocks()):
- try: exec block.get_make() in n
- except: pass
- #load variables
- for block in filter(lambda b:
b.get_key().startswith('variable'), self.get_blocks()):
- try:
- e = eval(block.get_make(), n, n)
- n[block.get_id()] = e
- except: pass
- e = eval(expr, n, n)
+ if not hasattr(self, '_update_flag') or self._update_flag:
+ self._update_flag = False
+ #reload namespace
+ self.n = n = dict() #namespace
+ #load imports
+ for block in filter(lambda b: b.get_key() == 'import',
self.get_blocks()):
+ try: exec block.get_make() in n
+ except: pass
+ #load variables
+ for block in filter(lambda b:
b.get_key().startswith('variable'), self.get_blocks()):
+ try:
+ e = eval(block.get_make(), n, n)
+ n[block.get_id()] = e
+ except: pass
+ #evaluate
+ e = eval(expr, self.n, self.n)
return e
Modified: grc/trunk/src/grc_gnuradio/Param.py
===================================================================
--- grc/trunk/src/grc_gnuradio/Param.py 2008-05-17 18:14:07 UTC (rev 8438)
+++ grc/trunk/src/grc_gnuradio/Param.py 2008-05-18 04:14:27 UTC (rev 8439)
@@ -36,8 +36,16 @@
'grid_pos', 'import',
]
+ def set_value(self, value):
+ """!
+ Set the value and update the flow graph's update flag.
+ @param value the new value
+ """
+ self.get_parent().get_parent()._update_flag = True
+ _Param.set_value(self, value)
+
def evaluate(self):
- """
+ """!
Evaluate the value.
@return evaluated type
"""
Modified: grc/trunk/src/grc_gnuradio/blocks/options.xml
===================================================================
--- grc/trunk/src/grc_gnuradio/blocks/options.xml 2008-05-17 18:14:07 UTC
(rev 8438)
+++ grc/trunk/src/grc_gnuradio/blocks/options.xml 2008-05-18 04:14:27 UTC
(rev 8439)
@@ -54,6 +54,15 @@
<check>300 <= $(window_size)[0] <= 2048</check>
<check>300 <= $(window_size)[1] <= 2048</check>
<doc>
-The window size in (width, height) must be between (300, 300) and (2048, 2048).
+The options block sets special parameters for the flow graph. \
+Only one option block is allowed per flow graph.
+
+Title, author, and description parameters are for identification purposes.
+
+The window size controls the dimensions of the flow graph editor. \
+The window size (width, height) must be between (300, 300) and (2048, 2048).
+
+The generate options controls the type of code generated (wx-graphical or
non-graphical). \
+Non-graphical flow graphs should avoid using graphical sinks or graphical
variable controls.
</doc>
</block>
Modified: grc/trunk/src/grc_gnuradio/extract_docs.py
===================================================================
--- grc/trunk/src/grc_gnuradio/extract_docs.py 2008-05-17 18:14:07 UTC (rev
8438)
+++ grc/trunk/src/grc_gnuradio/extract_docs.py 2008-05-18 04:14:27 UTC (rev
8439)
@@ -51,6 +51,7 @@
file = file.replace('__', '_') #doxygen xml files have 2 underscores
file = file.replace('_1_1', '_') #weird blks2 doxygen syntax
if key.startswith('gr_'): key = key.replace('gr_', 'classgr_')
+ elif key.startswith('trellis_'): key = key.replace('trellis_',
'classtrellis_')
elif key.startswith('blks2_'): key = key.replace('blks2_', '')
else: return False
for k, f in zip(*map(reversed, map(lambda x: x.split('_'), [key,
file]))):
@@ -75,21 +76,23 @@
#combine all matches
doc_strs = list()
for match in matches:
- xml_file = DOCS_DIR + '/' + match
- xml = etree.parse(xml_file)
- #extract descriptions
- comp_name =
extract_txt(xml.xpath(DOXYGEN_NAME_XPATH)[0]).strip('\n')
- comp_name = ' --- ' + comp_name + ' --- '
- if key.startswith('gr_'):
- brief_desc =
extract_txt(xml.xpath(DOXYGEN_BRIEFDESC_GR_XPATH)[0]).strip('\n')
- detailed_desc =
extract_txt(xml.xpath(DOXYGEN_DETAILDESC_GR_XPATH)[0]).strip('\n')
- elif key.startswith('blks2_'):
- brief_desc =
extract_txt(xml.xpath(DOXYGEN_BRIEFDESC_BLKS2_XPATH)[0]).strip('\n')
- detailed_desc =
extract_txt(xml.xpath(DOXYGEN_DETAILDESC_BLKS2_XPATH)[0]).strip('\n')
- else:
- brief_desc = ''
- detailed_desc = ''
- #combine
- doc_strs.append('\n'.join([comp_name, brief_desc,
detailed_desc]).strip('\n'))
+ try:
+ xml_file = DOCS_DIR + '/' + match
+ xml = etree.parse(xml_file)
+ #extract descriptions
+ comp_name =
extract_txt(xml.xpath(DOXYGEN_NAME_XPATH)[0]).strip('\n')
+ comp_name = ' --- ' + comp_name + ' --- '
+ if key.startswith('gr_') or key.startswith('trellis_'):
+ brief_desc =
extract_txt(xml.xpath(DOXYGEN_BRIEFDESC_GR_XPATH)[0]).strip('\n')
+ detailed_desc =
extract_txt(xml.xpath(DOXYGEN_DETAILDESC_GR_XPATH)[0]).strip('\n')
+ elif key.startswith('blks2_'):
+ brief_desc =
extract_txt(xml.xpath(DOXYGEN_BRIEFDESC_BLKS2_XPATH)[0]).strip('\n')
+ detailed_desc =
extract_txt(xml.xpath(DOXYGEN_DETAILDESC_BLKS2_XPATH)[0]).strip('\n')
+ else:
+ brief_desc = ''
+ detailed_desc = ''
+ #combine
+ doc_strs.append('\n'.join([comp_name, brief_desc,
detailed_desc]).strip('\n'))
+ except IndexError: pass #bad format
return '\n\n'.join(doc_strs)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r8439 - in grc/trunk: . notes src/grc src/grc_gnuradio src/grc_gnuradio/blocks,
jblum <=