summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/frontEnd/Application.py78
-rw-r--r--src/kicadtoNgspice/Analysis.py3
-rw-r--r--src/kicadtoNgspice/Processing.py6
-rw-r--r--src/ngspicetoModelica/ModelicaUI.py23
-rw-r--r--src/projManagement/openProject.py12
5 files changed, 43 insertions, 79 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index c0dddf51..ef8a4a7d 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -84,7 +84,8 @@ class Application(QtGui.QMainWindow):
self)
self.newproj.setShortcut('Ctrl+N')
self.newproj.triggered.connect(self.new_project)
- # self.newproj.connect(self.newproj,QtCore.SIGNAL('triggered()'),self,QtCore.SLOT(self.new_project()))
+ # self.newproj.connect(self.newproj, QtCore.SIGNAL('triggered()'),
+ # self, QtCore.SLOT(self.new_project()))
self.openproj = QtGui.QAction(
QtGui.QIcon('../../images/openProject.png'),
@@ -352,16 +353,18 @@ class Application(QtGui.QMainWindow):
self.obj_Mainview.obj_dockarea.plottingEditor()
except Exception as e:
self.msg = QtGui.QErrorMessage(None)
- self.msg.showMessage('Error while opening python plotting Editor.\
- Please look at console for more details ')
+ self.msg.showMessage(
+ 'Error while opening python plotting Editor.'
+ ' Please look at console for more details')
print("Exception Message:", str(e))
self.obj_appconfig.print_error('Exception Message : ' + str(e))
self.msg.setWindowTitle("Error Message")
else:
self.msg = QtGui.QErrorMessage()
- self.msg.showMessage('Please select the project first. You can either\
- create new project or open existing project')
+ self.msg.showMessage(
+ 'Please select the project first.'
+ ' You can either create new project or open existing project')
self.msg.setWindowTitle("Error Message")
# This function opens 'subcircuit' option in left-tool-bar.
@@ -433,51 +436,6 @@ 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:
@@ -516,14 +474,18 @@ class Application(QtGui.QMainWindow):
self.obj_workThread.start()
else:
self.msg = QtGui.QMessageBox()
- self.msgContent = "There was an error while opening OMOptim.<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.msgContent = (
+ "There was an error while opening OMOptim.<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 nightly 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("Error Message")
diff --git a/src/kicadtoNgspice/Analysis.py b/src/kicadtoNgspice/Analysis.py
index eaa46390..b24f24c7 100644
--- a/src/kicadtoNgspice/Analysis.py
+++ b/src/kicadtoNgspice/Analysis.py
@@ -577,7 +577,8 @@ class Analysis(QtGui.QWidget):
except BaseException:
self.track_obj.op_check.append('0')
- # QtCore.QObject.connect(check,SIGNAL("stateChanged()"),check,SLOT("checkedSlot"))
+ # QtCore.QObject.connect(check, SIGNAL("stateChanged()"), check,
+ # SLOT("checkedSlot"))
self.check.stateChanged.connect(self.setflag)
# self.flagcheck = 1
# self.flagcheck= 2
diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py
index 216383e6..a0f2c79f 100644
--- a/src/kicadtoNgspice/Processing.py
+++ b/src/kicadtoNgspice/Processing.py
@@ -471,9 +471,9 @@ class PrcocessNetlist:
schematicInfo.append(modelLine)
k = k + 1
# For iron core
- modelLine = "a" + str(k) + " (" + words[4] + " " + words[2] + ") \
- (interNode_" + str(
- interMediateNodeCount + 1) + " " + words[3] + ") "
+ modelLine = "a" + str(k) + " (" + words[4] + " " + \
+ words[2] + ") (interNode_" + \
+ str(interMediateNodeCount + 1) + " " + words[3] + ") "
modelLine += compName + "_secondary"
schematicInfo.append(modelLine)
k = k + 1
diff --git a/src/ngspicetoModelica/ModelicaUI.py b/src/ngspicetoModelica/ModelicaUI.py
index 80d43445..eca03534 100644
--- a/src/ngspicetoModelica/ModelicaUI.py
+++ b/src/ngspicetoModelica/ModelicaUI.py
@@ -107,17 +107,18 @@ class OpenModelicaEditor(QtGui.QWidget):
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.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 nightly 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")
diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py
index c1a56dbc..9c31bf31 100644
--- a/src/projManagement/openProject.py
+++ b/src/projManagement/openProject.py
@@ -74,12 +74,12 @@ class OpenProjectInfo(QtGui.QWidget):
"The project doesn't contain .proj file. Please select the"
+ "proper directory else you won't be able to perform any"
+ "operation")
- reply = QtGui.QMessageBox.critical(None, "Error Message",
- '''<b>Error: The project doesn't contain .proj file.</b><br/>
- <b>Please select the proper project directory else you won't
- be able to perform any operation</b>''',
- QtGui.QMessageBox.Ok |
- QtGui.QMessageBox.Cancel)
+ reply = QtGui.QMessageBox.critical(
+ None, "Error Message",
+ "<b>Error: The project doesn't contain .proj file.</b><br/>"
+ "<b>Please select the proper project directory else you won't"
+ " be able to perform any operation</b>",
+ QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)
if reply == QtGui.QMessageBox.Ok:
self.body()