Example #1
0
    def __init__(
            self,
            exp,
            parentName,
            name='etRecord',
            startType='time (s)',
            startVal=0.0,
            stopType='duration (s)',
            stopVal=1.0,
            startEstim='',
            durationEstim='',
            actionType="Start and Stop",
            #legacy
            save='final',
            configFile='myTracker.yaml'):
        BaseComponent.__init__(self,
                               exp,
                               parentName,
                               name=name,
                               startType=startType,
                               startVal=startVal,
                               stopType=stopType,
                               stopVal=stopVal,
                               startEstim=startEstim,
                               durationEstim=durationEstim)
        self.type = 'EyetrackerRecord'
        self.url = "https://www.psychopy.org/builder/components/eyetracker.html"
        self.exp.requirePsychopyLibs(['iohub', 'hardware'])

        self.params['actionType'] = Param(
            actionType,
            valType='str',
            inputType='choice',
            categ='Basic',
            allowedVals=["Start and Stop", "Start Only", "Stop Only"],
            hint=_translate(
                "Should this component start and / or stop eye tracker recording?"
            ),
            label=_translate("Record Actions"))

        self.depends.append({
            "dependsOn": "actionType",  # must be param name
            "condition": "=='Start Only'",  # val to check for
            "param": "stop",  # param property to alter
            "true": "hide",  # what to do with param if condition is True
            "false": "show",  # permitted: hide, show, enable, disable
        })

        self.depends.append({
            "dependsOn": "actionType",  # must be param name
            "condition": "=='Stop Only'",  # val to check for
            "param": "start",  # param property to alter
            "true": "hide",  # what to do with param if condition is True
            "false": "show",  # permitted: hide, show, enable, disable
        })

        # TODO: Display actionType control after component name.
        #       Currently, adding params before start / stop time
        #       in .order has no effect
        self.order = self.order[:1] + ['actionType'] + self.order[1:]
Example #2
0
 def __init__(
         self,
         exp,
         parentName,
         name='etRecord',
         startType='time (s)',
         startVal=0.0,
         stopType='duration (s)',
         stopVal=1.0,
         startEstim='',
         durationEstim='',
         #legacy
         save='final',
         configFile='myTracker.yaml'):
     BaseComponent.__init__(self,
                            exp,
                            parentName,
                            name=name,
                            startType=startType,
                            startVal=startVal,
                            stopType=stopType,
                            stopVal=stopVal,
                            startEstim=startEstim,
                            durationEstim=durationEstim)
     self.type = 'EyetrackerRecord'
     self.url = "https://www.psychopy.org/builder/components/eyetracker.html"
     self.exp.requirePsychopyLibs(['iohub', 'hardware'])
Example #3
0
    def __init__(self,
                 exp,
                 parentName,
                 name='ISI',
                 startType='time (s)',
                 startVal=0.0,
                 stopType='duration (s)',
                 stopVal=0.5,
                 startEstim='',
                 durationEstim=''):
        BaseComponent.__init__(self, exp, parentName, name=name)
        self.updatesList = []  # a list of dicts {compParams, fieldName}
        self.type = 'Static'
        self.url = "http://www.psychopy.org/builder/components/static.html"
        hnt = _translate(
            "Custom code to be run during the static period (after updates)")
        self.params['code'] = Param("",
                                    valType='code',
                                    hint=hnt,
                                    label=_localized['Custom code'])
        self.order = ['name']  # make name come first (others don't matter)

        hnt = _translate("How do you want to define your start point?")
        self.params['startType'] = Param(startType,
                                         valType='str',
                                         allowedVals=['time (s)', 'frame N'],
                                         hint=hnt)
        hnt = _translate("How do you want to define your end point?")
        _allow = ['duration (s)', 'duration (frames)', 'time (s)', 'frame N']
        self.params['stopType'] = Param(
            stopType,
            valType='str',
            allowedVals=_allow,  # copy not needed
            hint=hnt)
        hnt = _translate("When does the component start?")
        self.params['startVal'] = Param(startVal,
                                        valType='code',
                                        allowedTypes=[],
                                        hint=hnt)
        hnt = _translate("When does the component end? (blank is endless)")
        self.params['stopVal'] = Param(stopVal,
                                       valType='code',
                                       allowedTypes=[],
                                       updates='constant',
                                       allowedUpdates=[],
                                       hint=hnt)
        hnt = _translate("(Optional) expected start (s), purely for "
                         "representing in the timeline")
        self.params['startEstim'] = Param(startEstim,
                                          valType='code',
                                          allowedTypes=[],
                                          hint=hnt)
        hnt = _translate("(Optional) expected duration (s), purely for "
                         "representing in the timeline")
        self.params['durationEstim'] = Param(durationEstim,
                                             valType='code',
                                             allowedTypes=[],
                                             hint=hnt)
Example #4
0
 def __init__(self, exp, parentName, name='ISI',
              startType='time (s)', startVal=0.0,
              stopType='duration (s)', stopVal=0.5,
              startEstim='', durationEstim=''):
     BaseComponent.__init__(self, exp, parentName, name=name)
     self.updatesList = []  # a list of dicts {compParams, fieldName}
     self.type = 'Static'
     self.url = "https://www.psychopy.org/builder/components/static.html"
     hnt = _translate(
         "Custom code to be run during the static period (after updates)")
     self.params['code'] = Param("", valType='code', inputType="multi", categ='Custom',
                                 hint=hnt,
                                 label=_localized['Custom code'])
Example #5
0
    def __init__(self, exp, parentName, name='ISI',
                 startType='time (s)', startVal=0.0,
                 stopType='duration (s)', stopVal=0.5,
                 startEstim='', durationEstim=''):
        BaseComponent.__init__(self, exp, parentName, name=name)
        self.updatesList = []  # a list of dicts {compParams, fieldName}
        self.type = 'Static'
        self.url = "http://www.psychopy.org/builder/components/static.html"
        hnt = _translate(
            "Custom code to be run during the static period (after updates)")
        self.params['code'] = Param("", valType='code',
                                    hint=hnt,
                                    label=_localized['Custom code'])
        self.order = ['name']  # make name come first (others don't matter)

        hnt = _translate("How do you want to define your start point?")
        self.params['startType'] = Param(startType, valType='str',
                                         allowedVals=['time (s)', 'frame N'],
                                         hint=hnt)
        hnt = _translate("How do you want to define your end point?")
        _allow = ['duration (s)', 'duration (frames)', 'time (s)', 'frame N']
        self.params['stopType'] = Param(stopType, valType='str',
                                        allowedVals=_allow,  # copy not needed
                                        hint=hnt)
        hnt = _translate("When does the component start?")
        self.params['startVal'] = Param(startVal, valType='code',
                                        allowedTypes=[],
                                        hint=hnt)
        hnt = _translate("When does the component end? (blank is endless)")
        self.params['stopVal'] = Param(stopVal, valType='code',
                                       allowedTypes=[],
                                       updates='constant', allowedUpdates=[],
                                       hint=hnt)
        hnt = _translate("(Optional) expected start (s), purely for "
                         "representing in the timeline")
        self.params['startEstim'] = Param(startEstim, valType='code',
                                          allowedTypes=[],
                                          hint=hnt)
        hnt = _translate("(Optional) expected duration (s), purely for "
                         "representing in the timeline")
        self.params['durationEstim'] = Param(durationEstim, valType='code',
                                             allowedTypes=[],
                                             hint=hnt)