Пример #1
0
class PulseEmulator(object):
    '''
    Simulate pulses at some period. Just a convenience wrapper for
    psychopy.hardware.emulator.SynchGenerator.
    '''
    def __init__(self, *args, **kwargs):
        '''Initialise a PulseEmulator instance. All arguments are passed to
        SynchGenerator.'''
        self.pulsehand = SyncGenerator(*args, **kwargs)
        return

    def start(self):
        '''Start sending pulses.'''
        self.pulsehand.start()
        psychopy.core.runningThreads.append(self.pulsehand)
        return

    def stop(self):
        '''Stop sending pulses.'''
        self.pulsehand.stop()
        return