Skip to content
Snippets Groups Projects
Commit 8fe51398 authored by leprob001's avatar leprob001
Browse files

Bugfix, CloseRequestFcn, The windows can now be closed even if clear all has been triggered before.

parent 7a7f4bb0
No related branches found
No related tags found
No related merge requests found
...@@ -5,14 +5,26 @@ function [ ] = close() ...@@ -5,14 +5,26 @@ function [ ] = close()
global artoaGui artoaWorkspace; global artoaGui artoaWorkspace;
%% Close the figure %% Close the figure
try
delete(artoaGui.figures.editPressure); delete(artoaGui.figures.editPressure);
catch
delete(gcf);
end
%% Clean up variables %% Clean up variables
artoaGui = rmfield(artoaGui, 'editPressure'); try
artoaGui.figures = rmfield(artoaGui.figures, 'editPressure'); artoaGui = rmfield(artoaGui, 'editPressure');
artoaWorkspace = rmfield(artoaWorkspace, 'editPressure'); catch
end
try
artoaGui.figures = rmfield(artoaGui.figures, 'editPressure');
catch
end
try
artoaWorkspace = rmfield(artoaWorkspace, 'editPressure');
catch
end
end end
...@@ -6,13 +6,26 @@ global artoaGui artoaWorkspace; ...@@ -6,13 +6,26 @@ global artoaGui artoaWorkspace;
%% Close the figure %% Close the figure
delete(artoaGui.figures.editTemperature); try
delete(artoaGui.figures.editTemperature);
catch
delete(gcf);
end
%% Clean up variables %% Clean up variables
artoaGui = rmfield(artoaGui, 'editTemperature'); try
artoaGui.figures = rmfield(artoaGui.figures, 'editTemperature'); artoaGui = rmfield(artoaGui, 'editTemperature');
artoaWorkspace = rmfield(artoaWorkspace, 'editTemperature'); catch
end
try
artoaGui.figures = rmfield(artoaGui.figures, 'editTemperature');
catch
end
try
artoaWorkspace = rmfield(artoaWorkspace, 'editTemperature');
catch
end
end end
...@@ -6,13 +6,26 @@ global artoaGui artoaWorkspace; ...@@ -6,13 +6,26 @@ global artoaGui artoaWorkspace;
%% Close the figure %% Close the figure
delete(artoaGui.figures.editTimeOfArrival); try
delete(artoaGui.figures.editTimeOfArrival);
catch
delete(gcf);
end
%% Clean up variables %% Clean up variables
artoaGui = rmfield(artoaGui, 'editTimeOfArrival'); try
artoaGui.figures = rmfield(artoaGui.figures, 'editTimeOfArrival'); artoaGui = rmfield(artoaGui, 'editTimeOfArrival');
artoaWorkspace = rmfield(artoaWorkspace, 'editTimeOfArrival'); catch
end
try
artoaGui.figures = rmfield(artoaGui.figures, 'editTimeOfArrival');
catch
end
try
artoaWorkspace = rmfield(artoaWorkspace, 'editTimeOfArrival');
catch
end
end end
...@@ -3,6 +3,12 @@ function [] = quit() ...@@ -3,6 +3,12 @@ function [] = quit()
global artoaGui; global artoaGui;
if ~exist('artoaGui', 'var') || isempty(artoaGui)
delete(gcf);
clearvars -global artoaGui artoaDataInput artoaDataOutput artoaWorkspace;
return;
end
openedFigures = fieldnames(artoaGui.figures); openedFigures = fieldnames(artoaGui.figures);
for i = 1:length(openedFigures) for i = 1:length(openedFigures)
current = openedFigures{i}; current = openedFigures{i};
...@@ -13,7 +19,10 @@ for i = 1:length(openedFigures) ...@@ -13,7 +19,10 @@ for i = 1:length(openedFigures)
end end
% Close main figure % Close main figure
delete(artoaGui.figures.main.Number); try
delete(artoaGui.figures.main.Number);
catch
end
clearvars -global artoaGui artoaDataInput artoaDataOutput artoaWorkspace; clearvars -global artoaGui artoaDataInput artoaDataOutput artoaWorkspace;
......
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