-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Labels
easyenhancementpriority: lowsignalsrelating to signals experiments and coderelating to signals experiments and code
Description
Currently an expStop signal defined in an experiment can't be used to update signals when the experiment is ended remotely. This would be useful for triggering cleanup operations, e.g. events.expStop.map(@cleanup). Here's how it could be implemented:
% Define an expStop signal so the experimenter can use it
obj.Events.expStop = net.origin('expStop');
[...]
expDefFun(obj.Time, obj.Events, obj.Params, obj.Visual, obj.Inputs,...
obj.Outputs, obj.Audio);
obj.Events.expStop = merge(obj.Events.expStop, lastTrialOver);
[...]
function quit(obj, immediately)
% if the experiment was stopped via 'mc' or 'q' key
stopNode = obj.Events.expStop.Node;
if isempty(stopNode.CurrValue)
% sneak in and update node value
affectedIdxs = submit(obj.Net.Id, stopNode.Inputs(1).Id, true);
applyNodes(obj.Net.Id, affectedIdxs);
end
Metadata
Metadata
Assignees
Labels
easyenhancementpriority: lowsignalsrelating to signals experiments and coderelating to signals experiments and code