Skip to content
Open
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
8 changes: 6 additions & 2 deletions +gui/GuiMainSMAP.m
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,12 @@ function error_callback(obj,b)

function error_reset(a,b,obj)
if a.Value==0
warndlg(obj.getPar('errorindicator'));
resetstyle(obj)
errmsg=obj.getPar('errorindicator');
% Only show dialog if error message is not empty
if ~isempty(errmsg)
warndlg(errmsg);
end
resetstyle(obj)
end
end

Expand Down
27 changes: 19 additions & 8 deletions +gui/SEEvaluationGui.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
if nargin>0
obj.handle=varargin{1};
end
obj.processors{1}=interfaces.SEEvaluationProcessor;
obj.currentmodule.number=1;
obj.processors={}; % Initialize as empty, modules are added via addmodule
obj.currentmodule.number=0; % No module selected initially
end
function pard=guidef(obj)
pard=guidef(obj);
Expand Down Expand Up @@ -56,10 +56,14 @@ function setGuiParameters(obj,p,setchildren,setmenulist)
rgp=obj.getPar('ROI_restoreparameters');
if isempty(rgp)|| rgp
setGuiParameters@interfaces.SEProcessor(obj,p,setchildren,setmenulist);

% Clear both table AND processors to ensure synchronization
obj.guihandles.modules.Data={};
obj.processors = {}; % Clear processors array

if isfield(p,'children')
modules=fieldnames(p.children);
for k=1:length(modules);
for k=1:length(modules)
mh=modules{k};
while mh(end)>'0'&&mh(end)<'9'
mh=mh(1:end-1);
Expand All @@ -79,9 +83,10 @@ function setGuiParameters(obj,p,setchildren,setmenulist)
% Yu-Le added end/
end

%set on / off
%set on / off (only for indices within bounds)
for k=1:length(modules)
if isfield(p,'modules')&&~isempty(find(strcmpi(p.modules.Data(:,2),modules{k}),1))
if k <= size(obj.guihandles.modules.Data,1) && ...
isfield(p,'modules')&&~isempty(find(strcmpi(p.modules.Data(:,2),modules{k}),1))
val=p.modules.Data{k,1};
obj.guihandles.modules.Data{k,1}=val;
end
Expand Down Expand Up @@ -226,9 +231,15 @@ function evaluatesite(obj,site,ploton)
s=size(d);
for k=1:s(1)
if d{k,1} %evaluate
module=obj.processors{k};
module.display=p.se_display;
module.evaluate(site);
% Check if processor exists at this index
if k <= length(obj.processors)
module=obj.processors{k};
module.display=p.se_display;
module.evaluate(site);
else
warning('SEEvaluationGui:IndexMismatch', ...
'Module row %d in table exceeds processors array length (%d). Skipping evaluation.', k, length(obj.processors));
end
end
end
end
Expand Down
8 changes: 6 additions & 2 deletions +interfaces/GuiModuleInterface.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function setGuiParameters(obj,p,setchildren,setmenulist)
phere=p;
h=obj.guihandles;
for k=1:length(fn)
if isfield(h,fn{k})&&isprop(h.(fn{k}),'Style')&&~strcmp(h.(fn{k}).Style,'text')&&~any(ismember(obj.excludeFromSave,fn))
if isfield(h,fn{k})&&isprop(h.(fn{k}),'Style')&&~strcmp(h.(fn{k}).Style,'text')&&~ismember(fn{k}, obj.excludeFromSave)

hs=obj.value2handle(phere.(fn{k}),h.(fn{k}));
if (strcmp(h.(fn{k}).Style,'popupmenu'))
Expand Down Expand Up @@ -456,7 +456,11 @@ function resize(obj,factor)
if ~isempty(obj.children)
ch=fieldnames(obj.children);
for k=1:length(ch)
obj.children.(ch{k}).resize(factor);
child = obj.children.(ch{k});
% Check if child is a valid object with resize method
if isvalid(child) && ismethod(child, 'resize')
child.resize(factor);
end
end
end
end
Expand Down
151 changes: 0 additions & 151 deletions git.m

This file was deleted.