Fixes multiple bugs with the logging of rsvp stimulus onsets, i.e. addRSVP(...,'log',true)
a fatal error because startIsiFrame does not exist (a relic of some previous version of this code)
with that fixed, rsvpISI value was being logged every frame because neurostim.parameter checks for a value change only for numeric and string types, not for logical. I have fixed this logical logging problem in a separate pull request because I am not sure whether perhaps it was intentional that logicals would always be logged. Fixed here in a different way by making rsvpISI an integer, initialised with -1 and then values of 0 and 1.
Related to above, the original logical value was initialised to false, so the onset of the first rsvp frame was not logged. This was probably intentional because it is already logged as startTime, but maybe there is value in being able to use rsvpISI alone to get all the on and off times? if you disagree, initialising rsvpIsi to 0 should restore the previous behaviour. Happy to do that if it is preferred.
This is a potentially breaking change for analysis code that uses rsvpISI (because values are now 0 and 1 rather than false and true), but given there has been a fatal bug since 2021, I am guessing not many people have used this in their experiment or analysis.
Fixes multiple bugs with the logging of rsvp stimulus onsets, i.e. addRSVP(...,'log',true)
startIsiFrame
does not exist (a relic of some previous version of this code)rsvpISI
value was being logged every frame becauseneurostim.parameter
checks for a value change only for numeric and string types, not for logical. I have fixed this logical logging problem in a separate pull request because I am not sure whether perhaps it was intentional that logicals would always be logged. Fixed here in a different way by making rsvpISI an integer, initialised with -1 and then values of 0 and 1.false
, so the onset of the first rsvp frame was not logged. This was probably intentional because it is already logged asstartTime
, but maybe there is value in being able to use rsvpISI alone to get all the on and off times? if you disagree, initialising rsvpIsi to 0 should restore the previous behaviour. Happy to do that if it is preferred.