##// END OF EJS Templates
GUI: minor changes
GUI: minor changes

File last commit:

r708:e5ce72bc2207
r715:ba4eb5416278
Show More
controller_api.py
139 lines | 3.2 KiB | text/x-python | PythonLexer
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636 import threading
from schainpy.controller import Project
class ControllerThread(threading.Thread, Project):
Miguel Valdez
v2.2.0: Controller updated
r708 def __init__(self, plotter_queue=None):
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636
threading.Thread.__init__(self)
Miguel Valdez
v2.2.0: Controller updated
r708 Project.__init__(self, plotter_queue)
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636
self.setDaemon(True)
Miguel Valdez
Version: 2.1.3.2...
r672 self.lock = threading.Lock()
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636 self.control = {'stop':False, 'pause':False}
def __del__(self):
self.control['stop'] = True
def stop(self):
Miguel Valdez
Version: 2.1.3.2...
r672
self.lock.acquire()
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636 self.control['stop'] = True
Miguel Valdez
Version: 2.1.3.2...
r672 self.lock.release()
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636 def pause(self):
Miguel Valdez
Version: 2.1.3.2...
r672
self.lock.acquire()
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636 self.control['pause'] = not(self.control['pause'])
Miguel Valdez
Version: 2.1.3.2...
r672 paused = self.control['pause']
self.lock.release()
Miguel Valdez
GUI: Every icon were resized
r668
Miguel Valdez
Version: 2.1.3.2...
r672 return paused
Miguel Valdez
GUI: Every icon were resized
r668
Miguel Valdez
Version: 2.1.3.2...
r672 def isPaused(self):
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636
Miguel Valdez
Version: 2.1.3.2...
r672 self.lock.acquire()
paused = self.control['pause']
self.lock.release()
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636
Miguel Valdez
Version: 2.1.3.2...
r672 return paused
def isStopped(self):
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636
Miguel Valdez
Version: 2.1.3.2...
r672 self.lock.acquire()
stopped = self.control['stop']
self.lock.release()
return stopped
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636 def run(self):
self.control['stop'] = False
self.control['pause'] = False
Miguel Valdez
v2.2.0: Controller updated
r708 self.writeXml()
Miguel Valdez
Bug fixed in controller_api.py: reading xml file but not writing
r695
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636 self.createObjects()
self.connectObjects()
Project.run(self)
def isRunning(self):
return self.is_alive()
def isFinished(self):
return not self.is_alive()
Miguel Valdez
r681
# from PyQt4 import QtCore
# from PyQt4.QtCore import SIGNAL
#
# class ControllerQThread(QtCore.QThread, Project):
#
# def __init__(self, filename):
#
# QtCore.QThread.__init__(self)
# Project.__init__(self)
#
# self.filename = filename
#
# self.lock = threading.Lock()
# self.control = {'stop':False, 'pause':False}
#
# def __del__(self):
#
# self.control['stop'] = True
# self.wait()
#
# def stop(self):
#
# self.lock.acquire()
#
# self.control['stop'] = True
#
# self.lock.release()
#
# def pause(self):
#
# self.lock.acquire()
#
# self.control['pause'] = not(self.control['pause'])
# paused = self.control['pause']
#
# self.lock.release()
#
# return paused
#
# def isPaused(self):
#
# self.lock.acquire()
# paused = self.control['pause']
# self.lock.release()
#
# return paused
#
# def isStopped(self):
#
# self.lock.acquire()
# stopped = self.control['stop']
# self.lock.release()
#
# return stopped
#
# def run(self):
#
# self.control['stop'] = False
# self.control['pause'] = False
#
# self.readXml(self.filename)
# self.createObjects()
# self.connectObjects()
# self.emit( SIGNAL( "jobStarted( PyQt_PyObject )" ), 1)
# Project.run(self)
# self.emit( SIGNAL( "jobFinished( PyQt_PyObject )" ), 1)
#