Commit 88151fa1 authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.31.0

-- Fix loading of invalid snirf file generates error because probe is effectively missing (this was the invalid part). Fix is to detect that SNIRF file is not valid and to set the appropriate error code. This will prevent client GUIs from loading the data file when trying to display it's data.
parent 34c2eb77
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -519,12 +519,12 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                
                %%%% Load formatVersion
                if obj.LoadFormatVersion() < 0 && err == 0
                if obj.LoadFormatVersion() < 0 && err >= 0
                    err = -2;
                end

                %%%% Load metaDataTags
                if obj.LoadMetaDataTags(obj.fid) < 0 && err == 0
                if obj.LoadMetaDataTags(obj.fid) < 0 && err >= 0
                    % Here a positive return value means that invalid data meta tags 
                    % should NOT be a show stopper if we can help it, if the reste of the data 
                    % is valid. So just let user know they're invalid with a warning.
@@ -532,12 +532,12 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
                end

                %%%% Load data
                if obj.LoadData(obj.fid) < 0 && err == 0
                if obj.LoadData(obj.fid) < 0 && err >= 0
                    err = -4;
                end

                %%%% Load stim
                if obj.LoadStim(obj.fid) < 0 && err == 0
                if obj.LoadStim(obj.fid) < 0 && err >= 0
                    % Optional field: even if invalid we still want to be
                    % able to work with the rest of the data. Only log
                    % warning
@@ -545,12 +545,12 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
                end

                %%%% Load probe
                if obj.LoadProbe(obj.fid) < 0 && err == 0
                if obj.LoadProbe(obj.fid) < 0 && err >= 0
                    err = -6;
                end

                %%%% Load aux. This is an optional field
                if obj.LoadAux(obj.fid) < 0 && err == 0
                if obj.LoadAux(obj.fid) < 0 && err >= 0
                    % Optional field: even if invalid we still want to be
                    % able to work with the rest of the data. Only log
                    % warning
+2 −2
Original line number Diff line number Diff line
function vrnnum = getVernum()

vrnnum{1} = '1';   % Major version #
vrnnum{2} = '30';  % Major sub-version #
vrnnum{3} = '5';   % Minor version #
vrnnum{2} = '31';  % Major sub-version #
vrnnum{3} = '0';   % Minor version #
vrnnum{4} = '0';   % Minor sub-version # or patch #: 'p1', 'p2', etc