Skip to content

Commit 1077e1d

Browse files
committed
Remove necessity to manually set/unset compile-flag
1 parent a4106d1 commit 1077e1d

1 file changed

Lines changed: 14 additions & 20 deletions

File tree

StatSTEM.m

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ function StatSTEM()
1616
% Contact: sandra.vanaert@uantwerpen.be
1717
%--------------------------------------------------------------------------
1818

19-
forCompiling = 0; % Put to 1 when compiling
20-
21-
% Load functions
22-
path = mfilename('fullpath');
23-
path = path(1:end-9);
24-
pathF = [path,filesep,'functions']; % Path for loading fit functions
25-
pathG = [path,filesep,'GUI']; % Path for loading GUI functions
26-
addpath([path,';',genpath(pathF),';',genpath(pathG)])
27-
2819
% Start a splash screen
29-
if forCompiling
20+
if isdeployed
3021
splashImg = imread('splash.png');
22+
imgPan = imread('imgGui.png');
3123
else
24+
% Load functions
25+
path = mfilename('fullpath');
26+
path = path(1:end-9);
27+
pathF = [path,filesep,'functions']; % Path for loading fit functions
28+
pathG = [path,filesep,'GUI']; % Path for loading GUI functions
29+
30+
addpath([path,';',genpath(pathF),';',genpath(pathG)])
31+
imgPan = imread([pathG,filesep,'imgGui.png']);
3232
splashImg = imread([pathG,filesep,'splash.png']);
3333
spl = splash(splashImg);
3434
end
@@ -70,21 +70,15 @@ function StatSTEM()
7070
warning('on','all')
7171

7272
% Create left panels
73-
h = panelMaker(h,'Preparation',forCompiling);
74-
h = panelMaker(h,'Fit Model',forCompiling);
75-
h = panelMaker(h,'Analysis',forCompiling);
73+
h = panelMaker(h,'Preparation',isdeployed);
74+
h = panelMaker(h,'Fit Model',isdeployed);
75+
h = panelMaker(h,'Analysis',isdeployed);
7676

7777
% Create panel for loading and storing files
7878
h.left.loadStore.panel = uipanel('Parent',h.left.main,'units','normalized','Position',[0 0 1 0.1],'Title','Load/save files','FontSize',10);%,'ShadowColor',[0.95 0.95 0.95],'ForegroundColor',[0.95 0.95 0.95],'HighlightColor',[0.95 0.95 0.95],'BackgroundColor',[0.95 0.95 0.95]);
7979
h.left.loadStore.load = uicontrol('Parent',h.left.loadStore.panel,'units','normalized','Position',[0.02 0.2 0.47 0.75],'String','Load','FontSize',10);
8080
h.left.loadStore.save = uicontrol('Parent',h.left.loadStore.panel,'units','normalized','Position',[0.49 0.2 0.47 0.75],'String','Save','FontSize',10,'Enable','off');
8181

82-
% Create image of StatSTEM
83-
if forCompiling
84-
imgPan = imread('imgGui.png');
85-
else
86-
imgPan = imread([pathG,filesep,'imgGui.png']);
87-
end
8882
h = panelStatSTEM(h,imgPan);
8983

9084
%% Create right panels
@@ -156,7 +150,7 @@ function StatSTEM()
156150
% Limit minimum size and make window appear on full screen
157151
% set(h.fig,'Position',[1 1 screen(3) screen(4)])
158152
set(h.fig,'Visible','on')
159-
if ~forCompiling
153+
if ~isdeployed
160154
close(spl) % Close splash window
161155
end
162156
waitfor(h.fig,'Visible','on')

0 commit comments

Comments
 (0)