Connection.py

Go to the documentation of this file.
00001 """
00002 Copyright 2008 Free Software Foundation, Inc.
00003 This file is part of GNU Radio
00004 
00005 GNU Radio Companion is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU General Public License
00007 as published by the Free Software Foundation; either version 2
00008 of the License, or (at your option) any later version.
00009 
00010 GNU Radio Companion is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
00018 """
00019 ##@package grc_gnuradio.Connection
00020 #Flow graph connection.
00021 #A connection exists between 2 ports.
00022 #One port must be input, one output.
00023 #The port decided whether it can have the connection.
00024 #@author Josh Blum
00025 
00026 from grc.elements.Connection import Connection as _Connection
00027 
00028 class Connection(_Connection):
00029         
00030         def validate(self):
00031                 """
00032                 Validate the connections.
00033                 The ports must match in type and vector length.
00034                 """
00035                 _Connection.validate(self) #checks type
00036                 #check vector length
00037                 source_vlen = self.get_source().get_vlen()
00038                 sink_vlen = self.get_sink().get_vlen()
00039                 try: assert(source_vlen == sink_vlen)
00040                 except AssertionError: self._add_error_message('Source vector length "%s" does not match sink vector length "%s".'%(source_vlen, sink_vlen))
00041                 
00042                 

Generated on Sat Aug 23 02:00:11 2008 for GNU Radio Companion by  doxygen 1.5.4