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

Cleanup classes further some more

parent e1a56145
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,6 @@ classdef SCDclass_expcode
properties (SetAccess = private)
name % Expcode main name
%nodeddlist % list of data dictionaries at node level
initobjlist % list of loaded algorithm objects with configured inits
algonamelist % List of loaded algorithm names
algoddlist % list of data dictionaries at algorithm level
......@@ -38,8 +37,7 @@ classdef SCDclass_expcode
algos % list of algorithms objects
nodes % array of node properties structs
definednodes % nodes that are defined in Simulink
definedcpus % cpus per node nodes that are defined in Simulink
ddname ='tcv.sldd' % main expcode data dictionary name
ddname = 'tcv.sldd' % main expcode data dictionary name
ddpath % main expcode data dicationary save path
end
......@@ -52,11 +50,6 @@ classdef SCDclass_expcode
help(mfilename)
end
function node = defaultnode(nodenr)
end
function build_nodes(compileslx_list)
for mynodeslx = compileslx_list
fprintf(' *** Buiding Node %s ***\n',mynodeslx{1});
......@@ -100,35 +93,27 @@ classdef SCDclass_expcode
%%
methods
%% Constructor
function obj=SCDclass_expcode(name)
% All templates constructor
% Constructor
if nargin==0; name = 'template'; end
obj.name = name;
obj.maincode = 1;
obj.status = 'debug';
obj.loadverbose = 1;
mainslx = obj.getslxname;
mainslx = obj.getslxname;
hardwarepath = fileparts(which(mainslx));
assert(~isempty(hardwarepath),'%s not found?',mainslx)
obj.ddpath = hardwarepath;
obj.definednodes=[1 2 6 7 8];
obj.definedcpus=[{1}; ...
{1:6}; ...
{}; ...
{1}; ...
{1}; ...
{1:4}; ...
{1:4}; ...
{1}];
obj.algonamelist={};
obj.algoddlist={};
obj.exportedtps = [];
obj.mdscontainer = SCDclass_mdsobjcontainer;
obj.definednodes = [1 2 6 7 8];
obj.algonamelist = {};
obj.algoddlist = {};
obj.exportedtps = [];
obj.mdscontainer = SCDclass_mdsobjcontainer;
obj.taskcontainer = SCDclass_taskcontainer;
nnodes = numel(obj.definednodes);
......@@ -531,15 +516,15 @@ classdef SCDclass_expcode
obj.taskcontainer=obj.taskcontainer.importtaskobjects(algotaskcontainer);
% Importing inits
[stdinitstmp,fpinits]=algoObj.getinits;
if(numel(fpinits)>0)
toadd = ones(numel(fpinits),1);
for ii=1:numel(fpinits)
[stdinitstmp,fpinitstmp]=algoObj.getinits;
if(numel(fpinitstmp)>0)
toadd = ones(numel(fpinitstmp),1);
for ii=1:numel(fpinitstmp)
if(~isempty(obj.fpinits))
for jj=1:numel(obj.fpinits)
for kk=1:numel(obj.fpinits{jj}{2})
if(strcmp(char(obj.fpinits{jj}{2}{kk}),fpinits{ii}{2}))
warning('SCDclass_expcode:addalgorithm','An init driving the structure %s has already been added, ignoring this init',char(fpinits{ii}{2}))
if(strcmp(char(obj.fpinits{jj}{2}{kk}),fpinitstmp{ii}{2}))
warning('SCDclass_expcode:addalgorithm','An init driving the structure %s has already been added, ignoring this init',char(fpinitstmp{ii}{2}))
toadd(ii)=0;
end
end
......@@ -547,8 +532,8 @@ classdef SCDclass_expcode
end
if toadd(ii)
temp=cell(10,1);
temp{1}=fpinits{ii}{1};
temp{2}=fpinits{ii}{2};
temp{1}=fpinitstmp{ii}{1};
temp{2}=fpinitstmp{ii}{2};
obj.fpinits{end+1}=temp;
end
end
......@@ -563,28 +548,8 @@ classdef SCDclass_expcode
function out = getexportedtps(obj)
out = obj.exportedtps;
end
function obj = importexpcode(obj, expcode)
% This function imports settings of an existing expcode into another
warning('Not yet supported!');
return;
% tunparamstruct import
exportedtpstoadd = expcode.getexportedtps;
for ii=1:numel(exportedtpstoadd)
if ~sum(ismember(exportedtpstoadd{ii},obj.exportedtps))
obj.addtunparamstruct(exportedtpstoadd{ii});
end
end
% parameters import
obj.mdscontainer=obj.mdscontainer.importmdsobjects(expcode.mdscontainer);
end
%% Default values setup methods
%% Default values setup methods
function updatedefaulttp(obj)
% updatedefaulttp()
%
......@@ -958,11 +923,7 @@ classdef SCDclass_expcode
obj.mdscontainer.autopopulateMDSparams(shot);
obj.mdscontainer.autopopulateMDSwavegens(shot);
end
end
end
end
......
......@@ -25,7 +25,7 @@ classdef SCDclass_node < SCDclass_component
methods
function obj = SCDclass_node(nodenr)
function obj = SCDclass_node(nodenr)
name = sprintf('SCD_rtc_%02d',nodenr);
obj.nodenr = nodenr;
obj.name = name;
......@@ -33,7 +33,7 @@ classdef SCDclass_node < SCDclass_component
obj.ddname = [name,'.sldd'];
obj.mdlname = [name,'.slx'];
obj = getnodeconfig(obj,nodenr);
obj = defaultnodeconfig(obj,nodenr);
end
function obj = addwrapper(obj,wrapperObj,cpunr,varalgo,isactive)
......@@ -55,7 +55,7 @@ classdef SCDclass_node < SCDclass_component
obj.cpuactive(cpunr) = isactive;
end
function node = getnodeconfig(node,nodenr)
function node = defaultnodeconfig(node,nodenr)
% [general part]
switch nodenr
case 1
......
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