klabhub / neurostim

Design and run visual neuroscience experiments using Matlab and the Psychophysics Toolbox.
MIT License
5 stars 4 forks source link

Add check on rsvp design specs in .addRSVP(). #215

Closed cnuahs closed 1 year ago

cnuahs commented 1 year ago

This commit adds a check that the design object used for rsvp of a stimulus only modifies properties of that stimulus and produces and error if that isn't the case.

This is consistent with the existing behaviour of .updateRSVP() but prevents a design object being assigned to the rsvp that tries to modify some other plugin. At present that is possible, but leads to a) an error at runtime when .updateRSVP() tries to update a property that doesn't exist, or b) incorrect, but silent, modification of the current stimulus' property if it happens to match the name of the property of the other plugin named in the spec. Both outcomes are clearly undesirable.