Skip to content

Commit

Permalink
Added default value to Tranformer model
Browse files Browse the repository at this point in the history
  • Loading branch information
Fahim committed Mar 2, 2016
1 parent 0b0949c commit 35415e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/kicadtoNgspice/Convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,25 +204,25 @@ def addModelParameter(self,schematicInfo):
try:
start=line[7]
end=line[8]
num_turns=str(self.obj_track.model_entry_var[start].text())
num_turns=str(self.obj_track.model_entry_var[start+1].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())
h1=str(self.obj_track.model_entry_var[start].text())
b1=str(self.obj_track.model_entry_var[start+5].text())

if len(h1)!=0 and len(b1)!=0:
h_array=h_array+h1+" "
b_array=b_array+b1+" "
bh_array = h_array+" ] " + b_array+" ]"
else:
bh_array = "H_array = [-1000 -500 -375 -250 -188 -125 -63 0 63 125 188 250 375 500 1000] B_array = [-3.13e-3 -2.63e-3 -2.33e-3 -1.93e-3 -1.5e-3 -6.25e-4 -2.5e-4 0 2.5e-4 6.25e-4 1.5e-3 1.93e-3 2.33e-3 2.63e-3 3.13e-3]"
area=str(self.obj_track.model_entry_var[start+3].text())
area=str(self.obj_track.model_entry_var[start+2].text())
length=str(self.obj_track.model_entry_var[start+4].text())
if area=="": area="1"
if length=="":length="0.01"
num_turns2=str(self.obj_track.model_entry_var[start+5].text())
num_turns2=str(self.obj_track.model_entry_var[start+3].text())
if num_turns2=="": num_turns2="620"
addmodelLine=".model "+line[3]+"_primary lcouple (num_turns= "+num_turns+")"
modelParamValue.append([line[0],addmodelLine,"*primary lcouple"])
Expand Down
11 changes: 6 additions & 5 deletions src/kicadtoNgspice/Processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ def convertICintoBasicBlocks(self,schematicInfo,outputOption,modelList,plotText)
modelList.append([index,compline,modelname,compName,comment,title,type,paramDict])

elif compType in plotList:
print "Plot Data---------->"
schematicInfo.insert(index,"* "+compline)
if compType == 'plot_v1':
words = compline.split()
Expand Down Expand Up @@ -358,12 +357,14 @@ def convertICintoBasicBlocks(self,schematicInfo,outputOption,modelList,plotText)
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['primary_turns'] = "Enter the primary number of turns (default=310) "
paramDict['area'] = "Enter iron core area (default=1)"
paramDict['secondar_turns'] = "Enter the secondary number of turns (default=620)"
paramDict['length'] = "Enter iron core length (default=0.01)"
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:
Expand Down

0 comments on commit 35415e9

Please sign in to comment.