diff options
author | xoher | 2015-06-23 18:38:02 +0530 |
---|---|---|
committer | xoher | 2015-06-23 18:38:02 +0530 |
commit | 6af9f606a72d3c4399873840de3c683d423df5a6 (patch) | |
tree | 3d4eb335a02347d289dad226d5b2ca202da9edad /src/kicadtoNgspice/KicadtoNgspice.py | |
parent | 39fecda9f1be8b1007552437d53c06bdc02f4b47 (diff) | |
download | eSim-6af9f606a72d3c4399873840de3c683d423df5a6.tar.gz eSim-6af9f606a72d3c4399873840de3c683d423df5a6.tar.bz2 eSim-6af9f606a72d3c4399873840de3c683d423df5a6.zip |
Check if path exists for DeviceModel,Subcircuit and storing previous values for Subcircuit
Diffstat (limited to 'src/kicadtoNgspice/KicadtoNgspice.py')
-rw-r--r-- | src/kicadtoNgspice/KicadtoNgspice.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index 7e8617ae..c9b5ac02 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -348,9 +348,10 @@ class MainWindow(QtGui.QWidget): if check==1: for child in attr_parent: if child.tag=="devicemodel": + del child[:] attr_devicemodel=child - print "Device model dict",obj_devicemodel.devicemodel_dict_beg - print "Device model dict end",obj_devicemodel.devicemodel_dict_end + #print "Device model dict",obj_devicemodel.devicemodel_dict_beg + #print "Device model dict end",obj_devicemodel.devicemodel_dict_end ########################## for i in obj_devicemodel.devicemodel_dict_beg: attr_var=ET.SubElement(attr_devicemodel,i) @@ -374,6 +375,23 @@ class MainWindow(QtGui.QWidget): ################################################################################################################### + if check==0: + attr_subcircuit=ET.SubElement(attr_parent,"subcircuit") + if check==1: + for child in attr_parent: + if child.tag=="subcircuit": + del child[:] + attr_subcircuit=child + ########################## + for i in obj_subcircuitTab.subcircuit_dict_beg: + attr_var=ET.SubElement(attr_subcircuit,i) + it=obj_subcircuitTab.subcircuit_dict_beg[i] + end=obj_subcircuitTab.subcircuit_dict_end[i] + + while it<=end: + ET.SubElement(attr_var,"field").text=str(obj_subcircuitTab.entry_var[it].text()) + it=it+1 + tree=ET.ElementTree(attr_parent) tree.write(fw) |