summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfahim-oscad2016-04-27 14:53:43 +0530
committerfahim-oscad2016-04-27 14:53:43 +0530
commitd72f0914f3b7944fb97e3d242e3757b1d6388de0 (patch)
tree6f16068da1980484f4864d116d2de7084b989b66
parent9eb2372278e7823e0df3ccb94306ce7f62e3f97b (diff)
downloadeSim-d72f0914f3b7944fb97e3d242e3757b1d6388de0.tar.gz
eSim-d72f0914f3b7944fb97e3d242e3757b1d6388de0.tar.bz2
eSim-d72f0914f3b7944fb97e3d242e3757b1d6388de0.zip
Modified code to exclude voltage source of main circuit into subcircuit netlist
-rw-r--r--src/ngspicetoModelica/Mapping.json4
-rw-r--r--src/ngspicetoModelica/NgspicetoModelica.py11
2 files changed, 13 insertions, 2 deletions
diff --git a/src/ngspicetoModelica/Mapping.json b/src/ngspicetoModelica/Mapping.json
index 0387f303..3db10391 100644
--- a/src/ngspicetoModelica/Mapping.json
+++ b/src/ngspicetoModelica/Mapping.json
@@ -163,7 +163,9 @@
"f":"e-15",
"ma":"e-3",
"v":"",
- "V":""
+ "V":"",
+ "i":"",
+ "I":""
}
}
diff --git a/src/ngspicetoModelica/NgspicetoModelica.py b/src/ngspicetoModelica/NgspicetoModelica.py
index af926cdb..b512cfef 100644
--- a/src/ngspicetoModelica/NgspicetoModelica.py
+++ b/src/ngspicetoModelica/NgspicetoModelica.py
@@ -241,7 +241,7 @@ class NgMoConverter:
if str(valAfterDecimal)=='None':
pass
else:
- modifiedcompValue += valAfterDecimal
+ modifiedcompValue += '.'+valAfterDecimal
if str(unitValue)=='None':
pass
@@ -342,6 +342,10 @@ class NgMoConverter:
stat = self.mappingData["Sources"][sourceType]["dc"]+' '+compName+'(I='+self.getUnitVal(words[3])+');'
modelicaCompInit.append(stat)
+ #Now empty the source list as it may be used by subcircuit
+ self.sourceDetail[:] = []
+
+ print "Source Detail after processing-------->",self.sourceDetail
#Lets start for device
for eachline in self.deviceDetail:
@@ -508,6 +512,9 @@ class NgMoConverter:
stat += ",".join(str(item) for item in tempstatList)+");"
modelicaCompInit.append(stat)
+ #Empty device details as well
+ self.deviceDetail[:]=[]
+
#Lets start for inbuilt model of ngspice
for eachline in self.inbuiltModelDetail:
words=eachline.split()
@@ -539,6 +546,8 @@ class NgMoConverter:
stat += ",".join(str(item) for item in tempstatList)+");"
modelicaCompInit.append(stat)
+ #Empty inbuilt Model
+ self.inbuiltModelDetail[:] = []
#Lets start for Subcircuit
for eachline in self.subCktDetail: