Commit 6a9848b3 authored by Jay Dubb's avatar Jay Dubb
Browse files

Merge branch 'master' of file://C:\Users\same1\workspaces\Homer3

parents b048ee0d bc725bf4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -170,6 +170,10 @@ classdef AuxClass < FileLoadSaveClass
        
        % ----------------------------------------------------------------------------------
        function nbytes = MemoryRequired(obj)
            nbytes = 0;
            if isempty(obj)
                return
            end
            nbytes = sizeof(obj.name) + sizeof(obj.dataTimeSeries) + sizeof(obj.time) + sizeof(obj.timeOffset);
        end
        
+4 −0
Original line number Diff line number Diff line
@@ -611,6 +611,10 @@ classdef DataClass < FileLoadSaveClass
        
        % ----------------------------------------------------------------------------------
        function nbytes = MemoryRequired(obj)
            nbytes = 0;
            if isempty(obj)
                return
            end
            nbytes = sizeof(obj.dataTimeSeries) + sizeof(obj.time);
            for ii=1:length(obj.measurementList)
                nbytes = nbytes + obj.measurementList(ii).MemoryRequired();
+4 −0
Original line number Diff line number Diff line
@@ -425,6 +425,10 @@ classdef StimClass < FileLoadSaveClass
                
        % ----------------------------------------------------------------------------------
        function nbytes = MemoryRequired(obj)
            nbytes = 0;
            if isempty(obj)
                return
            end
            nbytes = sizeof(obj.name) + sizeof(obj.data) + sizeof(obj.filename) + sizeof(obj.fileformat) + sizeof(obj.supportedFomats) + 8;
        end
        
+1 −8
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ classdef GroupClass < TreeNodeClass
        version;
        versionStr;
        subjs;
        spacesaver;
        logger
    end
    
@@ -33,7 +32,6 @@ classdef GroupClass < TreeNodeClass
            
            obj.type    = 'group';
            obj.subjs   = SubjClass().empty;
            obj.spacesaver = false;
            
            if nargin==0
                return;
@@ -218,13 +216,8 @@ classdef GroupClass < TreeNodeClass
                    end
                end
            else
                if obj.spacesaver
                    option = 'spacesaver';
                else
                    option = 'saveall';
                end
                for i=1:length(obj2.subjs)
                    obj.subjs(i) = SubjClass(obj2.subjs(i), option);
                    obj.subjs(i) = SubjClass(obj2.subjs(i));
                end
                obj.Copy@TreeNodeClass(obj2);
            end
+27 −9
Original line number Diff line number Diff line
@@ -122,6 +122,29 @@ classdef ProcResultClass < handle
        end
        

        
        % ----------------------------------------------------------------------------------
        function AddVars(obj, vars, filename)
            output = obj;
            props = propnames(vars);
            for ii=1:length(props)
                if eval( sprintf('isproperty(output, ''%s'');', props{ii}) )
                    eval( sprintf('output.%s = vars.%s;', props{ii}, props{ii}) );
                else
                    eval( sprintf('output.misc.%s = vars.%s;', props{ii}, props{ii}) );
                end
            end
            if ~isempty(filename)
                [~, ~, ext] = fileparts(filename);
                if isempty(ext)
                    filename = [filename, '.mat']; 
                end
                save(filename, '-mat', 'output');
            end
        end
            

        
        % ----------------------------------------------------------------------------------
        function Flush(obj)
            obj.Initialize();
@@ -448,22 +471,17 @@ classdef ProcResultClass < handle
    methods
        
        % ----------------------------------------------------------------------------------
        function Copy(obj, obj2, option)
        function Copy(obj, obj2, filename)
            if ~isa(obj, 'ProcResultClass')
                return;
            end
            if nargin==2
                option = '';
            end
            
            % Ok to shallow copy since ProcResult objects are read only
            % Also we don't want to transfer space hogging time course
            % data dc and dod
            
            if ~strcmp(option, 'spacesaver')
            obj.dod = obj2.dod;
            obj.dc = obj2.dc;
            end
            obj.dodAvg = obj2.dodAvg;
            obj.dcAvg = obj2.dcAvg;
            obj.dodAvgStd = obj2.dodAvgStd;
@@ -543,7 +561,7 @@ classdef ProcResultClass < handle
            nbytes = zeros(length(fields),1);
            for ii = 1:length(fields)
                fieldstr = sprintf('obj.%s', fields{ii});
                if ~eval('isempty(fieldstr)')
                if ~isempty(fieldstr)
                    if isa(eval(fieldstr), 'DataClass')
                        nbytes(ii) =  eval(sprintf('%s.MemoryRequired();', fieldstr));
                    else
Loading