def __init__(self, exp, parentName, name='ptc_init', id=0, datafile='data.tsv', embed=False): super(ptc_init_component, self).__init__(exp, parentName, name) self.type = 'ptc_init' self.url = 'https://github.com/hsogo/psychopy_tobii_controller/' #params self.order = [ 'name' ] + paramNames[:] # want a copy, else codeParamNames list gets mutated self.params['id'] = Param(id, valType='code', allowedTypes=[], updates='constant', allowedUpdates=[], hint='ID of Tobii eyetracker (0, 1, 2, ...)', label='Tobii eyetracker ID') self.params['datafile'] = Param( datafile, valType='str', allowedTypes=[], updates='constant', allowedUpdates=[], hint='Name of tobii_controller data file.', label='Tobii_controller Data File') self.params['embed'] = Param( embed, valType='bool', allowedTypes=[], updates='constant', allowedUpdates=[], hint='If checked, event data is embeded into gaze data.', label='Embed event', categ='Advanced') # these inherited params are harmless but might as well trim: for p in [ 'startType', 'startVal', 'startEstim', 'stopVal', 'stopType', 'durationEstim' ]: del self.params[p] for p in [ 'color', 'opacity', 'colorSpace', 'pos', 'size', 'ori', 'units' ]: del self.params[p]
def __init__(self, exp, parentName, name='ptc_getpos', filler=-10000, binocular='Average'): super(ptc_getpos_component, self).__init__(exp, parentName, name) self.type = 'ptc_getpos' self.url = 'https://github.com/hsogo/psychopy_tobii_controller/' #params self.order = [ 'name' ] + paramNames[:] # want a copy, else codeParamNames list gets mutated self.params['filler'] = Param( filler, valType='code', allowedTypes=[], updates='constant', allowedUpdates=[], hint= 'If gaze position is not available, gaze position is filled by this value.', label='Filler') self.params['binocular'] = Param( binocular, valType='str', allowedTypes=[], allowedVals=['Average', 'LR'], updates='constant', allowedUpdates=[], hint= 'Average: (average_x, average_y) LR: {\'left\':(left_x, left_y), \'right\':(right_x, right_y)}', label='Binocular Data') # these inherited params are harmless but might as well trim: for p in [ 'startType', 'startVal', 'startEstim', 'stopVal', 'stopType', 'durationEstim' ]: del self.params[p] for p in [ 'color', 'opacity', 'colorSpace', 'pos', 'size', 'ori', 'units' ]: del self.params[p]
def __init__(self, exp, parentName, name='ptc_rec', start_msg='', stop_msg=''): super(ptc_rec_component, self).__init__(exp, parentName, name) self.type = 'ptc_rec' self.url = 'https://github.com/hsogo/psychopy_tobii_controller/' #params self.order = [ 'name' ] + paramNames[:] # want a copy, else codeParamNames list gets mutated self.params['start_msg'] = Param( start_msg, valType='str', allowedTypes=[], updates='constant', allowedUpdates=['constant', 'set every repeat'], hint='This text is inserted at the beginning of the recording.', label='Event (start)', categ='Advanced') self.params['stop_msg'] = Param( stop_msg, valType='str', allowedTypes=[], updates='constant', allowedUpdates=['constant', 'set every repeat'], hint='This text is inserted at the end of the recording.', label='Event (stop)', categ='Advanced') # these inherited params are harmless but might as well trim: for p in [ 'startType', 'startVal', 'startEstim', 'stopVal', 'stopType', 'durationEstim' ]: del self.params[p] for p in [ 'color', 'opacity', 'colorSpace', 'pos', 'size', 'ori', 'units' ]: del self.params[p]
def __init__(self, exp, parentName, name='ptc_message', time=0, timeType='time (s)', text='event'): super(ptc_message_component, self).__init__(exp, parentName, name) self.type='ptc_message' self.url='https://github.com/hsogo/psychopy_tobii_controller/' #params self.order = ['name'] + paramNames[:] # want a copy, else codeParamNames list gets mutated self.params['time']=Param(time, valType='code', allowedTypes=[], updates='constant', allowedUpdates=[], hint='When this event should be recorded?', label='time') self.params['timeType']=Param(timeType, valType='str', allowedVals=['time (s)', 'frame N', 'condition'], updates='constant', allowedUpdates=[], hint='How do you want to define time?', label='time type') self.params['text']=Param(text, valType='str', allowedTypes=[], updates='constant', allowedUpdates=[], hint='Event text', label='Event') # these inherited params are harmless but might as well trim: for p in ['startType', 'startVal', 'startEstim', 'stopVal', 'stopType', 'durationEstim']: del self.params[p]
def __init__(self, exp, parentName, name='ptc_cal', show_status=True, calibration_points=[[-0.4, -0.4], [0.4, -0.4], [0, 0], [-0.4, 0.4], [0.4, 0.4]], shuffle=True, enable_mouse=False, start_key='space', decision_key='space', text_color='white', move_duration=1.5): super(ptc_cal_component, self).__init__(exp, parentName, name) self.type = 'ptc_cal' self.url = 'https://github.com/hsogo/psychopy_tobii_controller/' #params self.order = [ 'name' ] + paramNames[:] # want a copy, else codeParamNames list gets mutated self.params['show_status'] = Param( show_status, valType='bool', allowedTypes=[], updates='constant', allowedUpdates=[], hint='Show Tobii status before calibration', label='Show status') self.params['calibration_points'] = Param( calibration_points, valType='code', allowedTypes=[], updates='constant', allowedUpdates=[], hint='List of calibration points', label='Calibration points') self.params['shuffle'] = Param( shuffle, valType='bool', allowedTypes=[], updates='constant', allowedUpdates=[], hint='If checked, order of calibration points is randomized.', label='Shuffle') self.params['enable_mouse'] = Param( enable_mouse, valType='bool', allowedTypes=[], updates='constant', allowedUpdates=[], hint='If checked, mouse operation is enabled.', label='Enable mouse operation', categ='Advanced') self.params['start_key'] = Param( start_key, valType='str', allowedTypes=[], updates='constant', allowedUpdates=[], hint='Name of the key that is used to start calibration procedure.', label='Start key', categ='Advanced') self.params['decision_key'] = Param( decision_key, valType='str', allowedTypes=[], updates='constant', allowedUpdates=[], hint= 'Name of the key that is used to decide accept/retry calibration.', label='Decision key', categ='Advanced') self.params['text_color'] = Param(text_color, valType='str', allowedTypes=[], updates='constant', allowedUpdates=[], hint='Text color', label='Text color', categ='Advanced') self.params['move_duration'] = Param(move_duration, valType='code', allowedTypes=[], updates='constant', allowedUpdates=[], hint='Motion duration', label='Motion duration', categ='Advanced') # these inherited params are harmless but might as well trim: for p in [ 'startType', 'startVal', 'startEstim', 'stopVal', 'stopType', 'durationEstim' ]: del self.params[p]