summaryrefslogtreecommitdiff
path: root/src/frontEnd/Application.py
diff options
context:
space:
mode:
authorrahulp132019-12-18 16:35:32 +0530
committerrahulp132019-12-18 16:35:32 +0530
commit8843fd178992f82ea96478fe87cba80209af2ad8 (patch)
tree19abc5a7e04174f9029d412a5e9942066ebefe67 /src/frontEnd/Application.py
parent83d93769478a1805083666479d4ff83b875ba955 (diff)
downloadeSim-8843fd178992f82ea96478fe87cba80209af2ad8.tar.gz
eSim-8843fd178992f82ea96478fe87cba80209af2ad8.tar.bz2
eSim-8843fd178992f82ea96478fe87cba80209af2ad8.zip
restored OMEdit code, trigger for rename_project
Diffstat (limited to 'src/frontEnd/Application.py')
-rw-r--r--src/frontEnd/Application.py51
1 files changed, 48 insertions, 3 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index 4f77a321..8973501d 100644
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -1,5 +1,4 @@
# =========================================================================
-#
# FILE: Application.py
#
# USAGE: ---
@@ -11,10 +10,13 @@
# BUGS: ---
# NOTES: ---
# AUTHOR: Fahim Khan, fahim.elex@gmail.com
+# MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in
# ORGANIZATION: eSim team at FOSSEE, IIT Bombay.
-# CREATED: Wednesday 21 January 2015
-# REVISION: ---
+# CREATED: Tuesday 24 Feb 2015
+# REVISION: Wednesday 18 Dec 2019
# =========================================================================
+
+
import pathmagic # noqa
from PyQt4 import QtGui, QtCore
from configuration.Appconfig import Appconfig
@@ -437,6 +439,49 @@ class Application(QtGui.QMainWindow):
self.modelicaNetlist = os.path.join(
self.projDir, self.projName + ".mo")
+ """
+ try:
+ # Creating a command for Ngspice to Modelica converter
+ self.cmd1 = "
+ python3 ../ngspicetoModelica/NgspicetoModelica.py "\
+ +self.ngspiceNetlist
+ self.obj_workThread1 = Worker.WorkerThread(self.cmd1)
+ self.obj_workThread1.start()
+ if self.obj_validation.validateTool("OMEdit"):
+ # Creating command to run OMEdit
+ self.cmd2 = "OMEdit "+self.modelicaNetlist
+ self.obj_workThread2 = Worker.WorkerThread(self.cmd2)
+ self.obj_workThread2.start()
+ else:
+ self.msg = QtGui.QMessageBox()
+ self.msgContent = "There was an error while
+ opening OMEdit.<br/>\
+ Please make sure OpenModelica is installed in your\
+ system. <br/>\
+ To install it on Linux : Go to\
+ <a href=https://www.openmodelica.org/download/\
+ download-linux>OpenModelica Linux</a> and \
+ install nigthly build release.<br/>\
+ To install it on Windows : Go to\
+ <a href=https://www.openmodelica.org/download/\
+ download-windows>OpenModelica Windows</a>\
+ and install latest version.<br/>"
+ self.msg.setTextFormat(QtCore.Qt.RichText)
+ self.msg.setText(self.msgContent)
+ self.msg.setWindowTitle("Missing OpenModelica")
+ self.obj_appconfig.print_info(self.msgContent)
+ self.msg.exec_()
+
+ except Exception as e:
+ self.msg = QtGui.QErrorMessage()
+ self.msg.showMessage(
+ 'Unable to convert NgSpice netlist to\
+ Modelica netlist :'+str(e))
+ self.msg.setWindowTitle(
+ "Ngspice to Modelica conversion error")
+ self.obj_appconfig.print_error(str(e))
+ """
+
self.obj_Mainview.obj_dockarea.modelicaEditor(self.projDir)
else: