From 4cc26f6e32de44480947d685a9e1320e2b914555 Mon Sep 17 00:00:00 2001 From: Fahim Date: Thu, 18 Feb 2016 14:04:21 +0530 Subject: Subject: Modified convert to accept current source. Description: Modified convert to accept current source. --- src/kicadtoNgspice/KicadtoNgspice.py | 16 +--------------- src/kicadtoNgspice/Processing.py | 2 +- src/kicadtoNgspice/Source.py | 9 ++------- 3 files changed, 4 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index df776e7e..1da52994 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -296,7 +296,7 @@ class MainWindow(QtGui.QWidget): if tmp_check==0: words=i.split(' ') wordv=words[0] - if wordv[0]=="v": + if wordv[0]=="v" or wordv[0]=="i": attr_var=ET.SubElement(attr_source,words[0],name="Source type") attr_var.text=words[len(words)-1] #ET.SubElement(attr_ac,"field1",name="Lin").text="true" @@ -428,21 +428,7 @@ class MainWindow(QtGui.QWidget): while it<=end: ET.SubElement(attr_var,"field").text=str(obj_devicemodel.entry_var[it].text()) it=it+1 - ##################################### - - """keys=obj_devicemodel.devicemodel_dict.keys() - n=len(keys) - for i in range(n): - thisKey=keys[i] - nextKey=keys[(i+1)%n] - nextValue=obj_devicemodel.devicemodel_dict[nextKey] - attr_var=ET.SubElement(attr_devicemodel,thisKey) - it=obj_devicemodel.devicemodel_dict[thisKey] - while it<=nextValue: - ET.SubElement(attr_var,"field").text=obj_devicemodel.entry_var[it]""" - ################################################################################################################### - if check==0: attr_subcircuit=ET.SubElement(attr_parent,"subcircuit") if check==1: diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py index 0eaf6d2f..587cfcec 100644 --- a/src/kicadtoNgspice/Processing.py +++ b/src/kicadtoNgspice/Processing.py @@ -88,7 +88,7 @@ class PrcocessNetlist: words=compline.split() compName=words[0] # Ask for parameters of source - if compName[0]=='v' or compName=='i': + if compName[0]=='v' or compName[0]=='i': # Find the index component from circuit index=schematicInfo.index(compline) if words[3]=="pulse": diff --git a/src/kicadtoNgspice/Source.py b/src/kicadtoNgspice/Source.py index c2750732..c1bec121 100644 --- a/src/kicadtoNgspice/Source.py +++ b/src/kicadtoNgspice/Source.py @@ -52,16 +52,11 @@ class Source(QtGui.QWidget): self.grid = QtGui.QGridLayout() self.setLayout(self.grid) xml_num=0 - """self.ac_check=0 - self.dc_check=0 - self.sine_check=0 - self.pulse_check=0 - self.pwl_check=0 - self.exp_check=0""" + if sourcelist: for line in sourcelist: #print "Voltage source line index: ",line[0] - #print "SourceList line Test: ",line + print "SourceList line Test: ",line track_id=line[0] #print "track_id is ",track_id if line[2]=='ac': -- cgit