Skip to content
Snippets Groups Projects

Dev/config

Merged Lemmer, Jan requested to merge dev/config into development
4 files
+ 27
43
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 12
4
@@ -3,6 +3,11 @@ classdef config < handle
%file
% Detailed explanation goes here
% handle class used for dynamicy property updates
properties (SetAccess = private)
mandatoryFields = {'Author', 'ProjectID'}
optionFields
end
properties (SetAccess = protected)
configData
@@ -17,7 +22,8 @@ classdef config < handle
try
txt = fileread(obj.configFileName);
obj.configData = jsondecode(txt);
checkConfig(obj);
assert(checkConfig(obj));
catch
msg = ['no valid config File with the filename ',...
obj.configFileName, ' found.' newline,...
@@ -34,8 +40,10 @@ classdef config < handle
function outputArg = checkConfig(obj)
%checkConfig validates the config file
% TODo;
outputArg = true;
% 1. Check if mandatory Fields are set
check = isfield(obj.configData,obj.mandatoryFields);
outputArg = all(check);
end
function writeConfig(obj,path)
@@ -50,7 +58,7 @@ classdef config < handle
function configData = addPublishOptions(obj,mode)
%writeConfig writes the config file to path
% TODo;
% TODo;
obj.configData.options = obj.plotID_options(mode);
end
Loading