Skip to content

Commit 73bd0fa

Browse files
author
Usseglio-Viretta
committed
Documentation link fixed
1 parent b4e6274 commit 73bd0fa

12 files changed

+90
-28
lines changed
73.7 KB
Binary file not shown.

src/Create_mesh_for_FEM/microstructure_meshing_exported.m

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,16 @@
574574
app.Assemble_VisualizecellButton.Enable = 'on';
575575
app.Assemble_SavecellButton.Enable = 'on';
576576
end
577+
578+
function currentDir = getcurrentdir(app)
579+
if isdeployed % Stand-alone mode.
580+
[status, result] = system('path');
581+
currentDir = char(regexpi(result, 'Path=(.*?);', 'tokens', 'once'));
582+
else % MATLAB mode.
583+
currentDir = pwd;
584+
end
585+
586+
end
577587
end
578588

579589

@@ -611,25 +621,31 @@ function startupFcn(app)
611621
data_ = [{'keepratio';'maxvol'} {str_keepratio;str_maxvol} num2cell([1;10])];
612622
app.Meshdensity_UITable.Data=data_;
613623

614-
app.Iso2meshversionnumberLabel.Text = ['Iso2mesh version number: ' iso2meshver];
615-
624+
iso2mesh_is_installed = exist('iso2meshver');
625+
if iso2mesh_is_installed
626+
app.Iso2meshversionnumberLabel.Text = ['Iso2mesh version number: ' iso2meshver];
627+
else
628+
warning('Iso2mesh is not installed: you can do pre-processing tasks and create regular (structured) mesh, but you cannot create unstrucured mesh. Please look at documentation to know how to install Iso2mesh before continuing');
629+
end
616630
app.EachvoxelwillberepresentedwithDropDownValueChanged;
617631
end
618632

