##// END OF EJS Templates
Add SkyMapPlotData, operation can access parent kwargs, fix server plot for multiple ReceiverData
Add SkyMapPlotData, operation can access parent kwargs, fix server plot for multiple ReceiverData

File last commit:

r827:7c8bc1e62102
r937:6cdcc42f2694
Show More
controller_api.py
178 lines | 4.3 KiB | text/x-python | PythonLexer
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636 import threading
Miguel Valdez
Version 2.2.5
r827 from Queue import Queue
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636
from schainpy.controller import Project
Miguel Valdez
External plotter simplified.
r716 from schainpy.model.graphics.jroplotter import PlotManager
Miguel Valdez
ControllerThread was eliminated from controller.py and it was added to controller_api.py
r636
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
Miguel Valdez
External plotter simplified.
r716 def setPlotters(self):
Miguel Valdez
minor changes
r736 plotterList = PlotManager.plotterList
Miguel Valdez
External plotter simplified.
r716
for thisPUConfObj in self.procUnitConfObjDict.values():
inputId = thisPUConfObj.getInputId()
if int(inputId) == 0:
continue
for thisOpObj in thisPUConfObj.getOperationObjList():
if thisOpObj.type == "self":
continue
if thisOpObj.name in plotterList:
thisOpObj.type = "plotter"
def setPlotterQueue(self, plotter_queue):
self.plotterQueue = plotter_queue
def getPlotterQueue(self):
return self.plotterQueue
def useExternalPlotter(self):
Miguel Valdez
Version 2.2.5
r827 self.plotterQueue = Queue(10)
Miguel Valdez
External plotter simplified.
r716 self.setPlotters()
plotManagerObj = PlotManager(self.plotterQueue)
plotManagerObj.setController(self)
return plotManagerObj
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)
#