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

some refactoring of wrapper list creation

parent 5e64eaa3
Branches
No related tags found
No related merge requests found
......@@ -307,6 +307,9 @@ classdef SCDclass_expcode
fprintf('Setting up expcode %d, ''%s'', configuring wrappers ...\n',obj.maincode,obj.name);
obj=obj.setupwrappers;
fprintf('Setting up main expcode data dictionary')
obj = obj.setupmaindd;
fprintf('Setting up expcode %d, ''%s'', configuring data dictionaries ...\n',obj.maincode,obj.name);
obj.setupwrapdd;
obj.setupalgodd;
......@@ -314,8 +317,7 @@ classdef SCDclass_expcode
fprintf('Setting up variant model configuration')
obj.setupvaralgo;
fprintf('Setting up main expcode data dictionary')
obj = obj.setupmaindd;
fprintf('Setting up expcode %d, ''%s'', configuring default tunable parameters ...\n',obj.maincode,obj.name);
obj.updatedefaulttp;
fprintf('Setting up expcode %d, ''%s'', configuring global data ...\n',obj.maincode,obj.name);
......@@ -865,10 +867,15 @@ classdef SCDclass_expcode
for idx_nodedds=1:numel(obj.activenodes)
inode = obj.activenodes(idx_nodedds);
% Getting data dictionary and required data sources
% Getting node data dictionary and required data sources
datadictname = obj.nodes(inode).datadict;
fprintf('opening %s\n',datadictname)
if isempty(which(datadictname))
nodedd=Simulink.data.dictionary.create(datadictname);
else
nodedd = Simulink.data.dictionary.open(datadictname);
end
nodeddsources=nodedd.DataSources;
reqsources=obj.nodes(inode).wrapdatadicts';
......@@ -1046,25 +1053,24 @@ classdef SCDclass_expcode
for ii=1:numel(obj.wrapperlist)
inode = obj.wrapperlist{ii}{1};
icpu = obj.wrapperlist{ii}{2};
varalgo = obj.wrapperlist{ii}{3};
modelname = obj.wrapperlist{ii}{4}; %#ok<NASGU>
wrapper_dd = obj.wrapperlist{ii}{5};
switch inode
%%% THIS SHOULD BE REFACTORED
case {1,8}
if(obj.wrapperlist{ii}{2}==1)
obj.nodes(inode).varalgo=obj.wrapperlist{ii}{3};
obj.nodes(inode).wrapdatadicts{1}=obj.wrapperlist{ii}{5};
else
warning('SCDclass_expcode:setupwrappers','not supported node%02d cpu',inode);
end
assert(icpu==1,'SCDclass_expcode:setupwrappers',...
'not supported node%02d cpu',inode)
obj.nodes(inode).varalgo(icpu) = varalgo;
obj.nodes(inode).wrapdatadicts{icpu} = wrapper_dd;
case {2,3,4,6,7}
if(obj.wrapperlist{ii}{2}>=1 && obj.wrapperlist{ii}{2}<=max(obj.activecpus{inode}))
obj.nodes(inode).varalgo(obj.wrapperlist{ii}{2})=obj.wrapperlist{ii}{3};
obj.nodes(inode).wrapdatadicts{obj.wrapperlist{ii}{2}}=obj.wrapperlist{ii}{5};
else
warning('SCDclass_expcode:setupwrappers','not supported node%02d cpu',inode);
end
assert((icpu>=1 && icpu <=max(obj.activecpus{inode})),...
'SCDclass_expcode:setupwrappers','not supported node%02d cpu',inode);
otherwise
warning('SCDclass_expcode:setupwrappers','not supported node');
end
obj.nodes(inode).varalgo(icpu) = varalgo;
obj.nodes(inode).wrapdatadicts{icpu} = wrapper_dd;
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment