Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builder 'Aperture' component cannot have indefinite duration #1122

Closed
m-macaskill opened this issue Feb 23, 2016 · 0 comments
Closed

Builder 'Aperture' component cannot have indefinite duration #1122

m-macaskill opened this issue Feb 23, 2016 · 0 comments
Assignees

Comments

@m-macaskill
Copy link
Contributor

If a Builder 'Aperture' component is set to have an indefinite duration, the actual result is that it is enabled and then immediately disabled. Hence, it has no effect on other stimuli. Below is example code that gets generated when an indefinite duration is specified:

# *aperture* updates
if t >= 0.0 and aperture.status == NOT_STARTED:
    # keep track of start time/frame for later
    aperture.tStart = t  # underestimates by a little under one frame
    aperture.frameNStart = frameN  # exact frame index
    aperture.enabled = True
if aperture.status == STARTED and t >= (0.0 + (-win.monitorFramePeriod*0.75)): #most of one frame period left
    aperture.enabled = False
if aperture.status == STARTED:  # only update if being drawn
    aperture.setPos(mouse.getPos(), log=False)

The error is in the second if/then above, which should not occur. It is included as if there was a maximum duration in effect, but the value is omitted in the (-win.monitorFramePeriod*0.75) expression and hence the duration is effectively zero.

The fix here should be simple but I'm not familiar with playing with the Builder component generation code. So recording the bug here until I can figure out how to fix it (and test).

A work-around for users in the mean time would be to simply put an unfeasibly large number in the duration field (e.g. 9999).

@m-macaskill m-macaskill self-assigned this Feb 23, 2016
jeremygray added a commit to jeremygray/psychopy that referenced this issue Feb 25, 2016
peircej added a commit that referenced this issue Feb 25, 2016
BF: aperture component stop test; closes #1122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant