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
Merge requests
!30
Fix CI
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix CI
dev/config
into
master
Overview
0
Commits
51
Pipelines
2
Changes
24
Merged
Lemmer, Jan
requested to merge
dev/config
into
master
3 years ago
Overview
0
Commits
51
Pipelines
2
Changes
24
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
f761a5ae
51 commits,
3 years ago
24 files
+
669
−
257
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
24
Search (e.g. *.vue) (Ctrl+P)
+PlotID/@config/config.m
0 → 100644
+
78
−
0
Options
classdef
config
<
handle
%CONFIG class handles methoths and attributes related to the config
%file
% Detailed explanation goes here
% handle class used for dynamicy property updates
properties
(
SetAccess
=
private
)
mandatoryFields
=
{
'Author'
,
'ProjectID'
}
optionFields
end
properties
(
SetAccess
=
protected
)
configData
configFileName
end
methods
function
obj
=
config
(
configFileName
)
%CONFIG Construct an instance of this class
% Detailed explanation goes here
obj
.
configFileName
=
configFileName
;
try
txt
=
fileread
(
obj
.
configFileName
);
obj
.
configData
=
jsondecode
(
txt
);
assert
(
checkConfig
(
obj
));
catch
msg
=
[
'no valid config File with the filename '
,
...
obj
.
configFileName
,
' found.'
newline
,
...
'Please enter the required information manually'
];
disp
(
msg
);
obj
.
configData
=
obj
.
wizard
(
'initilise'
);
m
=
input
(
'Do you want to save the config, Y/N [Y]:'
,
's'
);
if
ismember
(
m
,{
'Y'
,
'y'
})
obj
.
writeConfig
(
fullfile
(
pwd
));
end
end
%try
end
function
outputArg
=
checkConfig
(
obj
)
%checkConfig validates the config file
% 1. Check if mandatory Fields are set
check
=
isfield
(
obj
.
configData
,
obj
.
mandatoryFields
);
outputArg
=
all
(
check
);
end
function
writeConfig
(
obj
,
path
)
%writeConfig writes the config file to path
% TODo;
fid
=
fopen
(
fullfile
(
path
,
obj
.
configFileName
),
'w'
);
txt
=
jsonencode
(
obj
.
configData
,
'PrettyPrint'
,
true
);
%fprintf does not write paths correctly !!!
fwrite
(
fid
,
txt
);
fclose
(
fid
);
end
function
configData
=
addPublishOptions
(
obj
,
mode
)
%writeConfig writes the config file to path
% TODo;
obj
.
configData
.
options
=
obj
.
plotID_options
(
mode
);
end
function
outputArg
=
method1
(
obj
,
inputArg
)
%METHOD1 Summary of this method goes here
% Detailed explanation goes here
outputArg
=
obj
.
Property1
+
inputArg
;
end
end
methods
(
Static
)
configStruct
=
wizard
(
mode
)
optionStruct
=
plotID_options
(
input
)
end
end
Loading