Skip to content
Snippets Groups Projects
Commit 4779bcf9 authored by leprob001's avatar leprob001
Browse files

Updated CloseRequestFcn functions.

parent f64acf12
No related branches found
No related tags found
No related merge requests found
function [ ] = close(~, ~)
%CLOSEREQ Cleans up all variables that are used by the trackParameter GUI.
% Changes to the data are dropped.
function [ ] = close(pSource, ~)
%CLOSE Cleans up all variables that are used by the trackParameter GUI.
% Changes to the data is not being modified.
global artoaGui;
%% Close the figure
%% Setup variables
figureName = 'trackParameter';
try
delete(artoaGui.figures.trackParameter);
catch
delete(gcf);
%% Close the figure
if nargin > 1 && isvalid(pSource)
delete(pSource);
elseif isfield(artoaGui.figures, figureName) && isvalid(artoaGui.figures.(figureName))
delete(artoaGui.figures.(figureName));
end
%% Clean up variables
try
artoaGui = rmfield(artoaGui, 'trackParameter');
catch
if artoa.data.hasMember(artoaGui, {figureName})
artoaGui = rmfield(artoaGui, figureName);
end
try
artoaGui.figures = rmfield(artoaGui.figures, 'trackParameter');
catch
if artoa.data.hasMember(artoaGui, {'figures', figureName})
artoaGui.figures = rmfield(artoaGui.figures, figureName);
end
% Workspace is not cleaned, because we need the values after closing the
% window
end
end
\ No newline at end of file
function [ ] = close(~, ~)
%CLOSEREQ Cleans up all variables that are used by the trajectoryOutput GUI.
% Changes to the data are dropped.
function [ ] = close(pSource, ~)
%CLOSE Cleans up all variables that are used by the trajectoryOutput GUI.
% Changes to the data is not being modified.
global artoaGui;
%% Close the figure
%% Setup variables
figureName = 'trajectoryOutput';
try
delete(artoaGui.figures.trajectoryOutput);
catch
delete(gcf);
%% Close the figure
if nargin > 1 && isvalid(pSource)
delete(pSource);
elseif isfield(artoaGui.figures, figureName) && isvalid(artoaGui.figures.(figureName))
delete(artoaGui.figures.(figureName));
end
%% Clean up variables
try
artoaGui = rmfield(artoaGui, 'trajectoryOutput');
catch
if artoa.data.hasMember(artoaGui, {figureName})
artoaGui = rmfield(artoaGui, figureName);
end
try
artoaGui.figures = rmfield(artoaGui.figures, 'trajectoryOutput');
catch
if artoa.data.hasMember(artoaGui, {'figures', figureName})
artoaGui.figures = rmfield(artoaGui.figures, figureName);
end
% Workspace is not cleaned, because we need the values after closing the
% window
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment