diff options
Diffstat (limited to 'src/kicadtoNgspice')
-rw-r--r-- | src/kicadtoNgspice/Convert.py | 19 | ||||
-rw-r--r-- | src/kicadtoNgspice/KicadtoNgspice.py | 3 | ||||
-rw-r--r-- | src/kicadtoNgspice/Processing.py | 16 |
3 files changed, 27 insertions, 11 deletions
diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py index efd70cc2..78a39c2f 100644 --- a/src/kicadtoNgspice/Convert.py +++ b/src/kicadtoNgspice/Convert.py @@ -207,14 +207,18 @@ class Convert: #print "Model Track :",line if line[2] == 'transfo': try: - start=line[5] - end=line[6] + print "Transformer-------------->" + print "Line ---------->",line + start=line[7] + end=line[8] num_turns=str(self.obj_track.model_entry_var[start].text()) + if num_turns=="": num_turns="310" h_array= "H_array = [ " b_array = "B_array = [ " h1=str(self.obj_track.model_entry_var[start+1].text()) b1=str(self.obj_track.model_entry_var[start+2].text()) + if len(h1)!=0 and len(b1)!=0: h_array=h_array+h1+" " b_array=b_array+b1+" " @@ -239,8 +243,8 @@ class Convert: elif line[2] == 'ic': try: - start=line[5] - end=line[6] + start=line[7] + end=line[8] for key,value in line[9].iteritems(): initVal = str(self.obj_track.model_entry_var[value].text()) if initVal=="":initVal="0" @@ -254,8 +258,8 @@ class Convert: else: try: - start = line[5] - end = line[6] + start = line[7] + end = line[8] addmodelLine=".model "+ line[3]+" "+line[2]+"(" for key,value in line[9].iteritems(): #print "Tags: ",key @@ -303,7 +307,8 @@ class Convert: schematicInfo.append(item[2]) #Adding Comment schematicInfo.append(item[1]) #Adding model line - print "MYSCH------->",schematicInfo + print "Schematic Info after ngspice Model------->",schematicInfo + print "Model Parameter Value ",modelParamValue return schematicInfo def addDeviceLibrary(self,schematicInfo,kicadFile): diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index 669b51d0..a8c24893 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -39,9 +39,6 @@ class MainWindow(QtGui.QWidget): This final netlist is compatible with NgSpice. """ def __init__(self,clarg1,clarg2=None): - - - QtGui.QWidget.__init__(self) print "==================================" diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py index 587cfcec..55c7b702 100644 --- a/src/kicadtoNgspice/Processing.py +++ b/src/kicadtoNgspice/Processing.py @@ -179,7 +179,7 @@ class PrcocessNetlist: print "Words",words print "compName",compName #Looking if model file is present - if compType != "port" and compType != "ic" and compType not in plotList: + if compType != "port" and compType != "ic" and compType not in plotList and compType != 'transfo': xmlfile = compType+".xml" #XML Model File count = 0 #Check if model of same name is present modelPath = [] @@ -331,6 +331,20 @@ class PrcocessNetlist: words = compline.split() plotText.append("plot phase("+words[1]+")") + elif compType == 'transfo': + schematicInfo.insert(index,"* "+compline) + modelname = "transfo" + comment = "* "+compline + title = "Transformer details for model "+compName + type = "NA" #It is model but do not load from xml and lib file + paramDict['primary_turns'] = "Enter the primary number of turns " + paramDict['h1_array'] = "Enter the H1 array " + paramDict['b1_array'] = "Enter the B1 array " + paramDict['area'] = "Enter iron core area " + paramDict['length'] = "Enter iron core length" + paramDict['secondar_turns'] = "Enter the secondary number of turns" + modelList.append([index,compline,modelname,compName,comment,title,type,paramDict]) + else: schematicInfo.insert(index,"* "+compline) |