diff --git a/code/classes/SCDclass_expcode.m b/code/classes/SCDclass_expcode.m index aff051ca377e6679837761441718c760fc7bb550..98a12c6713cc3294e4fc96989d99fcecfcb55501 100644 --- a/code/classes/SCDclass_expcode.m +++ b/code/classes/SCDclass_expcode.m @@ -5,18 +5,18 @@ classdef SCDclass_expcode % with all templates algorithms properties (Access = private) - activenodes % numerical list of configured active nodes - activecpus % numerical list of configured CPUs - %nodeddlist % list of data dictionaries at node level - wrapperlist % list of configured wrappers - algoobjlist % list of loaded algorithm objects - algonamelist % List of loaded algorithm names - algoddlist % list of data dictionaries at algorithm level - mdscontainer % container class for MDS+ interface objects - taskcontainer % container class for generic init and term task objects - exportedtps % list of tunable parameters variable to be exported - stdinits % list of standard inits scripts - + activenodes % numerical list of configured active nodes + activecpus % numerical list of configured CPUs + %nodeddlist % list of data dictionaries at node level + wrapperlist % list of configured wrappers + algoobjlist % list of loaded algorithm objects + algonamelist % List of loaded algorithm names + algoddlist % list of data dictionaries at algorithm level + mdscontainer % container class for MDS+ interface objects + taskcontainer % container class for generic init and term task objects + exportedtps % list of tunable parameters variable to be exported + stdinits % list of standard inits scripts + modeltoactualize % name of the algorithm to actualize ('all' means all coonfigured) end properties @@ -428,9 +428,23 @@ classdef SCDclass_expcode obj.buildworkspacetpstruct; end - function actualize(obj, shot) + function actualize(obj, shot, varargin) + p=inputParser; + % if a model name is given, operations will be performed + % only on it, otherwise they will be performed on all + % configured models + addParameter(p,'model','',@(x) ischar(x)); + parse(p,varargin{:}); + + if(isempty(p.Results.model)) + obj.modeltoactualize='all'; + else + obj.modeltoactualize=p.Results.model; + end + obj.actualizedata(shot); - fprintf('Actualizing expcode %d, ''%s'', performing tasks ...\n',obj.maincode,obj.name); + fprintf('Actualizing expcode %d, ''%s'', performing tasks ...\n',obj.maincode,obj.name); + obj.taskcontainer.modeltoexecute=obj.modeltoactualize; obj.taskcontainer.exectasksoninit(shot); end @@ -463,10 +477,12 @@ classdef SCDclass_expcode end function actualizeparameters(obj,shot) + obj.mdscontainer.modeltoactualize=obj.modeltoactualize; obj.mdscontainer.actualizeparameters(shot); end function actualizewavegens(obj,shot) + obj.mdscontainer.modeltoactualize=obj.modeltoactualize; obj.mdscontainer.actualizewavegens(shot); end @@ -490,19 +506,32 @@ classdef SCDclass_expcode end end - function printMARTe2config(obj, shot) - fprintf("+MDSParameters = {\n"); - fprintf(" Class = MDSParameters\n"); - fprintf(" Shot = %d\n",shot); + function printMARTe2parconfig(obj, shot, varargin) + p=inputParser; + % if a model name is given, operations will be performed + % only on it, otherwise they will be performed on all + % configured models + addParameter(p,'model','',@(x) ischar(x)); + parse(p,varargin{:}); + + if(isempty(p.Results.model)) + obj.mdscontainer.modeltogenerate='all'; + else + obj.mdscontainer.modeltogenerate=p.Results.model; + end obj.mdscontainer.printMARTe2parconfig(shot); + end + + function printMARTe2wgbusconfig(obj, shot, ddname, busname, frequency) + fprintf("+MDSWavegen_%s = {\n", busname); + fprintf(" Class = MDSWavegen\n"); + fprintf(" Shot = %d\n",shot); + fprintf(" Frequency = %.2f\n",frequency); + dim=obj.mdscontainer.printMARTe2wgbusconfig(shot, ddname, busname); + fprintf(" Signals = {\n"); + fprintf(" wavegen_%s = { Type = float32 NumberOfElements = %d }\n", busname, dim ); + fprintf(" }\n"); fprintf("}\n"); - - fprintf("+MDSWavegens = {\n"); - fprintf(" Class = MDSWavegens\n"); - fprintf(" Shot = %d\n",shot); - obj.mdscontainer.printMARTe2wgconfig(shot); - fprintf("}\n"); - end end diff --git a/code/classes/SCDclass_expcodecontainer.m b/code/classes/SCDclass_expcodecontainer.m index 9eaf831d77df379630007cf34570f3a946f4a114..90b686a10ccf00c7d88ad6ebcf332ce91655b7cc 100644 --- a/code/classes/SCDclass_expcodecontainer.m +++ b/code/classes/SCDclass_expcodecontainer.m @@ -48,9 +48,10 @@ classdef SCDclass_expcodecontainer for(ii=1:obj.numexpcodes) presentcodes(ii)=obj.expcodes{ii}{1}; end - insertpos=max(find(maincode>presentcodes)); + insertpos=min(find(presentcodes>maincode)); - if(insertpos==obj.numexpcodes) + %if(insertpos==obj.numexpcodes) + if(isempty(insertpos)) obj.expcodes{end+1}=temp; fprintf('Expcode %d inserted (pos %d)\n', maincode, obj.numexpcodes+1); @@ -59,7 +60,7 @@ classdef SCDclass_expcodecontainer obj.expcodes{jj+1}=obj.expcodes{jj}; end obj.expcodes{insertpos}=temp; - fprintf('Expcode %d inserted (pos %d)\n', expcode.maincode, insertpos); + fprintf('Expcode %d inserted (pos %d)\n', maincode, insertpos); end obj.numexpcodes=obj.numexpcodes+1; diff --git a/code/classes/SCDclass_mdsobjcontainer.m b/code/classes/SCDclass_mdsobjcontainer.m index 23b317b76354dee6f4f6408692f0cfe59886d991..94ae621fa10732295b6eb139728c87d7762760ef 100644 --- a/code/classes/SCDclass_mdsobjcontainer.m +++ b/code/classes/SCDclass_mdsobjcontainer.m @@ -15,6 +15,8 @@ classdef SCDclass_mdsobjcontainer mdswavegens % wavegens objects array simstructlist % list of names of simstructs to be transferred to % base workspace upon expcode setup + modeltoactualize % model name to actualize ('all' for all) + modeltogenerate % model name to generate conf script ('all' for all) end methods @@ -75,7 +77,13 @@ classdef SCDclass_mdsobjcontainer % naive version with a mds acces for every parameter if obj.numparams>0 for ii=1:obj.numparams - obj.mdsparams(ii).actualizedata(shot); + if(strcmp(obj.modeltoactualize,'all')) + obj.mdsparams(ii).actualizedata(shot); + else + if(strcmp(obj.modeltoactualize,obj.mdsparams(ii).getmodelname)) + obj.mdsparams(ii).actualizedata(shot); + end + end end end end @@ -145,11 +153,17 @@ classdef SCDclass_mdsobjcontainer % naive version, a mds connection is called for every object if obj.numwavegens>0 for ii=1:obj.numwavegens - obj.mdswavegens(ii).actualizedata(shot); + if(strcmp(obj.modeltoactualize,'all')) + obj.mdswavegens(ii).actualizedata(shot); + else + if(strcmp(obj.modeltoactualize,obj.mdswavegens(ii).getmodelname)) + obj.mdswavegens(ii).actualizedata(shot); + end + end end end end - + function obj = cleanwavegens(obj) % clean wavegens leaving a consistent (with model buses) % empty timeseries data structure @@ -226,24 +240,127 @@ classdef SCDclass_mdsobjcontainer end end end - + end - function printMARTe2parconfig(obj, shot) - for ii=1:obj.numparams - str=obj.mdsparams(ii).genMARTe2entry(shot); - fprintf(" %s\n",str); - end + function printMARTe2parconfig(obj, shot) + switch obj.modeltogenerate + case 'all' + iorder = getParamsServerTreeOrder(obj); % order entries following mdsserver, mdstree order + prevServer = ''; % init + + % Header for MDS for loader + loaderStr = sprintf('\n\n+MDSParameters = {\n Class=MDSObjLoader\n Shot=%d\n',shot); + fprintf("%s",loaderStr); + + for ii=1:obj.numparams + mymdsparam = obj.mdsparams(iorder(ii)); + + currentServer = mymdsparam.getMDSserver; + + % generate header for MDSsource if necessary + if ~strcmp(currentServer,prevServer) %if a new server needs to be opened + if ii~=1, fprintf(' }\n'), end % close bracket for previous one + % print new source header + fprintf("%s\n",mymdsparam.genMARTe2MDSsourcestr); + end + prevServer = currentServer; + + % generate data source entry + str = mymdsparam.genMARTe2entry(shot); + fprintf(" %s\n",str); + end + fprintf(" }\n}\n\n"); + + otherwise + for ii=1:obj.numparams + if(strcmp(obj.modeltogenerate,obj.mdsparams(ii).getmodelname)) + str=obj.mdsparams(ii).genMARTe2entry(shot); + fprintf(" %s\n",str); + end + end + end end - function printMARTe2wgconfig(obj, shot) - for ii=1:obj.numwavegens - str=obj.mdswavegens(ii).genMARTe2entry(shot); - fprintf(" %s\n",str); - end + function iorder = getParamsServerTreeOrder(obj) + % find server-tree order of parameters + mdsservertree = cell(numel(obj.mdsparams),2); + for ii=1:numel(obj.mdsparams) + mdsservertree{ii,1} = obj.mdsparams(ii).getMDSserver; + mdsservertree{ii,2} = obj.mdsparams(ii).getMDStree; + end + [~,iorder] = sortrows(mdsservertree); end + function printMARTe2wgconfig(obj, shot) + for ii=1:obj.numwavegens + if(strcmp(obj.modeltogenerate,'all')) + str=obj.mdswavegens(ii).genMARTe2entry(shot); + fprintf(" %s\n",str); + else + if(strcmp(obj.modeltogenerate,obj.mdswavegens(ii).getmodelname)) + str=obj.mdswavegens(ii).genMARTe2entry(shot); + fprintf(" %s\n",str); + end + end + end + end + function overalldim = printMARTe2wgbusconfig(obj, shot, ddname, busname) + dd=SCDconf_getdatadict(ddname); + bus=dd.getEntry(busname).getValue; + nelems=numel(bus.Elements); + server=''; + tree=''; + dimension=0; + + for elem=1:nelems + signame=bus.Elements(elem).Name; + found=false; + for wgs=1:obj.numwavegens + %signame + %obj.mdswavegens(wgs).gettarget + if(strcmp(obj.mdswavegens(wgs).gettarget,signame)) + found=true; + break; + end + end + if(~found) + error('SCDclass_mdsobjcontainer:wgnotfound','Signal %s not found in configured wavegens objects', signame); + else + actserver=obj.mdswavegens(wgs).getMDSserver; + acttree=obj.mdswavegens(wgs).getMDStree; + + if(~strcmp(actserver,server) || ~strcmp(acttree,tree)) + if(~strcmp(server,'') || ~strcmp(tree,'')) + error('SCDclass_mdsobjcontainer:multipleconnections','multiple MDS+ connections/trees not supported within the same wavegen generator'); + else + server=actserver; + tree=acttree; + fprintf(' Server=%s\n', server); + fprintf(' Tree=%s\n', tree) + end + end + + entrystring=obj.mdswavegens(wgs).genMARTe2entry(shot); + fprintf(' %s\n', entrystring); + dimension=dimension+bus.Elements(elem).Dimensions; + + end + end + + overalldim=dimension; + + end + + function iorder = getWavegensServerTreeOrder(obj) + % find server-tree order of wavegens + mdsservertree = cell(numel(obj.mdswavegens),2); + for ii=1:numel(obj.mdswavegens) + mdsservertree{ii,1} = obj.mdswavegens(ii).getMDSserver; + mdsservertree{ii,2} = obj.mdswavegens(ii).getMDStree; + end + [~,iorder] = sortrows(mdsservertree); + end end end - diff --git a/code/classes/SCDclass_mdspar.m b/code/classes/SCDclass_mdspar.m index 021e55cec9a0d9107b97b11a2b95418aac1ac621..d2bb9595dc794a076a6c3be6d8df97ef6e7bbe42 100644 --- a/code/classes/SCDclass_mdspar.m +++ b/code/classes/SCDclass_mdspar.m @@ -11,7 +11,9 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous tdiexprmodel % TDI expression to retrieve data when invoked with -1 shot tdiexprshot % TDI expression to retrieve data when invoked with a give shotno, if empty the -1 is used tdiexprused % TDI expression actually used + %tdiexprmarte % TDI expression actually used converted to MARTe cfg convections modelparam % Full expansion of the model target parameter (modeltpstruct+modeltargetpar) + modelparammarte % Full expansion of the model target oarameter (modeltpstruct+modeltargetpar) with marte separators modeltpstruct % target tunable parameter structure, if left empty it will be filled once binding to an algorithm modeltargetpar % Model parameter w/o tunable parameters structure value % value of the parameter @@ -19,12 +21,19 @@ 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 + marteclassname % class name for generating MARTe2 cfg file + cparser % constructor parameters parser + skippable % true if the parameters loading can be skipped during the actualization process and default value used, unused for now + + matlabseparator % structure separator character used in MAtlab/Simulink + marteseparator % structure separator character used in MARTe2 assignvar % actualizedata specific assignstring % actualizedata specific denanstring % actualizedata specific caststring % actualizedata specific + end properties @@ -33,42 +42,53 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous methods - function obj=SCDclass_mdspar(srctdimodel,destparam,varargin) - % MDS source and model destination constructor + 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 ? + addParameter(obj.cparser,'skippable','false',@(x) ischar(x)); - 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.verbose=1; + obj.matlabseparator='.'; + obj.marteseparator='-'; + + end + + function obj=parseconstructorcommon(obj, srctdimodel, destparam, varargin) + parse(obj.cparser,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; + 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; else - obj.tdiexprshot=p.Results.srctdishot; + obj.tdiexprshot=obj.cparser.Results.srctdishot; end - obj.modeltargetpar=p.Results.destparam; - obj.modelname=p.Results.modelname; - obj.datadictionary=p.Results.datadictname; - obj.modeltpstruct=p.Results.modeltpstruct; - obj.verbose=1; + 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.skippable=obj.cparser.Results.skippable; end + function name=getmodelname(obj) + name=obj.modelname; + end end % Not abstract methods common to all child classes methods function mdsconnect(obj, shot) + assert(~~exist('mdsconnect','file'),... + 'SCD:NoMDS','mdsconnect not found, are the mds matlab tools installed?') mdsconnect(obj.mdsserver); s=mdsopen(obj.mdstree, shot); str=sprintf('SCDclass_mdsparam (%s), failed opening MDS+ tree', obj.modelparam); @@ -116,6 +136,15 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous obj.tdiexprused=obj.tdiexprshot; end obj.modelparam=[obj.modeltpstruct '.' obj.modeltargetpar]; + obj.modelparammarte = strrep(obj.modelparam, obj.matlabseparator, obj.marteseparator); + end + + function obj=actualizetdiexpr(obj, shot) + if(shot==-1) + obj.tdiexprused=obj.tdiexprmodel; + else + obj.tdiexprused=obj.tdiexprshot; + end end function printinfocommon(obj) @@ -134,19 +163,31 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous out = obj.modelparam; end + function out = gettargetparammarte(obj) + out = obj.modelparammarte; + end + + function [mdsserver] = getMDSserver(obj) + mdsserver = obj.mdsserver; + end + + function [mdstree] = getMDStree(obj) + mdstree = obj.mdstree; + end + function obj = setparamstructure(obj, structname) %obj.modelparam = [structname '.' obj.modelparam]; if(isempty(obj.modeltpstruct)) obj.modeltpstruct = structname; end obj.modelparam=[obj.modeltpstruct '.' obj.modeltargetpar]; + obj.modelparammarte = strrep(obj.modelparam, obj.matlabseparator, obj.marteseparator); end function obj = setmodelname(obj, modelname) if(isempty(obj.modelname)) obj.modelname = modelname; end - end function obj = setdatadictionary(obj, ddname) @@ -155,16 +196,43 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous end end + end + + methods + function entrystring = genMARTe2entrycommon(obj, shot) - obj.mdsconnect(shot); - [obj,~]=obj.getdata(shot); - %entrystring = ['+' obj.modeltargetpar ' = { Class=' obj.classname ' Path=' obj.tdiexprused ' }']; - entrystring = ['+' obj.modeltargetpar ' = { Class=' obj.classname ' Path=' obj.tdiexprused]; + obj=obj.actualizetdiexpr(shot); + %entrystring = sprintf('+%-50s = { Class=%-30s Path=%-40s',obj.gettargetparammarte,obj.marteclassname,obj.tdiexprused); + entrystring = sprintf('+%-50s = { Class=%-30s Path=%-40s',obj.gettargetparammarte,obj.marteclassname,obj.genMARTe2MDStdiexpression); + + end + + function str = genMARTe2MDSsourcestr(obj) + %str = sprintf(' +MDSSource = {\n Class=SPCMDSSource\n Server=%s\n Tree=%s',obj.mdsserver,obj.mdstree); + str = sprintf(' +Connection_%s_%s = {\n Class=MDSObjConnection\n Server=%s\n Tree=%s',obj.mdsserver,obj.mdstree,obj.mdsserver,obj.mdstree); end + + function str = genMARTe2MDStdiexpression(obj) + % Duplicate first backslash +% if(obj.tdiexprused(1)=='\' && not(obj.tdiexprused(2)=='\')) +% martetdi=['\' obj.tdiexprused]; +% else +% martetdi=obj.tdiexprused; +% end + % Duplicate backslashes + martetdi=strrep(obj.tdiexprused, '\', '\\'); + %substitute every " with ' + martetdi=strrep(martetdi, '"', ''''); + %put double string quota + martetdi=['"' martetdi '"']; + str=martetdi; + end + end + % Abstract method actually implemented by child classes methods (Abstract) diff --git a/code/classes/SCDclass_mdspar3Dmatrix.m b/code/classes/SCDclass_mdspar3Dmatrix.m index 2599175d3ab88881db25d309234585e0815acff8..bc8b2ced141f8dd07eac26897f1cee8c700926c0 100644 --- a/code/classes/SCDclass_mdspar3Dmatrix.m +++ b/code/classes/SCDclass_mdspar3Dmatrix.m @@ -7,8 +7,12 @@ classdef SCDclass_mdspar3Dmatrix < SCDclass_mdspar methods function obj=SCDclass_mdspar3Dmatrix(srctdimodel, destparam, varargin) - obj@SCDclass_mdspar(srctdimodel, destparam, varargin); + obj@SCDclass_mdspar(); + % Constructor parser customization definitions here + obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); + % Constructor parser customization results here obj.classname=mfilename; + obj.marteclassname='MDSPar3DMatrix'; end function actualizedata(obj, shot) diff --git a/code/classes/SCDclass_mdsparfixdimvector.m b/code/classes/SCDclass_mdsparfixdimvector.m index 8960d27867d15d455bd76424e7be195a9f956b79..aa3518a202ad54068412b7671448b9bf7ac0c8ce 100644 --- a/code/classes/SCDclass_mdsparfixdimvector.m +++ b/code/classes/SCDclass_mdsparfixdimvector.m @@ -10,9 +10,13 @@ classdef SCDclass_mdsparfixdimvector < SCDclass_mdspar methods function obj=SCDclass_mdsparfixdimvector(srctdimodel, destparam, destdimension, varargin) - obj@SCDclass_mdspar(srctdimodel, destparam, varargin); - obj.classname=mfilename; + obj@SCDclass_mdspar(); + % Constructor parser customization definitions here + obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); + % Constructor parser customization results here obj.dimension=destdimension; + obj.classname=mfilename; + obj.marteclassname='MDSParFixDimVector'; end function actualizedata(obj, shot) @@ -46,6 +50,7 @@ classdef SCDclass_mdsparfixdimvector < SCDclass_mdspar function entrystring = genMARTe2entry(obj, shot) entrystring=obj.genMARTe2entrycommon(shot); + entrystring=[entrystring ' Dim=' num2str(obj.dimension)]; entrystring=[entrystring ' }']; end diff --git a/code/classes/SCDclass_mdsparfixdimvectoridx.m b/code/classes/SCDclass_mdsparfixdimvectoridx.m index 7340a85f3dc73422465f33d5894273989bdb4909..f6dd7bb8a0f832bbf4be1ab07327ff746afe8aba 100644 --- a/code/classes/SCDclass_mdsparfixdimvectoridx.m +++ b/code/classes/SCDclass_mdsparfixdimvectoridx.m @@ -10,14 +10,18 @@ classdef SCDclass_mdsparfixdimvectoridx < SCDclass_mdspar methods function obj=SCDclass_mdsparfixdimvectoridx(srctdimodel, destparam, srcinterval, varargin) - obj@SCDclass_mdspar(srctdimodel, destparam, varargin); - obj.classname=mfilename; + obj@SCDclass_mdspar(); + % Constructor parser customization definitions here + obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); + % Constructor parser customization results here 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; + obj.marteclassname='MDSParFixDimVectorIdx'; end function actualizedata(obj, shot) diff --git a/code/classes/SCDclass_mdsparfixdimvectorint.m b/code/classes/SCDclass_mdsparfixdimvectorint.m index 85e685cc316f217d3a68bdbc1ef5d939e70071e2..197d4d4989501fc670aefb375381692e4b644e9c 100644 --- a/code/classes/SCDclass_mdsparfixdimvectorint.m +++ b/code/classes/SCDclass_mdsparfixdimvectorint.m @@ -11,9 +11,13 @@ classdef SCDclass_mdsparfixdimvectorint < SCDclass_mdspar methods function obj=SCDclass_mdsparfixdimvectorint(srctdimodel, destparam, destdimension, varargin) - obj@SCDclass_mdspar(srctdimodel, destparam, varargin); + obj@SCDclass_mdspar(); + % Constructor parser customization definitions here + obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); + % Constructor parser customization results here obj.classname=mfilename; obj.dimension=destdimension; + obj.marteclassname='MDSParFixDimVectorInt'; end function actualizedata(obj, shot) @@ -46,6 +50,7 @@ classdef SCDclass_mdsparfixdimvectorint < SCDclass_mdspar function entrystring = genMARTe2entry(obj, shot) entrystring=obj.genMARTe2entrycommon(shot); + entrystring=[entrystring ' Dim=' num2str(obj.dimension)]; entrystring=[entrystring ' }']; end diff --git a/code/classes/SCDclass_mdsparmatrix.m b/code/classes/SCDclass_mdsparmatrix.m index f4dfb2479013879884167817a1893fe0c9ce65d0..63b9c4093c591725670b42e0d94e9a1c37742948 100644 --- a/code/classes/SCDclass_mdsparmatrix.m +++ b/code/classes/SCDclass_mdsparmatrix.m @@ -7,8 +7,12 @@ classdef SCDclass_mdsparmatrix < SCDclass_mdspar methods function obj=SCDclass_mdsparmatrix(srctdimodel, destparam, varargin) - obj@SCDclass_mdspar(srctdimodel, destparam, varargin); + obj@SCDclass_mdspar(); + % Constructor parser customization definitions here + obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); + % Constructor parser customization results here obj.classname=mfilename; + obj.marteclassname='MDSParMatrix'; end function actualizedata(obj, shot) diff --git a/code/classes/SCDclass_mdsparscalar.m b/code/classes/SCDclass_mdsparscalar.m index ff88044995217db65e9c62ae1ca96a458dae21a0..bc5993187f88a03eab3db80515d2a6326301a341 100644 --- a/code/classes/SCDclass_mdsparscalar.m +++ b/code/classes/SCDclass_mdsparscalar.m @@ -7,9 +7,12 @@ classdef SCDclass_mdsparscalar < SCDclass_mdspar methods function obj=SCDclass_mdsparscalar(srctdimodel, destparam, varargin) - obj@SCDclass_mdspar(srctdimodel, destparam, varargin); - obj.getcommand=sprintf('mdsvalue(''%s'')',obj.tdiexprmodel); + obj@SCDclass_mdspar(); + % Constructor parser customization definitions here + obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); + % Constructor parser customization results here obj.classname=mfilename; + obj.marteclassname='MDSParScalar'; end function actualizedata(obj, shot) diff --git a/code/classes/SCDclass_mdsparscalarint.m b/code/classes/SCDclass_mdsparscalarint.m index ea0a158951e6a8fd9d213a8d425b8b398770145d..af6ac786fbe9114d4cd1b5d3331d973a53e83a57 100644 --- a/code/classes/SCDclass_mdsparscalarint.m +++ b/code/classes/SCDclass_mdsparscalarint.m @@ -6,9 +6,12 @@ classdef SCDclass_mdsparscalarint < SCDclass_mdspar methods function obj=SCDclass_mdsparscalarint(srctdimodel, destparam, varargin) - obj@SCDclass_mdspar(srctdimodel, destparam, varargin); - obj.getcommand=sprintf('mdsvalue(''%s'')',obj.tdiexprmodel); + obj@SCDclass_mdspar(); + % Constructor parser customization definitions here + obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); + % Constructor parser customization results here obj.classname=mfilename; + obj.marteclassname='MDSParScalarInt'; end function actualizedata(obj, shot) diff --git a/code/classes/SCDclass_mdsparscalartaridx.m b/code/classes/SCDclass_mdsparscalartaridx.m index da86280575fe817dcad3be33ea567310e8ea3319..e67b8d5e8472a947078f5c7e4ecfbea9df4aeb0b 100644 --- a/code/classes/SCDclass_mdsparscalartaridx.m +++ b/code/classes/SCDclass_mdsparscalartaridx.m @@ -9,7 +9,10 @@ classdef SCDclass_mdsparscalartaridx < SCDclass_mdspar methods function obj=SCDclass_mdsparscalartaridx(srctdimodel, destparam, targetidx, varargin) - obj@SCDclass_mdspar(srctdimodel, destparam, varargin); + obj@SCDclass_mdspar(); + % Constructor parser customization definitions here + obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); + % Constructor parser customization results here obj.targetidx=targetidx; obj.classname=mfilename; end @@ -18,8 +21,7 @@ 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) @@ -33,11 +35,9 @@ classdef SCDclass_mdsparscalartaridx < SCDclass_mdspar end function entrystring = genMARTe2entry(obj, shot) - entrystring=obj.genMARTe2entrycommon(shot); - entrystring=[entrystring ' Idx=' num2str(obj.targetidx) ' }']; + entrystring =sprintf('%s Idx=%d}',obj.genMARTe2entrycommon(shot),obj.targetidx); end - end end diff --git a/code/classes/SCDclass_mdsparvector.m b/code/classes/SCDclass_mdsparvector.m index bff49651ed2154a747e5b1129ace3bfa2eaccedb..8eed9399ced00af685d351f07e4ec44d8556d264 100644 --- a/code/classes/SCDclass_mdsparvector.m +++ b/code/classes/SCDclass_mdsparvector.m @@ -7,8 +7,12 @@ classdef SCDclass_mdsparvector < SCDclass_mdspar methods function obj=SCDclass_mdsparvector(srctdimodel, destparam, varargin) - obj@SCDclass_mdspar(srctdimodel, destparam, varargin); + obj@SCDclass_mdspar(); + % Constructor parser customization definitions here + obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin); + % Constructor parser customization results here obj.classname=mfilename; + obj.marteclassname='MDSParVector'; end function actualizedata(obj, shot) @@ -27,10 +31,8 @@ classdef SCDclass_mdsparvector < SCDclass_mdspar end function entrystring = genMARTe2entry(obj, shot) - entrystring=obj.genMARTe2entrycommon(shot); - entrystring=[entrystring ' }']; + entrystring=[obj.genMARTe2entrycommon(shot) ' }']; end - end end diff --git a/code/classes/SCDclass_mdswg.m b/code/classes/SCDclass_mdswg.m index dab0a5433f9031a18a6b66b9f1782ea60e638129..ab927704e0123ff2e1fa31bf5384e94cdeaea2d0 100644 --- a/code/classes/SCDclass_mdswg.m +++ b/code/classes/SCDclass_mdswg.m @@ -4,8 +4,8 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous % building of lists of mixed kind parameters in the % expcode configuration (and later in C++ code) - %properties (Access = protected) - properties + properties (Access = protected) + %properties mdsserver % The MDS+ server hosting the parameter mdstree % The MDS+ Tree hosting the parameter tdiexpr % TDI expression to retrieve data @@ -14,9 +14,11 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous value % commandile output of the wavegen datadictionary % data dictionary hosting the parameter, if empty base workspace modelname % name of the Simulink model using the parameter - getcommand % full command for getting the value (callable by matlab eval) + getcommand % full command for getting the value (callablSCDalgo_f4ealgoe by matlab eval) classname % class name for logging - + marteclassname % class name for generating MARTe2 cfg file + cparser % constructor parameters parser + timebasestart % timebase start time variable timebasedt % timebase dt variable timebasestop % timebase stop time variable @@ -29,30 +31,29 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous methods %function obj=SCDclass_mdswavegen(srcsrv, srctree, srctdi, modelname, destwavegen, timebasestart, timebasedt, timebasestop) - 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); + 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)); - 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 @@ -99,13 +100,42 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous %end function entrystring = genMARTe2entrycommon(obj, shot) - %obj.mdsconnect(shot); - %[obj,~]=obj.getdata; - %entrystring = ['+' obj.wavegentarget ' = { Class=' obj.classname ' Path=' obj.tdiexpr ' }']; - entrystring = ['+' obj.wavegentarget ' = { Class=' obj.classname ' Path=' obj.tdiexpr ]; - + %entrystring = ['+' obj.wavegentarget ' = { Class=' obj.classname ' Path=' obj.tdiexpr ]; + entrystring = sprintf('+%-50s = { Class=%-30s Path=%-40s',obj.wavegentarget,obj.marteclassname,obj.genMARTe2MDStdiexpression); + end + + function name=getmodelname(obj) + name=obj.modelname; + end + + function [mdsserver] = getMDSserver(obj) + mdsserver = obj.mdsserver; + end + + function [mdstree] = getMDStree(obj) + mdstree = obj.mdstree; end + function str=gettarget(obj) + str = obj.wavegentarget; + end + + function str = genMARTe2MDStdiexpression(obj) + % Duplicate first backslash +% if(obj.tdiexprused(1)=='\' && not(obj.tdiexprused(2)=='\')) +% martetdi=['\' obj.tdiexprused]; +% else +% martetdi=obj.tdiexprused; +% end + % Duplicate backslashes + %martetdi=strrep(obj.tdiexpr, '\', '\\'); + martetdi=obj.tdiexpr; + %substitute every " with ' + martetdi=strrep(martetdi, '"', ''''); + %put double string quota + martetdi=['"' martetdi '"']; + str=martetdi; + end end @@ -125,6 +155,9 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous % Generate C++ code %gencode(obj) + + % Generate MARTe2 configuration entry + entrystring = genMARTe2entry(obj, shot) % Prints the parameter info summary printinfo(obj) diff --git a/code/classes/SCDclass_mdswgsigarray1.m b/code/classes/SCDclass_mdswgsigarray1.m index ca57781d3185a4aab93f74f9cb66412a9e31d98e..e91c740057f54b427c25e84a414ee67a0167564e 100644 --- a/code/classes/SCDclass_mdswgsigarray1.m +++ b/code/classes/SCDclass_mdswgsigarray1.m @@ -17,22 +17,28 @@ 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(srctdi, destwavegen, varargin); + obj@SCDclass_mdswg(); intervalchecker=@(x) isnumeric(x) && min(diff(x))==1 && max(diff(x))==1; assert(intervalchecker(srcinterval)); - p=inputParser; - p.addParameter('destinterval',srcinterval,intervalchecker); - parse(p,varargin{:}); - dstinterval=p.Results.destinterval; + 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; obj.srcstartidx=srcinterval(1); obj.srcstopidx=srcinterval(end); obj.deststartidx=dstinterval(1); obj.deststopidx=dstinterval(end); - obj.classname='SCDclass_mdswgsigarray1'; + obj.classname=mfilename; + obj.marteclassname='MDSWgSigArray1'; end end @@ -105,9 +111,13 @@ classdef SCDclass_mdswgsigarray1 < SCDclass_mdswg for ii=1:numel(sourceidxs) mdschannel=sprintf(obj.tdiexpr, sourceidxs(ii)); - data=tdi(mdschannel); - - value.Data(:,ii)= single(interp1(data.dim{1},data.data,timebase,'linear',0)); + + %data=tdi(mdschannel); + %value.Data(:,ii)= single(interp1(data.dim{1},data.data,timebase,'linear',0)); + + dbdata=mdsvalue(mdschannel); + dbtime=mdsvalue(['dim_of(' mdschannel ')']); + value.Data(:,ii) = single(interp1(dbtime,dbdata,timebase,'linear',0))'; end end @@ -131,6 +141,30 @@ classdef SCDclass_mdswgsigarray1 < SCDclass_mdswg entrystring=obj.genMARTe2entrycommon(shot); entrystring=[entrystring ' StartIdx=' num2str(obj.srcstartidx) ' StopIdx=' num2str(obj.srcstopidx) ' }']; end + + + +% * S_uint8 = { +% * NodeName = "S_uint8" // node of the tree node +% * Type = "uint8" //Can be any of the node supported types +% * NumberOfElements = 32 +% * DataManagement = 0 //could be 0, 1 or 2 +% * HoleManagement = 1 //could be 0 or 1 +% * } + function expentries = genMARTe2entryexpanded(obj, shot) + %entrystring=obj.genMARTe2entrycommon(shot); + + expentries=''; + for ii=obj.srcstartidx:obj.srcstopidx + expandedtdi = sprintf(obj.tdiexpr, ii); + martename=expandedtdi; + sigentry=sprintf(' %s={ NodeName=%s Type=float32 NumberOfElements=1 DataManagement=0 HoleManagement=1 }\n',martename, expandedtdi); + expentries=[expentries sigentry]; + end + end + + + end end diff --git a/code/classes/SCDclass_mdswgsigsingle.m b/code/classes/SCDclass_mdswgsigsingle.m index 8fda8fce513479466149ba29ec84313b6ef42687..d204baafdcfaa017612ebf86a9336606e8d8e47e 100644 --- a/code/classes/SCDclass_mdswgsigsingle.m +++ b/code/classes/SCDclass_mdswgsigsingle.m @@ -12,16 +12,20 @@ classdef SCDclass_mdswgsigsingle < SCDclass_mdswg methods function obj=SCDclass_mdswgsigsingle(srctdi, destwavegen, varargin) - obj@SCDclass_mdswg(srctdi, destwavegen, varargin); + %obj@SCDclass_mdswg(srctdi, destwavegen, varargin); + obj@SCDclass_mdswg(); 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; - p=inputParser; - addParameter(p,'destindex',1,destidxvalchecker); - parse(p,varargin{:}); - obj.destidx=p.Results.destindex; - - obj.classname='SCDclass_mdswgsigsingle'; + obj.classname=mfilename; + obj.marteclassname='MDSWgSigSingle'; end end @@ -87,9 +91,12 @@ classdef SCDclass_mdswgsigsingle < SCDclass_mdswg value.Time = timebase; value.Data = single(zeros(numel(timebase),1)); - data=tdi(obj.tdiexpr); - value.Data = single(interp1(data.dim{1},data.data,timebase,'linear',0))'; - + %data=tdi(obj.tdiexpr); + %value.Data = single(interp1(data.dim{1},data.data,timebase,'linear',0))'; + + dbdata=mdsvalue(obj.tdiexpr); + dbtime=mdsvalue(['dim_of(' obj.tdiexpr ')']); + value.Data = single(interp1(dbtime,dbdata,timebase,'linear',0))'; end @@ -109,7 +116,7 @@ classdef SCDclass_mdswgsigsingle < SCDclass_mdswg end function entrystring = genMARTe2entry(obj, shot) - entrystring=obj.genMARTe2entrycommon(shot); + entrystring=[obj.genMARTe2entrycommon(shot) ' }']; end end diff --git a/code/classes/SCDclass_task.m b/code/classes/SCDclass_task.m index 7e39a4c991a08266913c3f773b468d3986b11c40..28d77a20f3423d2bfd10b822da4ccd0df1648387 100644 --- a/code/classes/SCDclass_task.m +++ b/code/classes/SCDclass_task.m @@ -59,6 +59,9 @@ classdef SCDclass_task < matlab.mixin.Heterogeneous obj.verbose=1; end + function name=getmodelname(obj) + name=obj.modelname; + end end diff --git a/code/classes/SCDclass_taskcontainer.m b/code/classes/SCDclass_taskcontainer.m index 708f036f175f2d9bfa46e2dbf63b549d1c6b2c5f..fecf97020f2e39c5c42422e830df1048d545f2a4 100644 --- a/code/classes/SCDclass_taskcontainer.m +++ b/code/classes/SCDclass_taskcontainer.m @@ -8,6 +8,7 @@ classdef SCDclass_taskcontainer properties numtasks % number of configured tasks tasks % tasks list + modeltoexecute % model name whose tasks will be executed 'all' for all end methods @@ -34,12 +35,18 @@ classdef SCDclass_taskcontainer end end end - + function obj = exectasksoninit(obj, shot) % execs the init method of all configurted task if obj.numtasks>0 for ii=1:obj.numtasks - obj.tasks(ii).init(shot); + if(strcmp(obj.modeltoexecute,'all')) + obj.tasks(ii).init(shot); + else + if(strcmp(obj.modeltoexecute,obj.tasks(ii).getmodelname)) + obj.tasks(ii).init(shot); + end + end end end end @@ -48,7 +55,13 @@ classdef SCDclass_taskcontainer % execs the term method of all configurted task if obj.numtasks>0 for ii=1:obj.numtasks - obj.tasks(ii).term(shot); + if(strcmp(obj.modeltoexecute,'all')) + obj.tasks(ii).term(shot); + else + if(strcmp(obj.modeltoexecute,obj.tasks(ii).modelname)) + obj.tasks(ii).term(shot); + end + end end end end diff --git a/code/functions/SCDconf_createexpcodes.m b/code/functions/SCDconf_createexpcodes.m index 777fbc1d73a2b63f2132c9991771abcf1df87f86..b8b0685a9e7828fe35c6e036ecd879e7c34399c5 100644 --- a/code/functions/SCDconf_createexpcodes.m +++ b/code/functions/SCDconf_createexpcodes.m @@ -12,6 +12,8 @@ SCDexps=SCDclass_expcodecontainer; SCDexps=SCDexps.insertexpcode(1, @(x) SCDexpcodeconf_template); SCDexps=SCDexps.insertexpcode(1005, @(x) SCDexpcodeconf_tcvstandard02); +SCDexps=SCDexps.insertexpcode(10 , @(x) SCDexpcodeconf_f4eexample); + assignin('base','SCDexps',SCDexps); diff --git a/code/functions/SCDconf_setCODEconf.m b/code/functions/SCDconf_setCODEconf.m new file mode 100644 index 0000000000000000000000000000000000000000..e6395539b0c12fe440d40f82dea5931010bc1160 --- /dev/null +++ b/code/functions/SCDconf_setCODEconf.m @@ -0,0 +1,13 @@ +% Sets the code generation configuration settings on all the models + +function [] = SCDconf_setCODEconf() + disp('Setting configurationSettings = configurationSettingsCODE at tcv level ...'); + d=Simulink.data.dictionary.open('tcv.sldd'); + dd=getSection(d, 'Configurations'); + activeconf=dd.getEntry('configurationSettings'); + codeconf=dd.getEntry('configurationSettingsCODE'); + configurationSettings=codeconf.getValue; + configurationSettings.Name='configurationSettings'; + activeconf.deleteEntry; + dd.addEntry('configurationSettings',configurationSettings); +end \ No newline at end of file diff --git a/code/functions/SCDconf_setSIMconf.m b/code/functions/SCDconf_setSIMconf.m new file mode 100644 index 0000000000000000000000000000000000000000..f9c76f264c713292479791c90e1551d51138a15a --- /dev/null +++ b/code/functions/SCDconf_setSIMconf.m @@ -0,0 +1,15 @@ +% Sets the simulation configuration settings on all the models + +function [] = SCDconf_setSIMconf() + disp('Setting configurationSettings = configurationSettingsSIM at tcv level ...'); + d=Simulink.data.dictionary.open('tcv.sldd'); + dd=getSection(d, 'Configurations'); + activeconf=dd.getEntry('configurationSettings'); + simconf=dd.getEntry('configurationSettingsSIM'); + configurationSettings=simconf.getValue; + configurationSettings.Name='configurationSettings'; + activeconf.deleteEntry; + dd.addEntry('configurationSettings',configurationSettings); +end + + \ No newline at end of file diff --git a/test/simulink_codegen_tests/confsettingsmodformmi.txt b/test/simulink_codegen_tests/confsettingsmodformmi.txt new file mode 100644 index 0000000000000000000000000000000000000000..557e0749bf44ecedd8d72e785db48cec3a6104bf --- /dev/null +++ b/test/simulink_codegen_tests/confsettingsmodformmi.txt @@ -0,0 +1,15 @@ +In header file: + +#ifndef SCDMACROS +#define SCDMACROS +#define UTSTRUCTNAME(NAME) RT_MODEL_##NAME##_T +#define TSTRUCTNAME(NAME) UTSTRUCTNAME(NAME) +#define UGETMMIFCN(NAME) NAME##_GetCAPImmi +#define GETMMIFCN(NAME) UGETMMIFCN(NAME) +#endif + +In source file: +rtwCAPI_ModelMappingInfo* GETMMIFCN(MODEL) ( TSTRUCTNAME(MODEL) *rtm ) +{ + return &(rtmGetDataMapInfo(rtm).mmi); +} diff --git a/test/simulink_codegen_tests/export_shrlib_def_scd.tlc b/test/simulink_codegen_tests/export_shrlib_def_scd.tlc index bc8aa6273aa335e40dc87a702abc3f88c6dc7d1a..4111b8a80c633231d8be7bf53faa7ee3651ac627 100644 --- a/test/simulink_codegen_tests/export_shrlib_def_scd.tlc +++ b/test/simulink_codegen_tests/export_shrlib_def_scd.tlc @@ -196,6 +196,8 @@ global: %<leadingUs>%<Name>_GetCAPIStaticMap%<trailingSc> %endif %if FEVAL("isunix")==TLC_TRUE && FEVAL("ismac")==TLC_FALSE +%<Name>; +%<Name>_GetCAPImmi; mydef; local: *;