diff options
author | Eyantra698Sumanto | 2022-01-11 15:30:23 +0530 |
---|---|---|
committer | Eyantra698Sumanto | 2022-01-25 19:10:05 +0530 |
commit | c19d2338775920f02dc86c2463879517d6c95825 (patch) | |
tree | 21a5f6bf7d38ee598f6df097be88bce8d3e9de02 /src | |
parent | 840090d0eedac3c60026269f50f9bb8365e4801b (diff) | |
download | eSim-c19d2338775920f02dc86c2463879517d6c95825.tar.gz eSim-c19d2338775920f02dc86c2463879517d6c95825.tar.bz2 eSim-c19d2338775920f02dc86c2463879517d6c95825.zip |
Adding search option for OpenModelica
Diffstat (limited to 'src')
-rwxr-xr-x[-rw-r--r--] | src/ngspicetoModelica/ModelicaUI.py | 31 | ||||
-rwxr-xr-x[-rw-r--r--] | src/ngspicetoModelica/NgspicetoModelica.py | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | src/ngspicetoModelica/__init__.py | 0 |
3 files changed, 27 insertions, 6 deletions
diff --git a/src/ngspicetoModelica/ModelicaUI.py b/src/ngspicetoModelica/ModelicaUI.py index 6cd736b7..ecf15bd2 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 .cir.out") self.browsebtn.clicked.connect(self.browseFile) self.grid.addWidget(self.browsebtn, 0, 1) @@ -40,10 +40,30 @@ 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 Open Modelica Directory", "home" + ) + ) + + if temp: + self.OMPath = temp + self.OMPathtext.setText(self.OMPath) + def browseFile(self): temp = QtCore.QDir.toNativeSeparators( QtWidgets.QFileDialog.getOpenFileName( @@ -215,17 +235,18 @@ 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 |