Skip to content

Commit f0cde6b

Browse files
author
Usseglio-Viretta
committed
Fixed documentation link
1 parent 7e9873d commit f0cde6b

File tree

9 files changed

+23
-60
lines changed

9 files changed

+23
-60
lines changed
-1.16 KB
Binary file not shown.

src/Create_mesh_for_FEM/microstructure_meshing_exported.m

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -632,21 +632,7 @@ function startupFcn(app)
632632

633633
% Button pushed function: OpendocumentationButton
634634
function OpendocumentationButtonPushed(app, event)
635-
% path = matlab.desktop.editor.getActiveFilename; % Path of active file (but does not work for app file)
636-
path = app.getcurrentdir;
637-
if ispc
638-
separation_folder = '\';
639-
else
640-
separation_folder = '/';
641-
end
642-
higherlevelfolder = extractBetween(path,path(1:5),['MATBOX_Microstructure_analysis_toolbox' separation_folder],'Boundaries','inclusive');
643-
documentation_path = [char(higherlevelfolder) 'Documentation' separation_folder 'NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf'];
644-
if exist(documentation_path,'file')
645-
open(documentation_path);
646-
else
647-
disp 'MATLAB did not find the file NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf'.
648-
disp 'Default location is \MATBOX_Microstructure_analysis_toolbox\Documentation\';
649-
end
635+
Find_file('NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf','MATBOX_Microstructure_analysis_toolbox','Default location is \MATBOX_Microstructure_analysis_toolbox\Documentation\');
650636
end
651637

652638
% Image clicked function: About_Logo_NREL
-536 Bytes
Binary file not shown.

src/Filtering_and_segmentation/Segmentation_exported.m

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4565,21 +4565,7 @@ function Segmentation_SmoothSliceThreshold_CheckBoxValueChanged(app, event)
45654565

45664566
% Menu selected function: DocumentationMenu
45674567
function DocumentationMenuSelected(app, event)
4568-
% path = matlab.desktop.editor.getActiveFilename; % Path of active file (but does not work for app file)
4569-
path = app.getcurrentdir;
4570-
if ispc
4571-
separation_folder = '\';
4572-
else
4573-
separation_folder = '/';
4574-
end
4575-
higherlevelfolder = extractBetween(path,path(1:5),['MATBOX_Microstructure_analysis_toolbox' separation_folder],'Boundaries','inclusive');
4576-
documentation_path = [char(higherlevelfolder) 'Documentation' separation_folder 'NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf'];
4577-
if exist(documentation_path,'file')
4578-
open(documentation_path);
4579-
else
4580-
disp 'MATLAB did not find the file NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf'.
4581-
disp 'Default location is \MATBOX_Microstructure_analysis_toolbox\Documentation\';
4582-
end
4568+
Find_file('NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf','MATBOX_Microstructure_analysis_toolbox','Default location is \MATBOX_Microstructure_analysis_toolbox\Documentation\');
45834569
end
45844570
end
45854571

src/Main_menu/Main_menu.mlapp

-515 Bytes
Binary file not shown.

src/Main_menu/Main_menu_exported.m

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,7 @@ function RepositoryButtonPushed(app, event)
9696

9797
% Button pushed function: DocumentationButton
9898
function DocumentationButtonPushed(app, event)
99-
% path = matlab.desktop.editor.getActiveFilename; % Path of active file (but does not work for app file)
100-
path = app.getcurrentdir;
101-
if ispc
102-
separation_folder = '\';
103-
else
104-
separation_folder = '/';
105-
end
106-
higherlevelfolder = extractBetween(path,path(1:5),['MATBOX_Microstructure_analysis_toolbox' separation_folder],'Boundaries','inclusive');
107-
documentation_path = [char(higherlevelfolder) 'Documentation' separation_folder 'NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf'];
108-
if exist(documentation_path,'file')
109-
open(documentation_path);
110-
else
111-
disp 'MATLAB did not find the file NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf'.
112-
disp 'Default location is \MATBOX_Microstructure_analysis_toolbox\Documentation\';
113-
end
99+
Find_file('NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf','MATBOX_Microstructure_analysis_toolbox','Default location is \MATBOX_Microstructure_analysis_toolbox\Documentation\');
114100
end
115101
end
116102

Binary file not shown.

src/Microstructure_generation/Microstructure_generation_additives_exported.m

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -635,21 +635,7 @@ function O_savefolderButtonPushed(app, event)
635635

636636
% Button pushed function: OpendocumentationButton
637637
function OpendocumentationButtonPushed(app, event)
638-
% path = matlab.desktop.editor.getActiveFilename; % Path of active file (but does not work for app file)
639-
path = app.getcurrentdir;
640-
if ispc
641-
separation_folder = '\';
642-
else
643-
separation_folder = '/';
644-
end
645-
higherlevelfolder = extractBetween(path,path(1:5),['MATBOX_Microstructure_analysis_toolbox' separation_folder],'Boundaries','inclusive');
646-
documentation_path = [char(higherlevelfolder) 'Documentation' separation_folder 'NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf'];
647-
if exist(documentation_path,'file')
648-
open(documentation_path);
649-
else
650-
disp 'MATLAB did not find the file NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf'.
651-
disp 'Default location is \MATBOX_Microstructure_analysis_toolbox\Documentation\';
652-
end
638+
Find_file('NREL_MATBOX_Microstructure_analysis_toolbox_documentation.pdf','MATBOX_Microstructure_analysis_toolbox','Default location is \MATBOX_Microstructure_analysis_toolbox\Documentation\');
653639
end
654640

655641
% Image clicked function: About_Logo_NREL

src/Miscellaneous/Find_file.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
function [] = Find_file(filename,str_end,errormessage)
2+
if ispc
3+
separation_folder = '\';
4+
else
5+
separation_folder = '/';
6+
end
7+
path_app = mfilename('fullpath');
8+
higherlevelfolder = extractBetween(path_app,path_app(1:5),str_end,'Boundaries','inclusive');
9+
filepath_path = [char(higherlevelfolder) separation_folder 'Documentation' separation_folder filename];
10+
if exist(filepath_path,'file')
11+
open(filepath_path);
12+
else
13+
warning(['MATLAB did not find the file ' filename]);
14+
if ~isempty(errormessage)
15+
warning(errormessage);
16+
end
17+
end
18+
end
19+

0 commit comments

Comments
 (0)