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
!29
Add config Class, Implement Wizard
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add config Class, Implement Wizard
40-feature-advanced-meta-data-in-json-file
into
development
Overview
0
Commits
6
Pipelines
1
Changes
11
Merged
Lemmer, Jan
requested to merge
40-feature-advanced-meta-data-in-json-file
into
development
3 years ago
Overview
0
Commits
6
Pipelines
1
Changes
11
Expand
#53 (closed)
,
#63 (closed)
Closes
#40 (closed)
0
0
Merge request reports
Compare
development
development (base)
and
latest version
latest version
75e1a369
6 commits,
3 years ago
11 files
+
237
−
124
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
11
Search (e.g. *.vue) (Ctrl+P)
+PlotID/@config/config.m
0 → 100644
+
70
−
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
=
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
);
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
% TODo;
outputArg
=
true
;
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