Skip to content
Snippets Groups Projects

Development

Merged Lemmer, Jan requested to merge development into dev/CI_testing
9 files
+ 193
48
Compare changes
  • Side-by-side
  • Inline
Files
9
+ 80
0
classdef userDLG
%userDLG the userDLG Class is responsible for the user dialog
% error handeling, user messages and warnings will be provided from
% this class, depending on the user options and error type.
% This reduces messaging overhead and code length in PlotID.Publish()
properties
configError = false
scriptPublished = false
rdFilesPublished = false
figurePublished = false
msg = ''
end
properties (SetAccess = protected)
success = false
showMessages {mustBeNumericOrLogical}
forcePublish {mustBeNumericOrLogical}
ID %plotID
end
methods
function obj = userDLG(ID,options)
%CATCHERROR Construct an instance of this class
if isempty(ID)
ID = '';
end
obj.ID = ID;
obj.showMessages = options.ShowMessages;
obj.forcePublish = options.ForcePublish;
end
function output = get.success(obj)
% checks if all publish operations are true
obj.success = all([obj.scriptPublished; obj.rdFilesPublished;...
obj.figurePublished]);
output = obj.success;
end
function obj = set.msg(obj,message)
%setmsg Summary of this method goes here
% Detailed explanation goes here
obj.msg = message;
end
function [] = userMSG(obj,message)
%userMSG user message without priority
% MSG will only be displaye if ShowMessages is true
if obj.showMessages
disp(message);
end
end
function [] = error(obj,message)
%error handles critical errors
% critical errors will always result in a matlab error
%ToDO: Add function(s) before termination
error(message);
end
function [] = softError(obj,message)
%softError handles soft errors
% soft errors can be changed to warning if ForcePublish is
% selected by the user
if obj.forcePublish
warning(message);
else
error(message);
end
end
function outputArg = method1(obj,inputArg)
%METHOD1 Summary of this method goes here
% Detailed explanation goes here
outputArg = obj.Property1 + inputArg;
end
end
end
Loading