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
e080002e
Commit
e080002e
authored
3 years ago
by
Lemmer, Jan
Browse files
Options
Downloads
Patches
Plain Diff
Solves Issues regarding multiple publishing
parent
4705d07a
No related branches found
No related tags found
2 merge requests
!43
Implements #73, cleans up example file,
,
!35
Solves Issues regarding multiple publishing
Pipeline
#592842
passed
3 years ago
Stage: Run
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
+PlotID/@userDLG/userDLG.m
+14
-0
14 additions, 0 deletions
+PlotID/@userDLG/userDLG.m
+PlotID/Publish.m
+18
-5
18 additions, 5 deletions
+PlotID/Publish.m
.gitignore
+2
-2
2 additions, 2 deletions
.gitignore
with
34 additions
and
7 deletions
+PlotID/@userDLG/userDLG.m
+
14
−
0
View file @
e080002e
...
...
@@ -43,6 +43,20 @@ classdef userDLG
obj
.
msg
=
message
;
end
function
[
status
]
=
userDialog
(
obj
,
dialogMessage
,
errorMessage
)
%userDialog displays Y/N user input
% if the user selects no an Error will be thrown
m
=
''
;
while
~
ismember
(
m
,{
'Y'
,
'y'
,
'n'
,
'N'
})
m
=
input
([
dialogMessage
,
', Y/N [Y]? '
],
's'
);
end
if
ismember
(
m
,{
'Y'
,
'y'
})
status
=
true
;
else
obj
.
error
(
errorMessage
)
end
end
function
[]
=
userMSG
(
obj
,
message
)
%userMSG user message without priority
% MSG will only be displaye if ShowMessages is true
...
...
This diff is collapsed.
Click to expand it.
+PlotID/Publish.m
+
18
−
5
View file @
e080002e
...
...
@@ -107,12 +107,23 @@ switch options.Location
end
folderName
=
[
'.'
,
char
(
ID
)];
%hidden folder
folderNameV
=
char
(
ID
);
%visible Folder
%% Create data directory
overwriteDir
=
false
;
% if invisible Folder exists, delete it (publish was not succesfull before)
if
isfolder
(
fullfile
(
storPath
,
folderName
))
dlgObj
.
error
([
'Folder '
,
folderName
,
' exists - Plot was already published '
]);
elseif
mkdir
(
fullfile
(
storPath
,
folderName
))
else
rmdir
(
fullfile
(
storPath
,
folderName
),
's'
)
end
% if folder already published: ask User
if
isfolder
(
fullfile
(
storPath
,
folderNameV
))
msg
=
[
'Folder '
,
folderNameV
,
' exists - Plot was already published '
];
disp
(
msg
);
dialogMsg
=
'Do you want to overwrite the existing files'
;
overwriteDir
=
dlgObj
.
userDialog
(
dialogMsg
,
msg
);
end
% create folder
if
~
mkdir
(
fullfile
(
storPath
,
folderName
))
dlgObj
.
error
(
'Directory could not be created - check remote path and permissions'
);
end
disp
([
'publishing of '
,
ID
,
' started'
]);
...
...
@@ -239,9 +250,11 @@ end
if
dlgObj
.
success
||
options
.
ForcePublish
oldPath
=
fullfile
(
storPath
,
folderName
);
newPath
=
strrep
(
oldPath
,
'.'
,
''
);
%remov dot
if
overwriteDir
rmdir
(
newPath
,
's'
);
dlgObj
.
userMSG
([
'old export '
,
folderNameV
,
' deleted'
]);
end
status
=
movefile
(
oldPath
,
newPath
);
%rename directory
else
% error from userDlg class!
end
if
status
...
...
This diff is collapsed.
Click to expand it.
.gitignore
+
2
−
2
View file @
e080002e
...
...
@@ -29,7 +29,8 @@ codegen/
# Personal test files
test*.m
test123_data.h5
test*.h5
cleanUP.m
# files that are created in example.m
...
...
@@ -41,7 +42,6 @@ unused*/*
# Octave session info
octave-workspace
test_data.mat
#logs
log.txt
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