Closed ragavsathish closed 9 years ago
I don't think you need to subclass UnitConvertingDevice for this functionality. I'd just create a protocol superclass (AlaLaurilaProtocol or something) and derive all your protocols from it. Attach your run switch to the ITC trigger in and set epoch.waitForTrigger = true on the first epoch of the protocol. Then when each epoch completes check the current state of the rig switch.
classdef AlaLaurilaProtocol < symphonyui.core.Protocol
properties (Hidden)
runTriggered = false
end
methods
function prepareEpoch(obj, epoch)
prepareEpoch@symphonyui.core.Protocol(obj, epoch);
if obj.numEpochsPrepared == 1
epoch.waitForTrigger = true;
end
end
function completeEpoch(obj, epoch)
completeEpoch@symphonyui.core.Protocol(obj, epoch);
device = obj.rig.getDevice('rigSwitch1');
quantities = epoch.response(device).getData();
obj.runTriggered = quantities(end) == 1;
end
function tf = continueRun(obj)
tf = obj.runTriggered;
end
end
end
Yeah, it looks simple and clean :+1: Thank you.
Hi Mark, Thanks for integrating Heka device support. I am trying to integrate rig toggle switches to control the state (start, stop and pause) of acquisition software.
Can you please review below approach and advise on it ?
Extending UnitConvertingDevice with following events and
But am not sure where to bind Rig Switch event listeners, Is it ok to bind on acquisition service constructor ?
If am doing some thing wrong, kindly correct me
Thanks, Sathish