summaryrefslogtreecommitdiff
path: root/grc/python/Constants.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/python/Constants.py')
-rw-r--r--grc/python/Constants.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/grc/python/Constants.py b/grc/python/Constants.py
index 868c822aa..4a234f080 100644
--- a/grc/python/Constants.py
+++ b/grc/python/Constants.py
@@ -45,6 +45,38 @@ FLOW_GRAPH_TEMPLATE = os.path.join(DATA_DIR, 'flow_graph.tmpl')
BLOCK_DTD = os.path.join(DATA_DIR, 'block.dtd')
DEFAULT_FLOW_GRAPH = os.path.join(DATA_DIR, 'default_flow_graph.grc')
+CORE_TYPES = ( #name, key, sizeof, color
+ ('Complex Float 64', 'fc64', 16, '#72f313'),
+ ('Complex Float 32', 'fc32', 8, '#3399FF'),
+ ('Complex Integer 32', 'sc32', 8, '#00b789'),
+ ('Complex Integer 16', 'sc16', 4, '#f37913'),
+ ('Complex Integer 8', 'sc8', 2, '#ff0e7f'),
+ ('Float 64', 'f64', 8, '#86a8fa'),
+ ('Float 32', 'f32', 4, '#FF8C69'),
+ ('Integer 32', 's32', 4, '#00FF99'),
+ ('Integer 16', 's16', 2, '#FFFF66'),
+ ('Integer 8', 's8', 1, '#FF66FF'),
+ ('Message Queue', 'msg', 0, '#777777'),
+ ('Wildcard', '', 0, '#FFFFFF'),
+)
+
+ALIAS_TYPES = {
+ 'complex' : (8, '#3399FF'),
+ 'float' : (4, '#FF8C69'),
+ 'int' : (4, '#00FF99'),
+ 'short' : (2, '#FFFF66'),
+ 'byte' : (1, '#FF66FF'),
+}
+
+TYPE_TO_COLOR = dict()
+TYPE_TO_SIZEOF = dict()
+for name, key, sizeof, color in CORE_TYPES:
+ TYPE_TO_COLOR[key] = color
+ TYPE_TO_SIZEOF[key] = sizeof
+for key, (sizeof, color) in ALIAS_TYPES.iteritems():
+ TYPE_TO_COLOR[key] = color
+ TYPE_TO_SIZEOF[key] = sizeof
+
#coloring
COMPLEX_COLOR_SPEC = '#3399FF'
FLOAT_COLOR_SPEC = '#FF8C69'