summaryrefslogtreecommitdiff
path: root/src/kicadtoNgspice/Convert.py
diff options
context:
space:
mode:
authorfahim2015-04-20 18:22:56 +0530
committerfahim2015-04-20 18:22:56 +0530
commitfe285354e017598950572690e11989ab8eae1f81 (patch)
tree21ce3e93a5a525eff14e1984271d5c01e803a8f9 /src/kicadtoNgspice/Convert.py
parentcff82a13a44c5a3cdf3be5e0a744080726a13772 (diff)
parent7b95fb166dfa5ae31c033732c5bf90463ed1022b (diff)
downloadeSim-fe285354e017598950572690e11989ab8eae1f81.tar.gz
eSim-fe285354e017598950572690e11989ab8eae1f81.tar.bz2
eSim-fe285354e017598950572690e11989ab8eae1f81.zip
Merge branch 'master' of https://github.com/FOSSEE/eSim
Conflicts: src/kicadtoNgspice/KicadtoNgspice.pyc
Diffstat (limited to 'src/kicadtoNgspice/Convert.py')
-rw-r--r--src/kicadtoNgspice/Convert.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py
index 1e293996..c0d98548 100644
--- a/src/kicadtoNgspice/Convert.py
+++ b/src/kicadtoNgspice/Convert.py
@@ -130,15 +130,16 @@ class Convert:
if self.variable== 'AC':
self.no=0
- self.writefile.write(".ac"+' ' + self.ac_type + ' '+str(self.ac_entry_var[self.no+2].text())+' ' + str(self.ac_entry_var[self.no].text()) + self.ac_parameter[self.no]+ ' ' + str(self.ac_entry_var[self.no+1].text()) + self.ac_parameter[self.no+1] )
+ self.writefile.write(".ac"+' ' + self.ac_type + ' '+ str(self.defaultvalue(self.ac_entry_var[self.no+2].text()))+' ' + str(self.defaultvalue(self.ac_entry_var[self.no].text())) + self.ac_parameter[self.no]+ ' ' + str(self.defaultvalue(self.ac_entry_var[self.no+1].text())) + self.ac_parameter[self.no+1] )
elif self.variable=='DC':
- self.no=0
- self.writefile.write(".dc" +' '+ str(self.dc_entry_var[self.no].text())+ ' '+ str(self.dc_entry_var[self.no+1].text()) + self.converttosciform(self.dc_parameter[self.no]) + ' '+ str(self.dc_entry_var[self.no+3].text())+ self.converttosciform(self.dc_parameter[self.no+2]) + ' '+ str(self.dc_entry_var[self.no+2].text()) + self.converttosciform(self.dc_parameter[self.no+1]))
+ self.no=0
+ self.writefile.write(".dc" +' '+ str(self.dc_entry_var[self.no].text())+ ' '+ str(self.defaultvalue(self.dc_entry_var[self.no+1].text())) + self.converttosciform(self.dc_parameter[self.no]) + ' '+ str(self.defaultvalue(self.dc_entry_var[self.no+3].text()))+ self.converttosciform(self.dc_parameter[self.no+2]) + ' '+ str(self.defaultvalue(self.dc_entry_var[self.no+2].text())) + self.converttosciform(self.dc_parameter[self.no+1]))
elif self.variable == 'TRAN':
self.no= 0
- self.writefile.write(".tran" + ' '+ str(self.tran_entry_var[self.no+1].text()) + self.converttosciform(self.trans_parameter[self.no+1]) + ' ' + str(self.tran_entry_var[self.no+2].text()) + self.converttosciform(self.trans_parameter[self.no+2])+' '+ str(self.tran_entry_var[self.no].text())+ self.converttosciform(self.trans_parameter[self.no]))
+ self.writefile.write(".tran" + ' '+ str(self.defaultvalue(self.tran_entry_var[self.no+1].text())) + self.converttosciform(self.trans_parameter[self.no+1]) + ' ' + str(self.defaultvalue(self.tran_entry_var[self.no+2].text())) + self.converttosciform(self.trans_parameter[self.no+2])+' '+ str(self.defaultvalue(self.tran_entry_var[self.no].text()))+ self.converttosciform(self.trans_parameter[self.no]))
+
else:
pass
self.writefile.close()
@@ -155,6 +156,13 @@ class Convert:
return "e-12"
else:
return "e-00"
+
+ def defaultvalue(self, value):
+ self.value= value
+ if self.value == '':
+ return 0
+ else:
+ pass
def addModelParameter(self,schematicInfo):
@@ -250,4 +258,6 @@ class Convert:
return schematicInfo
+
+
\ No newline at end of file