##// END OF EJS Templates
Se comenta el retorno para evitar la interrupción del programa debido al uso del...
Se comenta el retorno para evitar la interrupción del programa debido al uso del header antiguo, en la ultima version de Signal Chain se genera un error

File last commit:

r716:4b81c4b32e79
r725:55bd4dcd7f84
Show More
controller_api.py
183 lines | 4.5 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
External plotter simplified.
r716 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):
plotterList = ['Scope',
'SpectraPlot', 'RTIPlot',
'CrossSpectraPlot', 'CoherenceMap',
'PowerProfilePlot', 'Noise', 'BeaconPhase',
'CorrelationPlot',
'SpectraHeisScope','RTIfromSpectraHeis']
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):
self.plotterQueue = Queue.Queue(10)
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)
#