diff --git a/code/classes/SCDclass_mdspar.m b/code/classes/SCDclass_mdspar.m index bf736f6fcb584b07a20fede9f852bcc916ed659c..021e55cec9a0d9107b97b11a2b95418aac1ac621 100644 --- a/code/classes/SCDclass_mdspar.m +++ b/code/classes/SCDclass_mdspar.m @@ -19,7 +19,6 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous modelname % name of the Simulink model using the parameter getcommand % full command for getting the value (callable by matlab eval) classname % class name for logging - cparser % constructor parameters parser assignvar % actualizedata specific assignstring % actualizedata specific @@ -34,37 +33,37 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous methods - function obj=SCDclass_mdspar() - obj.cparser=inputParser; - addRequired(obj.cparser,'srctdimodel',@(x) ischar(x)); - addRequired(obj.cparser,'destparam',@(x) ischar(x)); - addParameter(obj.cparser,'srcsrv','tcvdata',@(x) ischar(x)); - addParameter(obj.cparser,'srctree','tcv_shot',@(x) ischar(x)); - addParameter(obj.cparser,'srctdishot','',@(x) ischar(x)); - addParameter(obj.cparser,'modelname','',@(x) ischar(x)); - addParameter(obj.cparser,'datadictname','',@(x) ischar(x)); - addParameter(obj.cparser,'modeltpstruct','',@(x) ischar(x)); % desttp ? - - obj.verbose=1; - end - - function obj=parseconstructorcommon(obj, srctdimodel, destparam, varargin) - parse(obj.cparser,srctdimodel,destparam,varargin{:}{:}); + function obj=SCDclass_mdspar(srctdimodel,destparam,varargin) + % MDS source and model destination constructor - obj.mdsserver=obj.cparser.Results.srcsrv; - obj.mdstree=obj.cparser.Results.srctree; - obj.tdiexprmodel=obj.cparser.Results.srctdimodel; - if isempty(obj.cparser.Results.srctdishot) - obj.tdiexprshot=obj.cparser.Results.srctdimodel; + p=inputParser; + addRequired(p,'srctdimodel',@(x) ischar(x)); + addRequired(p,'destparam',@(x) ischar(x)); + addParameter(p,'srcsrv','tcvdata',@(x) ischar(x)); + addParameter(p,'srctree','tcv_shot',@(x) ischar(x)); + addParameter(p,'srctdishot','',@(x) ischar(x)); + addParameter(p,'modelname','',@(x) ischar(x)); + addParameter(p,'datadictname','',@(x) ischar(x)); + addParameter(p,'modeltpstruct','',@(x) ischar(x)); % desttp ? + + parse(p,srctdimodel,destparam,varargin{:}{:}); + + obj.mdsserver=p.Results.srcsrv; + obj.mdstree=p.Results.srctree; + obj.tdiexprmodel=p.Results.srctdimodel; + if isempty(p.Results.srctdishot) + obj.tdiexprshot=p.Results.srctdimodel; else - obj.tdiexprshot=obj.cparser.Results.srctdishot; + obj.tdiexprshot=p.Results.srctdishot; end - obj.modeltargetpar=obj.cparser.Results.destparam; - obj.modelname=obj.cparser.Results.modelname; - obj.datadictionary=obj.cparser.Results.datadictname; - obj.modeltpstruct=obj.cparser.Results.modeltpstruct; + obj.modeltargetpar=p.Results.destparam; + obj.modelname=p.Results.modelname; + obj.datadictionary=p.Results.datadictname; + obj.modeltpstruct=p.Results.modeltpstruct; + obj.verbose=1; end + end % Not abstract methods common to all child classes diff --git a/code/classes/SCDclass_mdspar3Dmatrix.m b/code/classes/SCDclass_mdspar3Dmatrix.m index 693520eb1b96ed2f1feb327896c030f29d362abd..2599175d3ab88881db25d309234585e0815acff8 100644 --- a/code/classes/SCDclass_mdspar3Dmatrix.m +++ b/code/classes/SCDclass_mdspar3Dmatrix.m @@ -7,10 +7,7 @@ classdef SCDclass_mdspar3Dmatrix < SCDclass_mdspar methods function obj=SCDclass_mdspar3Dmatrix(srctdimodel, destparam, varargin) - obj@SCDclass_mdspar(); - % Constructor parser customization definitions here - obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); - % Constructor parser customization results here + obj@SCDclass_mdspar(srctdimodel, destparam, varargin); obj.classname=mfilename; end diff --git a/code/classes/SCDclass_mdsparfixdimvector.m b/code/classes/SCDclass_mdsparfixdimvector.m index fb98b80f6391a0b7147d21fff7cb169c2365c165..8960d27867d15d455bd76424e7be195a9f956b79 100644 --- a/code/classes/SCDclass_mdsparfixdimvector.m +++ b/code/classes/SCDclass_mdsparfixdimvector.m @@ -10,12 +10,9 @@ classdef SCDclass_mdsparfixdimvector < SCDclass_mdspar methods function obj=SCDclass_mdsparfixdimvector(srctdimodel, destparam, destdimension, varargin) - obj@SCDclass_mdspar(); - % Constructor parser customization definitions here - obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); - % Constructor parser customization results here - obj.dimension=destdimension; + obj@SCDclass_mdspar(srctdimodel, destparam, varargin); obj.classname=mfilename; + obj.dimension=destdimension; end function actualizedata(obj, shot) diff --git a/code/classes/SCDclass_mdsparfixdimvectoridx.m b/code/classes/SCDclass_mdsparfixdimvectoridx.m index 47479dbe1e4656d43d48ee7c1bf40b67e43faea6..7340a85f3dc73422465f33d5894273989bdb4909 100644 --- a/code/classes/SCDclass_mdsparfixdimvectoridx.m +++ b/code/classes/SCDclass_mdsparfixdimvectoridx.m @@ -10,17 +10,14 @@ classdef SCDclass_mdsparfixdimvectoridx < SCDclass_mdspar methods function obj=SCDclass_mdsparfixdimvectoridx(srctdimodel, destparam, srcinterval, varargin) - obj@SCDclass_mdspar(); - % Constructor parser customization definitions here - obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); - % Constructor parser customization results here + obj@SCDclass_mdspar(srctdimodel, destparam, varargin); + obj.classname=mfilename; intervalchecker=@(x) isnumeric(x) && min(diff(x))==1 && max(diff(x))==1; assert(intervalchecker(srcinterval)); obj.idxstart=srcinterval(1); obj.idxstop=srcinterval(end); - obj.classname=mfilename; end function actualizedata(obj, shot) diff --git a/code/classes/SCDclass_mdsparfixdimvectorint.m b/code/classes/SCDclass_mdsparfixdimvectorint.m index 9fcc8be56ab87caf894c88ac775de11c34a3ac94..85e685cc316f217d3a68bdbc1ef5d939e70071e2 100644 --- a/code/classes/SCDclass_mdsparfixdimvectorint.m +++ b/code/classes/SCDclass_mdsparfixdimvectorint.m @@ -11,10 +11,7 @@ classdef SCDclass_mdsparfixdimvectorint < SCDclass_mdspar methods function obj=SCDclass_mdsparfixdimvectorint(srctdimodel, destparam, destdimension, varargin) - obj@SCDclass_mdspar(); - % Constructor parser customization definitions here - obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); - % Constructor parser customization results here + obj@SCDclass_mdspar(srctdimodel, destparam, varargin); obj.classname=mfilename; obj.dimension=destdimension; end diff --git a/code/classes/SCDclass_mdsparmatrix.m b/code/classes/SCDclass_mdsparmatrix.m index 686ab6ed806c81eea323b60012594fa011230c4b..f4dfb2479013879884167817a1893fe0c9ce65d0 100644 --- a/code/classes/SCDclass_mdsparmatrix.m +++ b/code/classes/SCDclass_mdsparmatrix.m @@ -7,10 +7,7 @@ classdef SCDclass_mdsparmatrix < SCDclass_mdspar methods function obj=SCDclass_mdsparmatrix(srctdimodel, destparam, varargin) - obj@SCDclass_mdspar(); - % Constructor parser customization definitions here - obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); - % Constructor parser customization results here + obj@SCDclass_mdspar(srctdimodel, destparam, varargin); obj.classname=mfilename; end diff --git a/code/classes/SCDclass_mdsparscalar.m b/code/classes/SCDclass_mdsparscalar.m index 360d0dac721a7e62cf0c35f3131e3732c1e17336..ff88044995217db65e9c62ae1ca96a458dae21a0 100644 --- a/code/classes/SCDclass_mdsparscalar.m +++ b/code/classes/SCDclass_mdsparscalar.m @@ -7,10 +7,8 @@ classdef SCDclass_mdsparscalar < SCDclass_mdspar methods function obj=SCDclass_mdsparscalar(srctdimodel, destparam, varargin) - obj@SCDclass_mdspar(); - % Constructor parser customization definitions here - obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); - % Constructor parser customization results here + obj@SCDclass_mdspar(srctdimodel, destparam, varargin); + obj.getcommand=sprintf('mdsvalue(''%s'')',obj.tdiexprmodel); obj.classname=mfilename; end diff --git a/code/classes/SCDclass_mdsparscalarint.m b/code/classes/SCDclass_mdsparscalarint.m index 67c58167ff57528eadecc23d89523538c52c6392..ea0a158951e6a8fd9d213a8d425b8b398770145d 100644 --- a/code/classes/SCDclass_mdsparscalarint.m +++ b/code/classes/SCDclass_mdsparscalarint.m @@ -6,10 +6,8 @@ classdef SCDclass_mdsparscalarint < SCDclass_mdspar methods function obj=SCDclass_mdsparscalarint(srctdimodel, destparam, varargin) - obj@SCDclass_mdspar(); - % Constructor parser customization definitions here - obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); - % Constructor parser customization results here + obj@SCDclass_mdspar(srctdimodel, destparam, varargin); + obj.getcommand=sprintf('mdsvalue(''%s'')',obj.tdiexprmodel); obj.classname=mfilename; end diff --git a/code/classes/SCDclass_mdsparscalartaridx.m b/code/classes/SCDclass_mdsparscalartaridx.m index a6cea8636c67f8608acb3bf1f6bacb0a1313130e..da86280575fe817dcad3be33ea567310e8ea3319 100644 --- a/code/classes/SCDclass_mdsparscalartaridx.m +++ b/code/classes/SCDclass_mdsparscalartaridx.m @@ -9,10 +9,7 @@ classdef SCDclass_mdsparscalartaridx < SCDclass_mdspar methods function obj=SCDclass_mdsparscalartaridx(srctdimodel, destparam, targetidx, varargin) - obj@SCDclass_mdspar(); - % Constructor parser customization definitions here - obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); - % Constructor parser customization results here + obj@SCDclass_mdspar(srctdimodel, destparam, varargin); obj.targetidx=targetidx; obj.classname=mfilename; end @@ -21,7 +18,8 @@ classdef SCDclass_mdsparscalartaridx < SCDclass_mdspar obj=obj.preactualizecommon(shot); obj.assignstring=sprintf('%s(%d)=%s;',obj.assignvar,obj.targetidx,obj.getcommand); obj.caststring=sprintf('%s=single(%s);',obj.assignvar,obj.assignvar); - obj.postactualizecommon(shot); + obj.postactualizecommon(shot); + end function [obj, value] = getdata(obj, shot) diff --git a/code/classes/SCDclass_mdsparvector.m b/code/classes/SCDclass_mdsparvector.m index 22673b65a200c4b2e33ec50b051f11c61f751345..bff49651ed2154a747e5b1129ace3bfa2eaccedb 100644 --- a/code/classes/SCDclass_mdsparvector.m +++ b/code/classes/SCDclass_mdsparvector.m @@ -7,10 +7,7 @@ classdef SCDclass_mdsparvector < SCDclass_mdspar methods function obj=SCDclass_mdsparvector(srctdimodel, destparam, varargin) - obj@SCDclass_mdspar(); - % Constructor parser customization definitions here - obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); - % Constructor parser customization results here + obj@SCDclass_mdspar(srctdimodel, destparam, varargin); obj.classname=mfilename; end diff --git a/code/classes/SCDclass_mdswg.m b/code/classes/SCDclass_mdswg.m index 41f313bc14efe6c3480232ca270b4db83d58906b..dab0a5433f9031a18a6b66b9f1782ea60e638129 100644 --- a/code/classes/SCDclass_mdswg.m +++ b/code/classes/SCDclass_mdswg.m @@ -16,8 +16,7 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous modelname % name of the Simulink model using the parameter getcommand % full command for getting the value (callable by matlab eval) classname % class name for logging - cparser % constructor parameters parser - + timebasestart % timebase start time variable timebasedt % timebase dt variable timebasestop % timebase stop time variable @@ -30,29 +29,30 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous methods %function obj=SCDclass_mdswavegen(srcsrv, srctree, srctdi, modelname, destwavegen, timebasestart, timebasedt, timebasestop) - function obj=SCDclass_mdswg() - obj.cparser=inputParser; - addRequired(obj.cparser,'srctdi',@(x) ischar(x)); - addRequired(obj.cparser,'destwavegen',@(x) ischar(x)); - addParameter(obj.cparser,'srcsrv','tcvdata',@(x) ischar(x)); - addParameter(obj.cparser,'srctree','tcv_shot',@(x) ischar(x)); - addParameter(obj.cparser,'modelname','',@(x) ischar(x)); + function obj=SCDclass_mdswg(srctdi, destwavegen, varargin) + % MDS source and model destination constructor + p=inputParser; + addRequired(p,'srctdi',@(x) ischar(x)); + addRequired(p,'destwavegen',@(x) ischar(x)); + addParameter(p,'srcsrv','tcvdata',@(x) ischar(x)); + addParameter(p,'srctree','tcv_shot',@(x) ischar(x)); + addParameter(p,'modelname','',@(x) ischar(x)); + + % From subclasses constructors, unused here + addParameter(p,'destinterval',0); + addParameter(p,'destindex',0); + parse(p,srctdi,destwavegen,varargin{:}{:}); + + obj.mdsserver=p.Results.srcsrv; + obj.mdstree=p.Results.srctree; + obj.tdiexpr=p.Results.srctdi; + obj.wavegentarget=p.Results.destwavegen; + obj.modelname=p.Results.modelname; obj.verbose=1; obj.wavegenbasestruct=''; end - function obj=parseconstructorcommon(obj, srctdi, destwavegen, varargin) - parse(obj.cparser,srctdi,destwavegen,varargin{:}{:}); - - obj.mdsserver=obj.cparser.Results.srcsrv; - obj.mdstree=obj.cparser.Results.srctree; - obj.tdiexpr=obj.cparser.Results.srctdi; - obj.wavegentarget=obj.cparser.Results.destwavegen; - obj.modelname=obj.cparser.Results.modelname; - - end - end % Not abstract methods common to all child classes diff --git a/code/classes/SCDclass_mdswgsigarray1.m b/code/classes/SCDclass_mdswgsigarray1.m index 1a05be96d4c390fb86239fa5adc30a54e016a96f..ca57781d3185a4aab93f74f9cb66412a9e31d98e 100644 --- a/code/classes/SCDclass_mdswgsigarray1.m +++ b/code/classes/SCDclass_mdswgsigarray1.m @@ -17,27 +17,22 @@ classdef SCDclass_mdswgsigarray1 < SCDclass_mdswg %function obj=SCDclass_mdswgsigarray1(srcsrv, srctree, srctdi, modelname, destwavegen, tbstart, tbdt, tbstop, srcstartidx, srcstopidx, deststartidx, deststopidx) function obj=SCDclass_mdswgsigarray1(srctdi, destwavegen, srcinterval, varargin) - obj@SCDclass_mdswg(); + obj@SCDclass_mdswg(srctdi, destwavegen, varargin); intervalchecker=@(x) isnumeric(x) && min(diff(x))==1 && max(diff(x))==1; assert(intervalchecker(srcinterval)); - obj.cparser.addParameter('destinterval',srcinterval,intervalchecker); - - %p=inputParser; - %p.addParameter('destinterval',srcinterval,intervalchecker); - %parse(p,varargin{:}); - - obj=obj.parseconstructorcommon(srctdi, destwavegen, varargin); - - dstinterval=obj.cparser.Results.destinterval; + p=inputParser; + p.addParameter('destinterval',srcinterval,intervalchecker); + parse(p,varargin{:}); + dstinterval=p.Results.destinterval; obj.srcstartidx=srcinterval(1); obj.srcstopidx=srcinterval(end); obj.deststartidx=dstinterval(1); obj.deststopidx=dstinterval(end); - obj.classname=mfilename; + obj.classname='SCDclass_mdswgsigarray1'; end end diff --git a/code/classes/SCDclass_mdswgsigsingle.m b/code/classes/SCDclass_mdswgsigsingle.m index fe7ec152e16c2ae2f9ac5d01b1c929f1c2c397ad..8fda8fce513479466149ba29ec84313b6ef42687 100644 --- a/code/classes/SCDclass_mdswgsigsingle.m +++ b/code/classes/SCDclass_mdswgsigsingle.m @@ -12,19 +12,16 @@ classdef SCDclass_mdswgsigsingle < SCDclass_mdswg methods function obj=SCDclass_mdswgsigsingle(srctdi, destwavegen, varargin) - %obj@SCDclass_mdswg(srctdi, destwavegen, varargin); - obj@SCDclass_mdswg(); + obj@SCDclass_mdswg(srctdi, destwavegen, varargin); destidxvalchecker=@(x) isscalar(x); - %addParameter(obj.cparser,'destindex',1,destidxvalchecker); - obj.cparser.addParameter('destindex',1,destidxvalchecker) - - obj=obj.parseconstructorcommon(srctdi, destwavegen, varargin); - - %parse(p,varargin{:}); - obj.destidx=obj.cparser.Results.destindex; - obj.classname=mfilename; + p=inputParser; + addParameter(p,'destindex',1,destidxvalchecker); + parse(p,varargin{:}); + obj.destidx=p.Results.destindex; + + obj.classname='SCDclass_mdswgsigsingle'; end end