def __init__(self, block_name, input_ports=None, output_ports=None): input_ports = input_ports if input_ports != None else [] output_ports = output_ports if output_ports != None else [] BaseBlock.__init__(self, block_name, input_ports, output_ports) #The blocks in the CBD will be stored both #-as an ordered list __blocks and #-as a dictionary __blocksDict with the blocknames as keys #for fast name-based retrieval and to ensure block names are unique within a single CBD self.__blocks = [] self.__blocksDict = {} self.__clock = None self.__deltaT = None self.__logger = naivelog.getLogger("CBD") for input_port in input_ports: self.addBlock(InputPortBlock(input_port, self)) for output_port in output_ports: self.addBlock(OutputPortBlock(output_port, self))
def __init__(self, block_name, string, lev=level.WARNING): BaseBlock.__init__(self, block_name, ["IN1"], []) self.__string = string self.__logger = naivelog.getLogger("WarningLog") self.__lev = lev