summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrahulp132020-04-29 18:34:57 +0530
committerrahulp132020-04-29 18:34:57 +0530
commit8f3947b842eaa95cd9784cfcaeed45f5e4e701e7 (patch)
tree913aff23979197f2c0f92cb64c24b3c58b046499 /src
parentf331a13221fc21607ed5e883fa349306e2c8b2a0 (diff)
downloadeSim-8f3947b842eaa95cd9784cfcaeed45f5e4e701e7.tar.gz
eSim-8f3947b842eaa95cd9784cfcaeed45f5e4e701e7.tar.bz2
eSim-8f3947b842eaa95cd9784cfcaeed45f5e4e701e7.zip
support for glob to load OM models
Diffstat (limited to 'src')
-rw-r--r--src/ngspicetoModelica/ModelicaUI.py30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/ngspicetoModelica/ModelicaUI.py b/src/ngspicetoModelica/ModelicaUI.py
index cd5cf03b..428bcab6 100644
--- a/src/ngspicetoModelica/ModelicaUI.py
+++ b/src/ngspicetoModelica/ModelicaUI.py
@@ -1,4 +1,5 @@
import os
+import glob
import traceback
from PyQt4 import QtGui, QtCore
from configuration.Appconfig import Appconfig
@@ -19,8 +20,7 @@ class OpenModelicaEditor(QtGui.QWidget):
self.projName = os.path.basename(self.projDir)
self.ngspiceNetlist = os.path.join(
self.projDir, self.projName + ".cir.out")
- self.modelicaNetlist = os.path.join(
- self.projDir, self.projName + ".mo")
+ self.modelicaNetlist = os.path.join(self.projDir, "*.mo")
self.map_json = Appconfig.modelica_map_json
self.grid = QtGui.QGridLayout()
@@ -96,28 +96,6 @@ class OpenModelicaEditor(QtGui.QWidget):
IfMOS = '1'
break
- subOptionInfo = []
- subSchemInfo = []
- if len(subcktName) > 0:
- # subOptionInfo = []
- # subSchemInfo = []
- for eachsub in subcktName:
- filename_temp = eachsub + '.sub'
- data = obj_NgMoConverter.readNetlist(filename_temp)
- # print "Data---------->",data
- subOptionInfo, subSchemInfo = (
- obj_NgMoConverter.separateNetlistInfo(data)
- )
- for eachline in subSchemInfo:
- # words = eachline.split()
- if eachline[0] == 'm':
- IfMOS = '1'
- break
- # print("Subcircuit OptionInfo :" +
- # "subOptionInfo------------------->", subOptionInfo)
- # print("Subcircuit Schematic Info :" +
- # "subSchemInfo-------------------->", subSchemInfo)
-
node, nodeDic, pinInit, pinProtectedInit = \
obj_NgMoConverter.nodeSeparate(
compInfo, '0', [], subcktName, []
@@ -233,7 +211,9 @@ class OpenModelicaEditor(QtGui.QWidget):
def callOMEdit(self):
if self.obj_validation.validateTool("OMEdit"):
- self.cmd2 = "OMEdit " + self.modelicaNetlist
+ modelFiles = glob.glob(self.modelicaNetlist)
+ modelFiles = ' '.join(file for file in modelFiles)
+ self.cmd2 = "OMEdit " + modelFiles
self.obj_workThread2 = Worker.WorkerThread(self.cmd2)
self.obj_workThread2.start()
print("OMEdit called")