Skip to content

Commit

Permalink
Add project Startup and Shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
eszmw committed Aug 25, 2023
1 parent be0df2e commit b63d364
Show file tree
Hide file tree
Showing 31 changed files with 56 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions Utilities/ProjectShutdown.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
function ProjectShutdown
% Open the overview file

% Set up check for version number
proj = currentProject;
myPath = fullfile(proj.RootFolder,"Models");
if isMATLABReleaseOlderThan("R2023b")
cd(proj.RootFolder)
try
if exist(fullfile("Utilities","OldVersions","MainMenuNew.mlx"),"file")
movefile("MainMenu.mlx", fullfile("Utilities","OldVersions","MainMenuOld.mlx"))
movefile(fullfile("Utilities","OldVersions","MainMenuNew.mlx"),fullfile(proj.RootFolder,"MainMenu.mlx"))
end
catch
disp("Failed to move MainMenu.mlx.")
end
try
if exist(fullfile("Utilities","Oldersions","READMENew.mlx"),"file")
movefile("README.mlx", fullfile("Utilities","OldVersions","READMEOld.mlx"))
movefile(fullfile("Utilities","Oldersions","READMENew.mlx"),fullfile(proj.RootFolder,"README.mlx"))
end
catch
disp("Failed to move README.mlx.")
end
if isMATLABReleaseOlderThan("R2022b")
% Nothing to change
elseif isMATLABReleaseOlderThan("R2023a")
rmpath(fullfile(myPath,"Models22b"))
else
rmpath(fullfile(myPath,"Models23a"))
end
else
rmpath(fullfile(myPath,"Models23a"))
end
end
6 changes: 3 additions & 3 deletions Utilities/StartupScript.m → Utilities/Startup.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
if isMATLABReleaseOlderThan("R2022b")
disp(str + " so it may not run this example which was built in R2022b.")
elseif isMATLABReleaseOlderThan("R2023a")
addpath(myPath+filesep+"Models22b")
addpath(fullfile(myPath,"Models22b"))
else
% Fix path to run R2023a files
addpath(myPath+filesep+"Models23a")
addpath(fullfile(myPath,"Models23a"))
end
else
% Fix path to run R2023a files, for now?
disp(str + " and this was designed using R2022b.")
disp("If you find errors, please report them to [email protected]")
addpath(myPath+filesep+"Models23a")
addpath(fullfile(myPath,"Models23a"))
end
StartUpFcn
end

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info File="Utilities/ProjectShutdown.m" GroupUUID="" Icon="" Name="ProjectShutdown" Type="Shutdown" Visible="0"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="e6416641-f09d-4367-a068-040d06e8894b" type="EntryPoint"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info File="Utilities/Startup.m" GroupUUID="" Icon="" Name="Startup" Type="StartUp" Visible="0"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="3ecdb3c9-e943-4096-ad17-43aa8c880617" type="EntryPoint"/>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="ProjectShutdown.m" type="File"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="Startup.m" type="File"/>

0 comments on commit b63d364

Please sign in to comment.