Commit 9d409956 authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.24.4

-- Fix issues with saving and loading processing stream to/from config file in ProcStreamEditGUI because function usage information was not being added correctly or not added at all to function call entries (FuncCallClass).
parent 9abde988
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -54,9 +54,7 @@ classdef FuncCallClass < handle
            if nargin==1
                return;
            end
            
            reg = varargin{2};            
            obj.AddUsageInfo(reg);
            obj.AddUsageInfo(varargin{2});
            
        end

@@ -569,10 +567,13 @@ classdef FuncCallClass < handle
       
        
        % -----------------------------------------------------------------
        function AddUsageInfo(obj, reg)
        function AddUsageInfo(obj, arg)
            if nargin<2
                return;
            end
            if isa(arg, 'RegistriesClass')
                reg = arg;
                
                usagename = reg.GetUsageName(obj);
                fcallstr = reg.GetFuncCallStrDecoded(obj.name, usagename);
                obj.AddHelpUsageStr(fcallstr);
@@ -580,10 +581,14 @@ classdef FuncCallClass < handle
                if length(reg.GetUsageNames(obj.name))<2
                    usagename = '';
                end
            elseif ischar(arg)
                usagename = arg;
            end
            obj.SetUsageName(usagename);
        end
        
        
        
        % ----------------------------------------------------------------------------------        
        function nbytes = MemoryRequired(obj)            
            fields = properties(obj);
+1 −1
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ classdef FuncRegEntryClass < matlab.mixin.Copyable
                % encoded function string in obj.usageoptions{ii,3}. This will allow
                % easy lookup and comparison matching in the registry of proc stream
                % FuncCallClass objects.
                obj.usageoptions{ii,4} = FuncCallClass(encoding);
                obj.usageoptions{ii,4} = FuncCallClass(encoding, obj.usageoptions{ii,1});
            end
        end
        
+23 −36
Original line number Diff line number Diff line
@@ -143,9 +143,7 @@ procStreamEdit.iPanel = procStreamEdit.iRunPanel;
% Load data tree
procStreamEdit.dataTree = LoadDataTree(pwd, procStreamEdit.format, '', maingui);
if ~procStreamEdit.dataTree.IsEmpty()
    procStreamEdit.procElem{procStreamEdit.iRunPanel} = procStreamEdit.dataTree.groups(1).subjs(1).runs(1).copy;
    procStreamEdit.procElem{procStreamEdit.iSubjPanel} = procStreamEdit.dataTree.groups(1).subjs(1).copy;
    procStreamEdit.procElem{procStreamEdit.iGroupPanel} = procStreamEdit.dataTree.groups(1).copy;
    UpdateProcElem()
    switch(class(procStreamEdit.dataTree.currElem))
        case 'RunClass'
            htab = htabR;
@@ -169,6 +167,20 @@ LoadRegistry(handles);
LoadProcStream(handles);



% -------------------------------------------------------------
function UpdateProcElem()
global procStreamEdit
idx = procStreamEdit.dataTree.currElem.GetIndexID();
iG = idx(1);
iS = idx(2);
iR = idx(3);
procStreamEdit.procElem{procStreamEdit.iRunPanel} = procStreamEdit.dataTree.groups(iG).subjs(iS).runs(iR).copy;
procStreamEdit.procElem{procStreamEdit.iSubjPanel} = procStreamEdit.dataTree.groups(iG).subjs(iS).copy;
procStreamEdit.procElem{procStreamEdit.iGroupPanel} = procStreamEdit.dataTree.groups(iG).copy;



% -------------------------------------------------------------
function idx = MapRegIdx(iPanel)
global procStreamEdit
@@ -473,9 +485,9 @@ LoadProcStream(handles, reload);
function CopyParamValues(fcall, fcalls)
% Look for the function call fcall in fcalls
for ii=1:length(fcalls)
    % Compare names, not usage names, which may differ
    if strcmp(fcalls(ii).GetName(), fcall.GetName())
    if strcmp(fcalls(ii).GetUsageName(), fcall.GetUsageName())
        fcall.Copy(fcalls(ii));
        break;
    end
end

@@ -483,6 +495,12 @@ end
% -------------------------------------------------------------
function pushbuttonSave_Callback(hObject, eventdata, handles)
global procStreamEdit

% Processing stream function calls haven't been changed from the outside (since this GUI is the only way to change that) 
% BUT the value of the user options could have been changed from the outside. Before saving processing stream we need to 
% update our copy of the user options at the run, subject and group levels. 
UpdateProcElem();

procElem    = procStreamEdit.procElem;
groups      = procStreamEdit.dataTree.groups;
listPsUsage = procStreamEdit.listPsUsage;
@@ -527,37 +545,6 @@ for iPanel=1:length(procElem)
        usagename = strtrim(parts{2});
        fcall = reg.funcReg(MapRegIdx(iPanel)).GetFuncCallDecoded(funcname, usagename);
        CopyParamValues(fcall, procStreamPrev.fcalls);
        % Get path up the tree from currElem
        ir = procStreamEdit.dataTree.currElem.iRun;
        is = procStreamEdit.dataTree.currElem.iSubj;
        ig = procStreamEdit.dataTree.currElem.iGroup;  
        % Get parameters from global processing stream if they're there and
        % if we're saving to a file
        if (q == 2)
            switch iPanel
                case iGroupPanel
                    try
                        fcall2 = procStreamEdit.dataTree.groups(ig).procStream.fcalls(jj);
                        fcall.paramIn = fcall2.paramIn;
                    catch
                        fprintf('Saving newly-added function %s to stream with default parameters.\n', fcall.name);
                    end
                case iSubjPanel
                    try
                        fcall2 = procStreamEdit.dataTree.groups(ig).subjs(is).procStream.fcalls(jj);
                        fcall.paramIn = fcall2.paramIn;
                    catch
                        fprintf('Saving newly-added function %s to stream with default parameters.\n', fcall.name);
                    end
                case iRunPanel
                    try
                        fcall2 = procStreamEdit.dataTree.groups(ig).subjs(is).runs(ir).procStream.fcalls(jj);
                        fcall.paramIn = fcall2.paramIn;
                    catch
                        fprintf('Saving newly-added function %s to stream with default parameters.\n', fcall.name);
                    end
            end
        end
        procElem{iPanel}.procStream.Add(fcall);
    end
end
+1 −1
Original line number Diff line number Diff line
@@ -2,5 +2,5 @@ function vrnnum = getVernum()

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