def add_ccvs(self, name, n1, n2, source_name, value): n1 = self.add_node(n1) n2 = self.add_node(n2) element = Element.HSrc(name=name, n1=n1, n2=n2, source_name=source_name, value=value) self.append(element)
def parse_ccvs(line, mycircuit): line_elements = line.split() n1 = mycircuit.add_node(line_elements[1]) n2 = mycircuit.add_node(line_elements[2]) element = Element.HSrc(name=line_elements[0], n1=n1, n2=n2, source_name=line_elements[3], value=unit_transform( line_elements[4])) # type: HSrc return [element]