Closed samcooler closed 8 years ago
This works with these functions in my abstract stage protocol:
function prepareEpoch(obj, epoch)
prepareEpoch@sa_labs.protocols.BaseProtocol(obj, epoch);
device = obj.rig.getDevice(obj.chan1);
duration = (obj.preTime + obj.stimTime + obj.tailTime) / 1e3;
epoch.addDirectCurrentStimulus(device, device.background, duration, obj.sampleRate);
end
function completeEpoch(obj, epoch)
epoch.removeStimulus(obj.rig.getDevice(obj.chan1));
completeEpoch@sa_labs.protocols.BaseProtocol(obj, epoch);
end
Thanks for the pull. Just a heads up: only stimulus parameters are saved to the data file. When the data manager shows you a stimulus vector, it's actually regenerating the stimulus from the saved parameters. So, they don't take up much space.
Thinking about it more, you may actually want to keep that stimulus around or your epoch will be persisted with zero duration.
This issue has been addressed in the 2.2 beta. An epoch's duration is now equal to the duration of its longest stimulus OR response. See #9 .
Enables removal of dummy stimulus used for stage protocol timing, to avoid storage space usage and data clutter