Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCDDS-core
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPC
SCDDS
SCDDS-core
Commits
5586c83e
Commit
5586c83e
authored
3 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup classes further some more
parent
e1a56145
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
code/classes/SCDclass_expcode.m
+21
-60
21 additions, 60 deletions
code/classes/SCDclass_expcode.m
code/classes/SCDclass_node.m
+3
-3
3 additions, 3 deletions
code/classes/SCDclass_node.m
with
24 additions
and
63 deletions
code/classes/SCDclass_expcode.m
+
21
−
60
View file @
5586c83e
...
...
@@ -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
,
fpinits
tmp
]
=
algoObj
.
getinits
;
if
(
numel
(
fpinits
tmp
)
>
0
)
toadd
=
ones
(
numel
(
fpinits
tmp
),
1
);
for
ii
=
1
:
numel
(
fpinits
tmp
)
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
}),
fpinits
tmp
{
ii
}{
2
}))
warning
(
'SCDclass_expcode:addalgorithm'
,
'An init driving the structure %s has already been added, ignoring this init'
,
char
(
fpinits
tmp
{
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
}
=
fpinits
tmp
{
ii
}{
1
};
temp
{
2
}
=
fpinits
tmp
{
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
...
...
This diff is collapsed.
Click to expand it.
code/classes/SCDclass_node.m
+
3
−
3
View file @
5586c83e
...
...
@@ -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
=
ge
tnodeconfig
(
obj
,
nodenr
);
obj
=
defaul
tnodeconfig
(
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
=
ge
tnodeconfig
(
node
,
nodenr
)
function
node
=
defaul
tnodeconfig
(
node
,
nodenr
)
% [general part]
switch
nodenr
case
1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment