summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfahim-oscad2016-04-21 15:56:56 +0530
committerfahim-oscad2016-04-21 15:56:56 +0530
commitc86b02741c88f220219410508d388bbc56fa766f (patch)
tree636100bc2f194b91ed3ec38c0bfd40d960214c6d /src
parent955682e89b02d66b1985687cd1d2466f6c06320e (diff)
downloadeSim-c86b02741c88f220219410508d388bbc56fa766f.tar.gz
eSim-c86b02741c88f220219410508d388bbc56fa766f.tar.bz2
eSim-c86b02741c88f220219410508d388bbc56fa766f.zip
Modified inbuilt ngspice model code for getUnitVal function
Diffstat (limited to 'src')
-rw-r--r--src/ngspicetoModelica/NgspicetoModelica.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ngspicetoModelica/NgspicetoModelica.py b/src/ngspicetoModelica/NgspicetoModelica.py
index 72e2c6eb..cdb41299 100644
--- a/src/ngspicetoModelica/NgspicetoModelica.py
+++ b/src/ngspicetoModelica/NgspicetoModelica.py
@@ -411,8 +411,6 @@ class NgMoConverter:
for eachline in self.inbuiltModelDetail:
words=eachline.split()
userModelParamList = []
- #print "Model Info--------->",modelInfo
- #print "Inbuilt Model Mapped to ref---------->",self.inbuiltModelDict
refName = words[-1]
print "Reference Model Name------->",refName
actualModelName = self.inbuiltModelDict[refName]
@@ -421,17 +419,17 @@ class NgMoConverter:
print "Import Statement-------->",start
stat = start +" "+ words[0]+"("
tempstatList=[]
- print "Start Stat-------->",stat
+ print "Start of Stat-------->",stat
for key in modelInfo[refName]:
#If parameter is not mapped then it will just pass
try:
actualModelicaParam = self.mappingData["Models"][actualModelName]["mapping"][key]
- tempstatList.append(actualModelicaParam+"="+modelInfo[refName][actualModelicaParam]+" ")
+ tempstatList.append(actualModelicaParam+"="+self.getUnitVal(modelInfo[refName][key])+" ")
userModelParamList.append(str(actualModelicaParam))
except:
pass
- print "User Model list---->",userModelParamList
+ print "User Model Parameter list---->",userModelParamList
#Running loop over default parameter of OpenModelica
for default in self.mappingData["Models"][actualModelName]["default"]:
@@ -439,7 +437,7 @@ class NgMoConverter:
continue
else:
defaultValue = self.mappingData["Models"][actualModelName]["default"][default]
- tempstatList.append(default+"="+defaultValue+" ")
+ tempstatList.append(default+"="+self.getUnitVal(defaultValue)+" ")
#print "My Stat------------>",stat
#print "Temp Stat List--------->",tempstatList