summaryrefslogtreecommitdiff
path: root/src/projManagement
diff options
context:
space:
mode:
Diffstat (limited to 'src/projManagement')
-rw-r--r--src/projManagement/Kicad.py23
-rw-r--r--src/projManagement/Kicad.pycbin3134 -> 3583 bytes
-rw-r--r--src/projManagement/Worker.py9
-rw-r--r--src/projManagement/Worker.pycbin1648 -> 1870 bytes
4 files changed, 27 insertions, 5 deletions
diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py
index a80f6259..45721e31 100644
--- a/src/projManagement/Kicad.py
+++ b/src/projManagement/Kicad.py
@@ -11,9 +11,10 @@
# BUGS: ---
# NOTES: ---
# AUTHOR: Fahim Khan, fahim.elex@gmail.com
+# MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in
# ORGANIZATION: eSim team at FOSSEE, IIT Bombay.
-# CREATED: Tuesday 17 Feb 2015
-# REVISION: ---
+# CREATED: Tuesday 24 Feb 2015
+# REVISION: Thursday 3 Oct 2019
#===============================================================================
import os
@@ -30,7 +31,23 @@ class Kicad:
self.obj_validation = Validation.Validation()
self.obj_appconfig = Appconfig()
self.obj_dockarea= dockarea
+ self.obj_workThread = Worker.WorkerThread(None)
+ def check_open_schematic(self):
+ """
+ This function checks if any of the project's schematic is open or not
+ """
+ if self.obj_workThread:
+ procList = self.obj_workThread.get_proc_threads()[:]
+ if procList:
+ for proc in procList:
+ if proc.poll() is None:
+ return True
+ else:
+ self.obj_workThread.get_proc_threads().remove(proc)
+
+ return False
+
def openSchematic(self):
"""
This function create command to open Kicad schematic
@@ -50,7 +67,7 @@ class Kicad:
#Creating a command to run
self.cmd = "eeschema "+self.project+".sch "
- self.obj_workThread = Worker.WorkerThread(self.cmd)
+ self.obj_workThread.args = self.cmd
self.obj_workThread.start()
else:
diff --git a/src/projManagement/Kicad.pyc b/src/projManagement/Kicad.pyc
index 73b9f257..7f54ee39 100644
--- a/src/projManagement/Kicad.pyc
+++ b/src/projManagement/Kicad.pyc
Binary files differ
diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py
index 6befca65..d753a96d 100644
--- a/src/projManagement/Worker.py
+++ b/src/projManagement/Worker.py
@@ -11,9 +11,10 @@
# BUGS: ---
# NOTES: ---
# AUTHOR: Fahim Khan, fahim.elex@gmail.com
+# MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in
# ORGANIZATION: eSim team at FOSSEE, IIT Bombay.
# CREATED: Tuesday 24 Feb 2015
-# REVISION: ---
+# REVISION: Thursday 3 Oct 2019
#===============================================================================
from PyQt4 import QtCore
import subprocess
@@ -26,10 +27,13 @@ class WorkerThread(QtCore.QThread):
def __init__(self,args):
QtCore.QThread.__init__(self)
self.args = args
+ self.my_workers = []
-
def __del__(self):
self.wait()
+
+ def get_proc_threads(self):
+ return self.my_workers
def run(self):
print "Worker Thread Calling Command :",self.args
@@ -38,6 +42,7 @@ class WorkerThread(QtCore.QThread):
def call_system(self,command):
procThread = Appconfig()
proc = subprocess.Popen(command.split())
+ self.my_workers.append(proc)
procThread.procThread_list.append(proc)
procThread.proc_dict[procThread.current_project['ProjectName']].append(proc.pid)
diff --git a/src/projManagement/Worker.pyc b/src/projManagement/Worker.pyc
index 3744204d..35514f5c 100644
--- a/src/projManagement/Worker.pyc
+++ b/src/projManagement/Worker.pyc
Binary files differ