2 Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
3 This file is part of GNU Radio
5 GNU Radio Companion is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 GNU Radio Companion is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 from gnuradio import gr
22 from .. base.Platform import Platform as _Platform
23 from .. gui.Platform import Platform as _GUIPlatform
24 from FlowGraph import FlowGraph as _FlowGraph
25 from Connection import Connection as _Connection
26 from Block import Block as _Block
27 from Port import Port as _Port
28 from Param import Param as _Param
29 from Generator import Generator
30 from Constants import \
31 HIER_BLOCKS_LIB_DIR, BLOCK_DTD, \
32 DEFAULT_FLOW_GRAPH, BLOCKS_DIRS
35 COLORS = (#title, #color spec
36 ('Complex', Constants.COMPLEX_COLOR_SPEC),
37 ('Float', Constants.FLOAT_COLOR_SPEC),
38 ('Integer', Constants.INT_COLOR_SPEC),
39 ('Short', Constants.SHORT_COLOR_SPEC),
40 ('Byte', Constants.BYTE_COLOR_SPEC),
41 ('Complex Vector', Constants.COMPLEX_VECTOR_COLOR_SPEC),
42 ('Float Vector', Constants.FLOAT_VECTOR_COLOR_SPEC),
43 ('Integer Vector', Constants.INT_VECTOR_COLOR_SPEC),
44 ('Short Vector', Constants.SHORT_VECTOR_COLOR_SPEC),
45 ('Byte Vector', Constants.BYTE_VECTOR_COLOR_SPEC),
46 ('Wildcard', Constants.WILDCARD_COLOR_SPEC),
47 ('Message', Constants.MSG_COLOR_SPEC),
50 class Platform(_Platform, _GUIPlatform):
54 Make a platform for gnuradio.
57 if not os.path.exists(HIER_BLOCKS_LIB_DIR): os.mkdir(HIER_BLOCKS_LIB_DIR)
58 #convert block paths to absolute paths
59 block_paths = set(map(os.path.abspath, BLOCKS_DIRS))
63 name='GNU Radio Companion',
66 license=__doc__.strip(),
67 website='http://gnuradio.org/redmine/wiki/gnuradio/GNURadioCompanion',
68 block_paths=block_paths,
70 default_flow_graph=DEFAULT_FLOW_GRAPH,
74 _GUIPlatform.__init__(self)
76 ##############################################
78 ##############################################
79 FlowGraph = _FlowGraph
80 Connection = _Connection