summaryrefslogtreecommitdiff
path: root/src/kicadtoNgspice
diff options
context:
space:
mode:
authorfahim2015-04-23 12:06:56 +0530
committerfahim2015-04-23 12:06:56 +0530
commit2c623deaf46848b02efc31a44c5d3fb2d97885e7 (patch)
treea8603c22371ed7379c63bd3055d8c330f38b21bd /src/kicadtoNgspice
parent342730ed59f75ebe1b5df0f886ae9e6bcd787ee6 (diff)
downloadeSim-2c623deaf46848b02efc31a44c5d3fb2d97885e7.tar.gz
eSim-2c623deaf46848b02efc31a44c5d3fb2d97885e7.tar.bz2
eSim-2c623deaf46848b02efc31a44c5d3fb2d97885e7.zip
Subject: Changes in Processing of XML file
Description: Change the compType which is taken from .cir file to modelname which is taken from xml file for more generic pattern
Diffstat (limited to 'src/kicadtoNgspice')
-rw-r--r--src/kicadtoNgspice/KicadtoNgspice.py15
-rw-r--r--src/kicadtoNgspice/KicadtoNgspice.pycbin7415 -> 7254 bytes
-rw-r--r--src/kicadtoNgspice/Model.py2
-rw-r--r--src/kicadtoNgspice/Model.pycbin1945 -> 1945 bytes
-rw-r--r--src/kicadtoNgspice/Processing.py15
-rw-r--r--src/kicadtoNgspice/Processing.pycbin8441 -> 8485 bytes
6 files changed, 16 insertions, 16 deletions
diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py
index f8faa997..9452e364 100644
--- a/src/kicadtoNgspice/KicadtoNgspice.py
+++ b/src/kicadtoNgspice/KicadtoNgspice.py
@@ -183,8 +183,8 @@ class MainWindow(QtGui.QWidget):
analysisOption = []
initialCondOption=[]
simulatorOption =[]
- includeOption=[] #Don't know why to use it
- model = [] #Don't know why to use it
+ #includeOption=[] #Don't know why to use it
+ #model = [] #Don't know why to use it
for eachline in optionInfo:
words=eachline.split()
@@ -201,10 +201,10 @@ class MainWindow(QtGui.QWidget):
initialCondOption.append(eachline+'\n')
elif option=='.option':
simulatorOption.append(eachline+'\n')
- elif (option=='.include' or option=='.lib'):
- includeOption.append(eachline+'\n')
- elif (option=='.model'):
- model.append(eachline+'\n')
+ #elif (option=='.include' or option=='.lib'):
+ # includeOption.append(eachline+'\n')
+ #elif (option=='.model'):
+ # model.append(eachline+'\n')
elif option=='.end':
continue;
@@ -239,7 +239,7 @@ class MainWindow(QtGui.QWidget):
-
+#Main Function
def main(args):
print "=================================="
@@ -313,7 +313,6 @@ def main(args):
kingWindow.show()
sys.exit(app.exec_())
-
if __name__ == '__main__':
diff --git a/src/kicadtoNgspice/KicadtoNgspice.pyc b/src/kicadtoNgspice/KicadtoNgspice.pyc
index de20b98b..58008146 100644
--- a/src/kicadtoNgspice/KicadtoNgspice.pyc
+++ b/src/kicadtoNgspice/KicadtoNgspice.pyc
Binary files differ
diff --git a/src/kicadtoNgspice/Model.py b/src/kicadtoNgspice/Model.py
index f450cf56..fff27707 100644
--- a/src/kicadtoNgspice/Model.py
+++ b/src/kicadtoNgspice/Model.py
@@ -70,7 +70,7 @@ class Model(QtGui.QWidget):
Listing all
line[0] = index
line[1] = compLine
- line[2] = compType
+ line[2] = modelname #Change from compType to modelname
line[3] = compName
line[4] = comment
line[5] = title
diff --git a/src/kicadtoNgspice/Model.pyc b/src/kicadtoNgspice/Model.pyc
index 72aaef1b..e9c5fc3d 100644
--- a/src/kicadtoNgspice/Model.pyc
+++ b/src/kicadtoNgspice/Model.pyc
Binary files differ
diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py
index 6fb79921..9295a058 100644
--- a/src/kicadtoNgspice/Processing.py
+++ b/src/kicadtoNgspice/Processing.py
@@ -166,6 +166,9 @@ class PrcocessNetlist:
compType=words[len(words)-1];
schematicInfo.remove(compline)
paramDict = {}
+ #e.g compLine : u1 1 2 gain
+ #compType : gain
+ #compName : u1
print "Compline",compline
print "CompType",compType
print "Words",words
@@ -205,9 +208,6 @@ class PrcocessNetlist:
elif child.tag == 'split':
splitDetail = child.text
- #print "Child Item",child
- #print "Tag",child.tag
- #print "Tag Value",child.text
for param in tree.findall('param'):
for item in param:
@@ -274,13 +274,14 @@ class PrcocessNetlist:
k=k+1
except Exception as e:
print "Error while appending ModelLine ",modelLine
- print "Excpetion Message : ",str(e)
+ print "Exception Message : ",str(e)
#Insert comment at remove line
schematicInfo.insert(index,"* "+compline)
- comment = "* "+modelname+" "+compType
- modelList.append([index,compline,compType,compName,comment,title,type,paramDict])
+ comment = "* Schematic Name: "+compType+", NgSpice Name: "+modelname
+ #Here instead of adding compType(use for XML), added modelName(Unique Model Name)
+ modelList.append([index,compline,modelname,compName,comment,title,type,paramDict])
except:
- print "Unable to parse the model, Please check your your xml file"
+ print "Unable to parse the model, Please check your your XML file"
sys.exit(2)
#print "Count",count
diff --git a/src/kicadtoNgspice/Processing.pyc b/src/kicadtoNgspice/Processing.pyc
index efd69b68..08b83116 100644
--- a/src/kicadtoNgspice/Processing.pyc
+++ b/src/kicadtoNgspice/Processing.pyc
Binary files differ