Skip to content
Snippets Groups Projects
Commit 4cf776bb authored by Federico Felici's avatar Federico Felici
Browse files

Corrected + improved MARTe2 config writer

+ some cosmetics
parent d2fcb652
No related branches found
No related tags found
No related merge requests found
...@@ -240,7 +240,7 @@ classdef SCDclass_mdsobjcontainer ...@@ -240,7 +240,7 @@ classdef SCDclass_mdsobjcontainer
end end
end end
end end
end end
function printMARTe2parconfig(obj, shot) function printMARTe2parconfig(obj, shot)
...@@ -260,7 +260,7 @@ classdef SCDclass_mdsobjcontainer ...@@ -260,7 +260,7 @@ classdef SCDclass_mdsobjcontainer
% generate header for MDSsource if necessary % generate header for MDSsource if necessary
if ~strcmp(currentServer,prevServer) %if a new server needs to be opened if ~strcmp(currentServer,prevServer) %if a new server needs to be opened
if ii~=1, fprintf(' }\n'), end if ii~=1, fprintf(' }\n'), end % close bracket for previous one
% print new source header % print new source header
fprintf("%s\n",mymdsparam.genMARTe2MDSsourcestr); fprintf("%s\n",mymdsparam.genMARTe2MDSsourcestr);
end end
...@@ -270,7 +270,7 @@ classdef SCDclass_mdsobjcontainer ...@@ -270,7 +270,7 @@ classdef SCDclass_mdsobjcontainer
str = mymdsparam.genMARTe2entry(shot); str = mymdsparam.genMARTe2entry(shot);
fprintf(" %s\n",str); fprintf(" %s\n",str);
end end
fprintf("}\n\n"); fprintf(" }\n}\n\n");
otherwise otherwise
for ii=1:obj.numparams for ii=1:obj.numparams
...@@ -282,7 +282,6 @@ classdef SCDclass_mdsobjcontainer ...@@ -282,7 +282,6 @@ classdef SCDclass_mdsobjcontainer
end end
end end
function iorder = getParamsServerTreeOrder(obj) function iorder = getParamsServerTreeOrder(obj)
% find server-tree order of parameters % find server-tree order of parameters
mdsservertree = cell(numel(obj.mdsparams),2); mdsservertree = cell(numel(obj.mdsparams),2);
...@@ -293,21 +292,18 @@ classdef SCDclass_mdsobjcontainer ...@@ -293,21 +292,18 @@ classdef SCDclass_mdsobjcontainer
[~,iorder] = sortrows(mdsservertree); [~,iorder] = sortrows(mdsservertree);
end end
function printMARTe2wgconfig(obj, shot) function printMARTe2wgconfig(obj, shot)
for ii=1:obj.numwavegens for ii=1:obj.numwavegens
if(strcmp(obj.modeltogenerate,'all')) if(strcmp(obj.modeltogenerate,'all'))
str=obj.mdswavegens(ii).genMARTe2entry(shot); str=obj.mdswavegens(ii).genMARTe2entry(shot);
fprintf(" %s\n",str); fprintf(" %s\n",str);
else else
if(strcmp(obj.modeltogenerate,obj.mdswavegens(ii).getmodelname)) if(strcmp(obj.modeltogenerate,obj.mdswavegens(ii).getmodelname))
str=obj.mdswavegens(ii).genMARTe2entry(shot); str=obj.mdswavegens(ii).genMARTe2entry(shot);
fprintf(" %s\n",str); fprintf(" %s\n",str);
end end
end end
end end
end end
end end
end end
...@@ -169,7 +169,6 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous ...@@ -169,7 +169,6 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous
if(isempty(obj.modelname)) if(isempty(obj.modelname))
obj.modelname = modelname; obj.modelname = modelname;
end end
end end
function obj = setdatadictionary(obj, ddname) function obj = setdatadictionary(obj, ddname)
...@@ -179,12 +178,8 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous ...@@ -179,12 +178,8 @@ classdef SCDclass_mdspar < matlab.mixin.Heterogeneous
end end
function entrystring = genMARTe2entrycommon(obj, shot) function entrystring = genMARTe2entrycommon(obj, shot)
%obj.mdsconnect(shot);
%[obj,~]=obj.getdata(shot);
obj=obj.actualizetdiexpr(shot); obj=obj.actualizetdiexpr(shot);
%entrystring = ['+' obj.modeltargetpar ' = { Class=' obj.classname ' Path=' obj.tdiexprused ' }']; entrystring = sprintf('+%-30s = { Class=%-30s Path=%-40s',obj.gettargetparam,obj.classname,obj.tdiexprused);
% entrystring = ['+' obj.modeltargetpar ' = { Class=' obj.classname ' Path=' obj.tdiexprused ' Server=' obj.mdsserver, ' Tree=' obj.mdstree];
entrystring = sprintf('+%-25s = { Class=%-30s Path=%-35s Server=%-25s Tree=%-25s',obj.modeltargetpar,obj.classname,obj.tdiexprused,obj.mdsserver,obj.mdstree);
end end
function str = genMARTe2MDSsourcestr(obj) function str = genMARTe2MDSsourcestr(obj)
......
...@@ -35,11 +35,9 @@ classdef SCDclass_mdsparscalartaridx < SCDclass_mdspar ...@@ -35,11 +35,9 @@ classdef SCDclass_mdsparscalartaridx < SCDclass_mdspar
end end
function entrystring = genMARTe2entry(obj, shot) function entrystring = genMARTe2entry(obj, shot)
entrystring=obj.genMARTe2entrycommon(shot); entrystring =sprintf('%s Idx=%d}',obj.genMARTe2entrycommon(shot),obj.targetidx);
entrystring=[entrystring ' Idx=' num2str(obj.targetidx) ' }'];
end end
end end
end end
...@@ -30,8 +30,7 @@ classdef SCDclass_mdsparvector < SCDclass_mdspar ...@@ -30,8 +30,7 @@ classdef SCDclass_mdsparvector < SCDclass_mdspar
end end
function entrystring = genMARTe2entry(obj, shot) function entrystring = genMARTe2entry(obj, shot)
entrystring=obj.genMARTe2entrycommon(shot); entrystring=[obj.genMARTe2entrycommon(shot) ' }'];
entrystring=[entrystring ' }'];
end end
end end
......
...@@ -115,8 +115,7 @@ classdef SCDclass_mdswgsigsingle < SCDclass_mdswg ...@@ -115,8 +115,7 @@ classdef SCDclass_mdswgsigsingle < SCDclass_mdswg
end end
function entrystring = genMARTe2entry(obj, shot) function entrystring = genMARTe2entry(obj, shot)
entrystring=obj.genMARTe2entrycommon(shot); entrystring=[obj.genMARTe2entrycommon(shot) ' }'];
entrystring=[entrystring ' }'];
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment