summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathulappadan2016-03-17 11:41:50 +0530
committerathulappadan2016-03-17 11:41:50 +0530
commiteba6e6ed7860256287a7490b90d2e00fa903cd41 (patch)
tree096720f51c6aff0015b4f92bf5fa7c5e41dfe5ce
parent47def6faede05c5056d8a9f000f5ae5f9e3da7b9 (diff)
downloadeSim-eba6e6ed7860256287a7490b90d2e00fa903cd41.tar.gz
eSim-eba6e6ed7860256287a7490b90d2e00fa903cd41.tar.bz2
eSim-eba6e6ed7860256287a7490b90d2e00fa903cd41.zip
Closes all external windows while closing a selected project
-rw-r--r--Examples/BJT_amplifier/plot_data_i.txt2
-rw-r--r--Examples/BJT_amplifier/plot_data_v.txt6
-rw-r--r--src/configuration/Appconfig.py3
-rwxr-xr-xsrc/frontEnd/Application.py2
-rw-r--r--src/frontEnd/ProjectExplorer.py4
-rw-r--r--src/ngspiceSimulation/NgspiceWidget.py1
-rw-r--r--src/projManagement/Worker.py3
7 files changed, 14 insertions, 7 deletions
diff --git a/Examples/BJT_amplifier/plot_data_i.txt b/Examples/BJT_amplifier/plot_data_i.txt
index 42af69af..629ffccf 100644
--- a/Examples/BJT_amplifier/plot_data_i.txt
+++ b/Examples/BJT_amplifier/plot_data_i.txt
@@ -1,5 +1,5 @@
* /home/fossee/esim-workspace/bjt_amplifier/bjt_amplifier.cir
- Transient Analysis Tue Mar 15 15:18:49 2016
+ Transient Analysis Thu Mar 17 11:22:37 2016
--------------------------------------------------------------------------------
Index time v1#branch v2#branch
--------------------------------------------------------------------------------
diff --git a/Examples/BJT_amplifier/plot_data_v.txt b/Examples/BJT_amplifier/plot_data_v.txt
index 7a3e4186..6f2807cd 100644
--- a/Examples/BJT_amplifier/plot_data_v.txt
+++ b/Examples/BJT_amplifier/plot_data_v.txt
@@ -1,5 +1,5 @@
* /home/fossee/esim-workspace/bjt_amplifier/bjt_amplifier.cir
- Transient Analysis Tue Mar 15 15:18:49 2016
+ Transient Analysis Thu Mar 17 11:22:37 2016
--------------------------------------------------------------------------------
Index time in net-_c1-pad1_ net-_c1-pad2_
--------------------------------------------------------------------------------
@@ -1064,7 +1064,7 @@ Index time in net-_c1-pad1_ net-_c1-pad2_
1007 1.000000e-02 -2.44929e-17 2.336157e-06 1.837271e+00
* /home/fossee/esim-workspace/bjt_amplifier/bjt_amplifier.cir
- Transient Analysis Tue Mar 15 15:18:49 2016
+ Transient Analysis Thu Mar 17 11:22:37 2016
--------------------------------------------------------------------------------
Index time net-_c2-pad2_ net-_c3-pad2_ net-_r2-pad1_
--------------------------------------------------------------------------------
@@ -2129,7 +2129,7 @@ Index time net-_c2-pad2_ net-_c3-pad2_ net-_r2-pad1_
1007 1.000000e-02 1.199900e+00 8.416406e+00 1.000000e+01
* /home/fossee/esim-workspace/bjt_amplifier/bjt_amplifier.cir
- Transient Analysis Tue Mar 15 15:18:49 2016
+ Transient Analysis Thu Mar 17 11:22:37 2016
--------------------------------------------------------------------------------
Index time out
--------------------------------------------------------------------------------
diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py
index 72510174..532091f7 100644
--- a/src/configuration/Appconfig.py
+++ b/src/configuration/Appconfig.py
@@ -38,6 +38,7 @@ class Appconfig(QtGui.QWidget):
#Workspace detail
workspace_text = '''eSim stores your project in a folder called a eSim-Workspace. You can choose a different workspace folder to use for this session.'''
procThread_list = []
+ proc_dict={}
dictPath = os.path.join(os.path.expanduser("~"), ".projectExplorer.txt")
noteArea = {}
try:
@@ -75,4 +76,4 @@ class Appconfig(QtGui.QWidget):
- \ No newline at end of file
+
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index 24e541c3..37fc6942 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -187,6 +187,8 @@ class Application(QtGui.QMainWindow):
if current_project==None:
pass
else:
+ for pid in self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']]:
+ os.kill(pid, 9)
self.obj_appconfig.current_project['ProjectName'] = None
self.systemTrayIcon.showMessage('Close', 'Current project '+os.path.basename(current_project)+' is Closed.')
diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py
index 6c96227a..e2091523 100644
--- a/src/frontEnd/ProjectExplorer.py
+++ b/src/frontEnd/ProjectExplorer.py
@@ -47,6 +47,7 @@ class ProjectExplorer(QtGui.QWidget):
parentnode = QtGui.QTreeWidgetItem(self.treewidget, [pathlist[-1], parents])
for files in children:
childnode = QtGui.QTreeWidgetItem(parentnode, [files, os.path.join(parents,files)])
+ self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']] = []
def openMenu(self, position):
@@ -102,6 +103,7 @@ class ProjectExplorer(QtGui.QWidget):
self.textwindow.show()
else:
self.obj_appconfig.current_project["ProjectName"]= str(self.filePath)
+ self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']] = []
def enable_save(self):
self.save.setEnabled(True)
@@ -139,4 +141,4 @@ class ProjectExplorer(QtGui.QWidget):
childnode= QtGui.QTreeWidgetItem(parentnode, [files, os.path.join(self.filePath,files)])
self.obj_appconfig.project_explorer[self.filePath]= filelistnew
- json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath,'w')) \ No newline at end of file
+ json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath,'w'))
diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py
index ee4dafe7..310cbe3c 100644
--- a/src/ngspiceSimulation/NgspiceWidget.py
+++ b/src/ngspiceSimulation/NgspiceWidget.py
@@ -24,6 +24,7 @@ class NgspiceWidget(QtGui.QWidget):
self.args = ['-hold','-e', self.command]
self.process.start('xterm', self.args)
self.obj_appconfig.process_obj.append(self.process)
+ self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']].append(self.process.pid())
elif platform.system() == 'Windows':
tempdir= os.getcwd()
diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py
index 9721f4a7..6befca65 100644
--- a/src/projManagement/Worker.py
+++ b/src/projManagement/Worker.py
@@ -39,7 +39,8 @@ class WorkerThread(QtCore.QThread):
procThread = Appconfig()
proc = subprocess.Popen(command.split())
procThread.procThread_list.append(proc)
+ procThread.proc_dict[procThread.current_project['ProjectName']].append(proc.pid)
- \ No newline at end of file
+