2 Copyright 2008 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
19 ##@package grc_gnuradio.Platform
20 #Gnuradio python specific platform.
23 from grc.Constants import FLOW_GRAPH_FILE_EXTENSION
24 from grc.elements.Platform import Platform as _Platform
25 from FlowGraph import FlowGraph as _FlowGraph
26 from Connection import Connection as _Connection
27 from Block import Block as _Block
28 from Port import Source,Sink
29 from Param import Param as _Param
30 from Generator import Generator
31 from Constants import *
33 class Platform(_Platform):
35 def __init__(self, block_paths_internal_only=[], block_paths_external=[]):
37 Make a platform for gnuradio.
38 The internal only list will replace the current block path.
39 @param block_paths_internal_only a list of blocks internal to this platform
40 @param block_paths_external a list of blocks to load in addition to the above blocks
43 if not os.path.exists(HIER_BLOCKS_LIB_DIR): os.mkdir(HIER_BLOCKS_LIB_DIR)
45 if block_paths_internal_only:
46 block_paths = map(lambda b: os.path.join(BLOCKS_DIR, b), ['options.xml'] + block_paths_internal_only)
47 else: block_paths = [BLOCKS_DIR]
49 block_paths.extend(block_paths_external)
51 block_paths.append(HIER_BLOCKS_LIB_DIR)
55 name='GNURadio Python',
56 key='gnuradio_python',
57 block_paths=block_paths,
59 block_tree=BLOCK_TREE,
60 default_flow_graph=DEFAULT_FLOW_GRAPH,
64 ##############################################
66 ##############################################
67 FlowGraph = _FlowGraph
68 Connection = _Connection