Symphony-DAS / symphony-matlab

Symphony Data Acquisition System
http://symphony-das.github.io
MIT License
19 stars 5 forks source link

Allow figure handlers to decide if they want to handle interval epochs #15

Closed cafarm closed 8 years ago

cafarm commented 8 years ago

There are cases where a FigureHandler may want to handle interval epochs. Right now, only "true" epochs are passed to the handleEpoch method of handlers. It might make sense to pass all epochs to handlers and let the handler decide if it wants to deal with "interval" epochs.

Adding an isInterval method to Epoch would also be helpful for this.

cafarm commented 8 years ago

Still undecided about this. It's probably an annoyance for the vast majority of FigureHandlers to think about interval epochs. However, a few handlers might need to.

One possibility is to have two methods and those handlers that don't care about intervals can override one, while those that do can override the other:

function handleEpochOrInterval(obj, epochOrInterval)
    % The few handlers that care about handling intervals can override this method.
    if ~epochOrInterval.isInterval()
        obj.handleEpoch(epoch);
    end
end

function handleEpoch(obj, epoch)
    % The vast majority of handlers that only care about "true" epochs can override this method.

end

Adds some complexity but it's probably worth it.