def nonBlockingSleep(self, stime): """Sleep for given number of seconds (~50mS resolution), but don't block GUI while we do it""" timer.Timer().singleShot(stime * 1000, self.nonblockingSleep_done) self._sleeping = True while(self._sleeping): time.sleep(0.01) util.updateUI()
def __init__(self): ReaderTemplate.__init__(self) self.timeoutTimer = timer.Timer() self.timeoutTimer.timeout.connect(self.timeoutFired) self.timeoutTimer.setInterval(2000) self.getParams().addChildren([ {'name':'Keep-Alive Interval (off=0)', 'type':'int', 'value':2, 'set':self.setKeepalive} ])
def __init__(self): self.dataUpdated = util.Signal() self.offset = 0.5 self.ser = None self.sc = None self.parm_hwinfo = None self.parm_gain = None self.parm_trigger = None self.parm_clock = None self.datapoints = [] self.timerStatusRefresh = timer.Timer() self.timerStatusRefresh.timeout.connect(self.statusRefresh)
def autoScriptInit(self): self.clearStatements() self.updateDelayTimer = timer.Timer() self.updateDelayTimer.timeout.connect(self.scriptsUpdated.emit) self.updateDelayTimer.setSingleShot(True) self.updateDelayTimer.setInterval(500)