diff options
author | Fahim | 2015-06-18 16:13:37 +0530 |
---|---|---|
committer | Fahim | 2015-06-18 16:13:37 +0530 |
commit | f47a744451fe634efb487023f073321ceed4664c (patch) | |
tree | f58df8c30dcc478dff4672884ec10a4b61056da2 | |
parent | 7dd5d060156177b0ee05c81c96c709767aca1989 (diff) | |
parent | 9f13750ffc4946177d7e22bed8b19e62ee76e502 (diff) | |
download | eSim-f47a744451fe634efb487023f073321ceed4664c.tar.gz eSim-f47a744451fe634efb487023f073321ceed4664c.tar.bz2 eSim-f47a744451fe634efb487023f073321ceed4664c.zip |
Merge pull request #33 from komalsheth236/master
Bug fixing for model editor and ngspicewidget for windows
-rw-r--r-- | src/modelEditor/ModelEditor.py | 9 | ||||
-rw-r--r-- | src/ngspiceSimulation/NgspiceWidget.py | 29 |
2 files changed, 24 insertions, 14 deletions
diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py index 99b69141..2cc9761c 100644 --- a/src/modelEditor/ModelEditor.py +++ b/src/modelEditor/ModelEditor.py @@ -84,6 +84,7 @@ class ModelEditorclass(QtGui.QWidget): def opennew(self): self.addbtn.setHidden(True) try: + self.removebtn.setHidden(True) self.modeltable.setHidden(True) except: pass @@ -230,8 +231,12 @@ class ModelEditorclass(QtGui.QWidget): self.igbt.setDisabled(True) self.bjt.setDisabled(True) self.magnetic.setDisabled(True) - self.editfile=str(QtGui.QFileDialog.getOpenFileName(self,"Open Library Directory","../deviceModelLibrary","*.lib")) - self.createtable(self.editfile) + try: + self.editfile=str(QtGui.QFileDialog.getOpenFileName(self,"Open Library Directory","../deviceModelLibrary","*.lib")) + self.createtable(self.editfile) + except: + print"no file selected" + pass '''Creates the model table by parsing th .xml file ''' def createtable(self, modelfile): diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index b4202720..f2ad973f 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,6 +1,7 @@ from PyQt4 import QtGui,QtCore from configuration.Appconfig import Appconfig -import platform
+import platform +import os class NgspiceWidget(QtGui.QWidget): """ @@ -13,15 +14,19 @@ class NgspiceWidget(QtGui.QWidget): self.terminal = QtGui.QWidget(self) self.layout = QtGui.QVBoxLayout(self) self.layout.addWidget(self.terminal) - print"command-------->", command
- if platform.system() == 'Linux':
- self.command = "cd "+projPath+";ngspice "+command
- #Creating argument for process
- self.args = ['-into', str(self.terminal.winId()),'-hold','-e', self.command]
- self.process.start('xterm', self.args)
-
- elif platform.system() == 'Windows':
- self.command = "ngspice "+command
- self.process.start(self.command)
-
+ print"command-------->", command + if platform.system() == 'Linux': + self.command = "cd "+projPath+";ngspice "+command + #Creating argument for process + self.args = ['-into', str(self.terminal.winId()),'-hold','-e', self.command] + self.process.start('xterm', self.args) + + elif platform.system() == 'Windows': + tempdir= os.getcwd() + projPath = self.obj_appconfig.current_project["ProjectName"] + os.chdir(projPath) + self.command = "ngspice "+command + self.process.start(self.command) + os.chdir(tempdir) + |