summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul P2022-01-27 12:27:35 +0530
committerGitHub2022-01-27 12:27:35 +0530
commitfd42aac203c874ae49fa36c0334686762aea6d0b (patch)
treec7d3b5e0fd390cff553493d7f3f0bcc237019ac2
parent976f6ac9be6017cfe2d9849cd0089d6cdbaad4cf (diff)
parent44119c3a384e47e7848930172ef01b355cd25ad7 (diff)
downloadeSim-fd42aac203c874ae49fa36c0334686762aea6d0b.tar.gz
eSim-fd42aac203c874ae49fa36c0334686762aea6d0b.tar.bz2
eSim-fd42aac203c874ae49fa36c0334686762aea6d0b.zip
Merge pull request #177 from Eyantra698Sumanto/om-search
OM Search Options
-rwxr-xr-x[-rw-r--r--]src/ngspicetoModelica/ModelicaUI.py28
-rwxr-xr-x[-rw-r--r--]src/ngspicetoModelica/NgspicetoModelica.py2
-rwxr-xr-x[-rw-r--r--]src/ngspicetoModelica/__init__.py0
3 files changed, 25 insertions, 5 deletions
diff --git a/src/ngspicetoModelica/ModelicaUI.py b/src/ngspicetoModelica/ModelicaUI.py
index 6cd736b7..a687bb93 100644..100755
--- a/src/ngspicetoModelica/ModelicaUI.py
+++ b/src/ngspicetoModelica/ModelicaUI.py
@@ -28,7 +28,7 @@ class OpenModelicaEditor(QtWidgets.QWidget):
self.FileEdit.setText(self.ngspiceNetlist)
self.grid.addWidget(self.FileEdit, 0, 0)
- self.browsebtn = QtWidgets.QPushButton("Browse")
+ self.browsebtn = QtWidgets.QPushButton("Browse Netlist (*.cir.out)")
self.browsebtn.clicked.connect(self.browseFile)
self.grid.addWidget(self.browsebtn, 0, 1)
@@ -40,10 +40,29 @@ class OpenModelicaEditor(QtWidgets.QWidget):
self.loadOMbtn.clicked.connect(self.callOMEdit)
self.grid.addWidget(self.loadOMbtn, 3, 1)
+ self.OMPathtext = QtWidgets.QLineEdit()
+ self.OMPathtext.setText("")
+ self.grid.addWidget(self.OMPathtext, 4, 0)
+
+ self.OMPathbrowsebtn = QtWidgets.QPushButton("Browse OM")
+ self.OMPathbrowsebtn.clicked.connect(self.OMPathbrowseFile)
+ self.grid.addWidget(self.OMPathbrowsebtn, 4, 1)
+
# self.setGeometry(300, 300, 350, 300)
self.setLayout(self.grid)
self.show()
+ def OMPathbrowseFile(self):
+ temp = QtCore.QDir.toNativeSeparators(
+ QtWidgets.QFileDialog.getExistingDirectory(
+ self, "Open OpenModelica Directory", "home"
+ )
+ )
+
+ if temp:
+ self.OMPath = temp
+ self.OMPathtext.setText(self.OMPath)
+
def browseFile(self):
temp = QtCore.QDir.toNativeSeparators(
QtWidgets.QFileDialog.getOpenFileName(
@@ -216,16 +235,17 @@ class OpenModelicaEditor(QtWidgets.QWidget):
def callOMEdit(self):
- if self.obj_validation.validateTool("OMEdit"):
+ try:
modelFiles = glob.glob(self.modelicaNetlist)
modelFiles = ' '.join(file for file in modelFiles)
- self.cmd2 = "OMEdit " + modelFiles
+ self.cmd2 = self.OMPath+"/OMEdit " + modelFiles
+ print(self.cmd2)
self.obj_workThread2 = Worker.WorkerThread(self.cmd2)
self.obj_workThread2.start()
print("OMEdit called")
self.obj_appconfig.print_info("OMEdit called")
- else:
+ except BaseException:
self.msg = QtWidgets.QMessageBox()
self.msgContent = (
"There was an error while opening OMEdit.<br/>"
diff --git a/src/ngspicetoModelica/NgspicetoModelica.py b/src/ngspicetoModelica/NgspicetoModelica.py
index 4df65c8d..6951e3c8 100644..100755
--- a/src/ngspicetoModelica/NgspicetoModelica.py
+++ b/src/ngspicetoModelica/NgspicetoModelica.py
@@ -344,7 +344,7 @@ class NgMoConverter:
stat = self.mappingData["Sources"][sourceType][typ[0]] +\
' ' + compName + '(offset = ' +\
self.getUnitVal(typ[1]) +\
- ', V = ' + self.getUnitVal(words[4]) + ', freqHz = ' +\
+ ', V = ' + self.getUnitVal(words[4]) + ', f = ' +\
self.getUnitVal(words[5]) + ', startTime = ' +\
self.getUnitVal(words[6]) + ', phase = ' +\
self.getUnitVal(theta[0]) + ');'
diff --git a/src/ngspicetoModelica/__init__.py b/src/ngspicetoModelica/__init__.py
index e69de29b..e69de29b 100644..100755
--- a/src/ngspicetoModelica/__init__.py
+++ b/src/ngspicetoModelica/__init__.py