Commit fb62cdb4 authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.23.3

-- The changes to implement distributed storage in Homer3 removed up front error checking because when it's configured acquisition data isn't loaded right away, so it isn't error checked. This implements a graceful loading even is acquisition files are not valid and pushes the rror checking to a little later in the Homer3 startup process. It add to the Load methods an err return value signifying if loading was successful and if the loaded file was valid or invalid. When clicking on listbox entries it doesn't allow display unless the SnirfClass loader returns without error.

-- Fix small bug where Settings menu callback (which isn't needed) was deleted in MainGUI.m but was NOT in MainGUI.fig
parent 2a0d5b46
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -151,6 +151,9 @@ classdef ProbeClass < FileLoadSaveClass
                                
                % Close group
                HDF5_GroupClose(fileobj, gid, fid);
                
                assert(obj.IsValid())
                
            catch 
                err=-1;
                return;
@@ -293,6 +296,32 @@ classdef ProbeClass < FileLoadSaveClass
            b = false;
        end

        
        % ----------------------------------------------------------------------------------
        function b = IsValid(obj)
            b = false;
            if obj.IsEmpty()
                return;
            end
            if iscolumn(obj.sourcePos2D)
                return;
            end
            if length(obj.sourcePos2D)>4
                if size(obj.sourcePos2D,2) > size(obj.sourcePos2D,1)
                    return;
                end
            end
            if iscolumn(obj.detectorPos2D)
                return;
            end
            if length(obj.detectorPos2D)>4
                if size(obj.detectorPos2D,2) > size(obj.detectorPos2D,1)
                    return;
                end
            end
            b = true;
        end
        
    end
    
end
+3 −2
Original line number Diff line number Diff line
@@ -370,11 +370,12 @@ classdef DataTreeClass < handle
        
        
        % ----------------------------------------------------------
        function LoadCurrElem(obj)
        function err = LoadCurrElem(obj)
            err = 0;
            if isempty(obj.groups)
                return;
            end
            obj.currElem.Load()
            err = obj.currElem.Load();
        end


+7 −4
Original line number Diff line number Diff line
@@ -538,11 +538,12 @@ classdef GroupClass < TreeNodeClass
        
        
        % ----------------------------------------------------------------------------------
        function LoadSubBranch(obj)
        function err = LoadSubBranch(obj)
            err = -1;
            if isempty(obj)
                return;
            end
            obj.subjs(1).LoadSubBranch()
            err = obj.subjs(1).LoadSubBranch();
        end            
                        
            
@@ -556,7 +557,8 @@ classdef GroupClass < TreeNodeClass
            
        
        % ----------------------------------------------------------------------------------
        function Load(obj, options)
        function err = Load(obj, options)
            err = -1;
            if isempty(obj)
                return;
            end
@@ -567,7 +569,7 @@ classdef GroupClass < TreeNodeClass
            % If this group has been loaded, then no need to go through the whole Load function. Instead 
            % default to the generic TreeNodeClass.Load method.
            if isempty(findstr('reload', options)) && ~obj.procStream.IsEmpty()
                obj.Load@TreeNodeClass();
                err = obj.Load@TreeNodeClass();
                return;
            end
            
@@ -603,6 +605,7 @@ classdef GroupClass < TreeNodeClass
                end
                obj.Save();
            end
            err = 0;
        end
        
        
+3 −2
Original line number Diff line number Diff line
@@ -205,7 +205,8 @@ classdef ProcResultClass < handle
        
        
        % ----------------------------------------------------------------------------------
        function Load(obj, filename)
        function err = Load(obj, filename)
            err = 0;
            obj.SetFilename(filename)
            if isempty(obj.filename)
                return;
+3 −2
Original line number Diff line number Diff line
@@ -142,11 +142,12 @@ classdef ProcStreamClass < handle

        
        % ----------------------------------------------------------------------------------
        function Load(obj, filename)
        function err = Load(obj, filename)
            err = 0;
            if ~exist('filename','var')
                return
            end
            obj.output.Load(filename)
            err = obj.output.Load(filename);
        end


Loading