619633
% Button pushed function: OpendocumentationButton
620634
function OpendocumentationButtonPushed(app, event)
621-
path = matlab.desktop.editor.getActiveFilename; % Path of active file
622-
higherlevelfolder = extractBetween(path,path(1:5),'MATBOX_Microstructure_analysis_toolbox_dev\','Boundaries','inclusive');
635+
% path = matlab.desktop.editor.getActiveFilename; % Path of active file (but does not work for app file)
636+
path = app.getcurrentdir;
623637
if ispc
624-
documentation_path = [char(higherlevelfolder) 'Documentation\MATBOX_Microstructure_analysis_toolbox_documentation.pdf'];
638+
separation_folder = '\';
625639
else
626-
documentation_path = [char(higherlevelfolder) 'Documentation/MATBOX_Microstructure_analysis_toolbox_documentation.pdf'];
640+
separation_folder = '/';
627641
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'];
628644
if exist(documentation_path,'file')
629645
open(documentation_path);
630646
else
631-
disp 'MATLAB did not find the file MATBOX_Microstructure_analysis_toolbox_documentation.pdf'.
632-
disp 'Default location is \Microstructure_analysis_toolbox\Documentation\';
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\';
633649
end
634650
end
635651

740 Bytes
Binary file not shown.

src/Filtering_and_segmentation/Segmentation_exported.m

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,14 @@
10291029
set(app.Scaling_UIAxes_after,'YDir','normal');
10301030
end
10311031

1032-
1032+
function currentDir = getcurrentdir(app)
1033+
if isdeployed % Stand-alone mode.
1034+
[status, result] = system('path');
1035+
currentDir = char(regexpi(result, 'Path=(.*?);', 'tokens', 'once'));
1036+
else % MATLAB mode.
1037+
currentDir = pwd;
1038+
end
1039+
end
10331040

10341041
end
10351042

@@ -4558,18 +4565,20 @@ function Segmentation_SmoothSliceThreshold_CheckBoxValueChanged(app, event)
45584565

45594566
% Menu selected function: DocumentationMenu
45604567
function DocumentationMenuSelected(app, event)
4561-
path = matlab.desktop.editor.getActiveFilename; % Path of active file
4562-
higherlevelfolder = extractBetween(path,path(1:5),'Microstructure_analysis_toolbox\','Boundaries','inclusive');
4568+
% path = matlab.desktop.editor.getActiveFilename; % Path of active file (but does not work for app file)
4569+
path = app.getcurrentdir;
45634570
if ispc
4564-
documentation_path = [char(higherlevelfolder) 'Documentation\NREL_Microstructure_analysis_toolbox_documentation.pdf'];
4571+
separation_folder = '\';
45654572
else
4566-
documentation_path = [char(higherlevelfolder) 'Documentation/NREL_Microstructure_analysis_toolbox_documentation.pdf'];
4573+
separation_folder = '/';
45674574
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'];
45684577
if exist(documentation_path,'file')
45694578
open(documentation_path);
45704579
else
4571-
disp 'MATLAB did not find the file NREL_Microstructure_analysis_toolbox_documentation.pdf'.
4572-
disp 'Default location is \Microstructure_analysis_toolbox\Documentation\';
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\';
45734582
end
45744583
end
45754584
end
@@ -4584,6 +4593,7 @@ function createComponents(app)
45844593
app.ROIfilteringandsegmentationmoduleUIFigure = uifigure('Visible', 'off');
45854594
app.ROIfilteringandsegmentationmoduleUIFigure.Position = [100 100 998 776];
45864595
app.ROIfilteringandsegmentationmoduleUIFigure.Name = 'ROI, filtering and segmentation module';
4596+
app.ROIfilteringandsegmentationmoduleUIFigure.Icon = 'Icon_ROI.png';
45874597

45884598
% Create VolumeMenu
45894599
app.VolumeMenu = uimenu(app.ROIfilteringandsegmentationmoduleUIFigure);

src/Main_menu/Main_menu.mlapp

546 Bytes
Binary file not shown.

src/Main_menu/Main_menu_exported.m

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@
2121
Generation_DropDown matlab.ui.control.DropDown
2222
end
2323

24+
25+
methods (Access = private)
26+
27+
function currentDir = getcurrentdir(app)
28+
if isdeployed % Stand-alone mode.
29+
[status, result] = system('path');
30+
currentDir = char(regexpi(result, 'Path=(.*?);', 'tokens', 'once'));
31+
else % MATLAB mode.
32+
currentDir = pwd;
33+
end
34+
end
35+
36+
end
37+
38+
2439
% Callbacks that handle component events
2540
methods (Access = private)
2641

@@ -81,18 +96,20 @@ function RepositoryButtonPushed(app, event)
8196

8297
% Button pushed function: DocumentationButton
8398
function DocumentationButtonPushed(app, event)
84-
path = matlab.desktop.editor.getActiveFilename; % Path of active file
85-
higherlevelfolder = extractBetween(path,path(1:5),'MATBOX_Microstructure_analysis_toolbox_dev\','Boundaries','inclusive');
99+
% path = matlab.desktop.editor.getActiveFilename; % Path of active file (but does not work for app file)
100+
path = app.getcurrentdir;
86101
if ispc
87-
documentation_path = [char(higherlevelfolder) 'Documentation\MATBOX_Microstructure_analysis_toolbox_documentation.pdf'];
102+
separation_folder = '\';
88103
else
89-
documentation_path = [char(higherlevelfolder) 'Documentation/MATBOX_Microstructure_analysis_toolbox_documentation.pdf'];
104+
separation_folder = '/';
90105
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'];
91108
if exist(documentation_path,'file')
92109
open(documentation_path);
93110
else
94-
disp 'MATLAB did not find the file MATBOX_Microstructure_analysis_toolbox_documentation.pdf'.
95-
disp 'Default location is \Microstructure_analysis_toolbox\Documentation\';
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\';
96113
end
97114
end
98115
end
File renamed without changes.
Binary file not shown.
Binary file not shown.

src/Microstructure_generation/Microstructure_generation_additives_exported.m

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@
130130
app.Turn_on_off('on',app.OutcomeTab)
131131
app.TabGroup.SelectedTab = app.OutcomeTab; % Go to outcome tab
132132
end
133+
134+
function currentDir = getcurrentdir(app)
135+
if isdeployed % Stand-alone mode.
136+
[status, result] = system('path');
137+
currentDir = char(regexpi(result, 'Path=(.*?);', 'tokens', 'once'));
138+
else % MATLAB mode.
139+
currentDir = pwd;
140+
end
141+
end
142+
133143
end
134144

135145

@@ -625,19 +635,21 @@ function O_savefolderButtonPushed(app, event)
625635

626636
% Button pushed function: OpendocumentationButton
627637
function OpendocumentationButtonPushed(app, event)
628-
path = matlab.desktop.editor.getActiveFilename; % Path of active file
629-
higherlevelfolder = extractBetween(path,path(1:5),'MATBOX_Microstructure_analysis_toolbox_dev\','Boundaries','inclusive');
638+
% path = matlab.desktop.editor.getActiveFilename; % Path of active file (but does not work for app file)
639+
path = app.getcurrentdir;
630640
if ispc
631-
documentation_path = [char(higherlevelfolder) 'Documentation\MATBOX_Microstructure_analysis_toolbox_documentation.pdf'];
641+
separation_folder = '\';
632642
else
633-
documentation_path = [char(higherlevelfolder) 'Documentation/MATBOX_Microstructure_analysis_toolbox_documentation.pdf'];
643+
separation_folder = '/';
634644
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'];
635647
if exist(documentation_path,'file')
636648
open(documentation_path);
637649
else
638-
disp 'MATLAB did not find the file MATBOX_Microstructure_analysis_toolbox_documentation.pdf'.
639-
disp 'Default location is \Microstructure_analysis_toolbox\Documentation\';
640-
end
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
641653
end
642654

643655
% Image clicked function: About_Logo_NREL

0 commit comments

Comments
 (0)