Esempio n. 1
0
    def __init__(self, num_threads, max_queue=20):
        QtCore.QObject.__init__(self)
        self.__threads = []
        self.__started = False
        self.__max_queue = max_queue
        self.__num_threads = num_threads

        self._q_mutex = QtCore.QMutex()
        self._q_empty = QtCore.QWaitCondition()
        self._q_queue = []
    def startTicksUpdate(self,
                         updateInterval,
                         updateWhenMinimized=False,
                         maxUpdateInterval=None):
        """A method of updating the display on a one second timer to avoid
        multiple update requests and reduce excess cuebot calls.
        You will need to implement self.tick, You do not need to provide
        locking or unhandled error logging.
        You will need to implement tick.
        self.ticksWithoutUpdate = number of seconds since the last update.
        self.ticksLock = QMutex"""
        self.updateInterval = updateInterval
        self.__updateWhenMinimized = updateWhenMinimized
        self.__maxUpdateInterval = maxUpdateInterval

        # Stop the default update method
        if hasattr(self, "_timer"):
            self._timer.stop()

        self.ticksLock = QtCore.QMutex()
        self.__ticksTimer = QtCore.QTimer(self)
        self.__ticksTimer.timeout.connect(self.__tick)
        self.__ticksTimer.start(1000)
        self.ticksWithoutUpdate = 999