Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions +ndr/+reader/axon_abf.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
% Creates a Neuroscience Data Reader object of the Axon Instruments
% ABF file format.
%
axon_abf_obj.MightHaveTimeGaps = true;
end % ndr.reader.axon_abf.axon_abf

function ec = epochclock(axon_abf_obj, epochstreams, epoch_select)
Expand Down
4 changes: 4 additions & 0 deletions +ndr/+reader/base.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
classdef base

properties (SetAccess=protected)
MightHaveTimeGaps = false; % Boolean: true if the reader might have time gaps, false otherwise
end

methods
function ndr_reader_base_obj = base(ndr_reader_type)
% READER - create a new Neuroscience Data Reader Base object
Expand Down
12 changes: 12 additions & 0 deletions +ndr/reader.m
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,18 @@
s = ndr_reader_obj.ndr_reader_base.times2samples(channeltype, channel, epochstreams, epoch_select, t);
end % times2samples()

function b = MightHaveTimeGaps(ndr_reader_obj)
%MIGHTHAVETIMEGAPS - does the reader potentially have time gaps?
%
% B = MIGHTHAVETIMEGAPS(NDR_READER_OBJ)
%
% Returns true if the underlying reader might have time gaps, false otherwise.
%
% See also: ndr.reader.base/MightHaveTimeGaps
%
b = ndr_reader_obj.ndr_reader_base.MightHaveTimeGaps;
end % MightHaveTimeGaps()

end % methods
end % classdef

23 changes: 23 additions & 0 deletions tools/tests/+ndr/+unittest/+reader/TestMightHaveTimeGaps.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
classdef TestMightHaveTimeGaps < matlab.unittest.TestCase
methods (Test)
function testBaseProperty(testCase)
baseReader = ndr.reader.base();
testCase.verifyFalse(baseReader.MightHaveTimeGaps);
end

function testAxonAbfProperty(testCase)
axonReader = ndr.reader.axon_abf();
testCase.verifyTrue(axonReader.MightHaveTimeGaps);
end

function testReaderDelegation(testCase)
% 'abf' maps to ndr.reader.axon_abf
r_abf = ndr.reader('abf');
testCase.verifyTrue(r_abf.MightHaveTimeGaps());

% 'intan' maps to ndr.reader.intan_rhd, which should inherit false
r_intan = ndr.reader('intan');
testCase.verifyFalse(r_intan.MightHaveTimeGaps());
end
end
end
Loading