Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
plotID_matlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
plotID
plotID_matlab
Commits
5e3e7f0e
Commit
5e3e7f0e
authored
3 years ago
by
Lemmer, Jan
Browse files
Options
Downloads
Patches
Plain Diff
Implements
#96
parent
4084e264
No related branches found
No related tags found
2 merge requests
!62
Introduce changes for V1.0 RC 1
,
!55
Implements #96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
+PlotID/copyUserFCN.m
+25
-0
25 additions, 0 deletions
+PlotID/copyUserFCN.m
+PlotID/createFileCopy.m
+2
-0
2 additions, 0 deletions
+PlotID/createFileCopy.m
with
27 additions
and
0 deletions
+PlotID/copyUserFCN.m
+
25
−
0
View file @
5e3e7f0e
function
pList
=
copyUserFCN
(
scriptPath
,
folderName
,
storPath
,
ID
)
%COPYUSERFCN copies all user functions, classes and toolboxes that are used
%by the base script (scriptpath).
% folderName, storPath and ID are required for createfilecopy
[
fList
,
pList
]
=
matlab
.
codetools
.
requiredFilesAndProducts
(
scriptPath
);
fList
=
fList
(
~
ismember
(
fList
,
scriptPath
));
% rmv plot script itself from list
fList
=
fList
(
~
contains
(
fList
,
'config.json'
));
% rmv config.json from list
fList
=
removePltIdFiles
(
fList
);
% Do not copy files that are part of PlotID
% copy Classes and Toolboxes as a whole
copyTBorClass
(
fList
,
'+'
,
folderName
,
storPath
,
ID
);
% Toolboxes
copyTBorClass
(
fList
,
'@'
,
folderName
,
storPath
,
ID
);
% Classes
%remove class and toolbox files from flist
fList
=
fList
(
~
contains
(
fList
,{
'@'
,
'+'
}));
% copy User FCN
if
~
isempty
(
fList
)
PlotID
.
createFileCopy
(
fList
,
folderName
,
storPath
,
ID
,
'userFcn'
);
end
...
...
@@ -32,4 +43,18 @@ function [fListClean] = removePltIdFiles(fList)
PltID_flist
=
[
packageContent
.
m
;
Class_flist
];
% Comparison and filter
fListClean
=
fList
(
~
ismember
(
names
,
PltID_flist
));
end
function
[
status
,
msg
]
=
copyTBorClass
(
fList
,
leadChar
,
folderName
,
storPath
,
ID
)
%copyTBorClass copies the Toolboxes or Classes that are part of flist
% lead char must be either '@' for Classes or '+' for Toolboxes
if
any
(
contains
(
fList
,
leadChar
))
list
=
fList
(
contains
(
fList
,
leadChar
));
names
=
extractBetween
(
list
,
leadChar
,
filesep
);
paths
=
extractBefore
(
list
,
strcat
(
leadChar
,
names
));
fullPaths
=
strcat
(
paths
,
strcat
(
leadChar
,
names
));
fullPaths
=
unique
(
fullPaths
);
[
~
,
status
,
msg
]
=
PlotID
.
createFileCopy
(
fullPaths
,
...
folderName
,
storPath
,
ID
,
'class'
);
end
%if
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
+PlotID/createFileCopy.m
+
2
−
0
View file @
5e3e7f0e
...
...
@@ -29,6 +29,8 @@ end
case
'userFcn'
%keep original name
newfile
=
sprintf
([
name
,
ext
]);
case
{
'class'
,
'toolbox'
}
newfile
=
name
;
% copy whole folder
otherwise
error
([
type
,
' is not a valid type for createFileCopy'
])
end
%switch
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment