def _setup_mri(self): """ Initializes an MRI simulator """ args = self.settings['mri'].copy() self.mri_trigger = self.settings['mri']['sync'] if args['simulate']: args.pop('simulate') return SyncGenerator(**args) else: return None
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
def _setup_mri_simulator(self): args = self.settings['mri'].copy() args.pop('simulate') return SyncGenerator(**args)
def _setup_mri_simulator(self): """ Initializes an MRI simulator (if 'mri' in settings). """ args = self.settings['mri'].copy() args.pop('simulate') self.mri_trigger = self.settings['mri']['sync'] return SyncGenerator(**args)
def __init__(self, *args, **kwargs): '''Initialise a PulseEmulator instance. All arguments are passed to SynchGenerator.''' self.pulsehand = SyncGenerator(*args, **kwargs) return