Skip to content
Snippets Groups Projects

Introduce changes for V1.0 RC 1

Merged Lemmer, Jan requested to merge development into master
23 files
+ 495
192
Compare changes
  • Side-by-side
  • Inline
Files
23
+ 14
6
classdef config < handle
%CONFIG class handles methods and attributes related to the config
% CONFIG class handles methods and attributes related to the config
%file
%handle class used for dynamicy property updates
% handle class used for dynamicy property updates
properties (SetAccess = private)
mandatoryFields = {'Author', 'ProjectID'}
@@ -21,15 +21,23 @@ classdef config < handle
% reads config data from config file, if an error occurs the
% wizard is started by the catch block
obj.configFileName = configFileName;
try
txt = fileread(obj.configFileName);
try %Validity Check
tmp = what("PlotID");
tmp = strrep(tmp.path,'+PlotID','');
defaultConfigPath = fullfile(tmp,obj.configFileName);
if isfile(defaultConfigPath)
txt = fileread(defaultConfigPath);
else %search on path
txt = fileread(obj.configFileName);
end
obj.configData = jsondecode(txt);
assert(checkConfig(obj));
if isfield(obj.configData,'ExportPath')
obj.exportPath = obj.configData.ExportPath;
obj.configData.options.Location = 'exportPath';
end
catch
catch
msg = ['no valid config File with the filename ',...
obj.configFileName, ' found.' newline,...
'Please enter the required information manually'];
@@ -45,7 +53,7 @@ classdef config < handle
function outputArg = checkConfig(obj)
%checkConfig validates the config file
% 1. Check if mandatory Fields are set
% 1. check if mandatory fields are set
check = isfield(obj.configData,obj.mandatoryFields);
outputArg = all(check);
Loading