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
5f80b86f
Commit
5f80b86f
authored
3 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
some refactoring of wrapper list creation
parent
5e64eaa3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/classes/SCDclass_expcode.m
+32
-26
32 additions, 26 deletions
code/classes/SCDclass_expcode.m
with
32 additions
and
26 deletions
code/classes/SCDclass_expcode.m
+
32
−
26
View file @
5f80b86f
...
...
@@ -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
)
nodedd
=
Simulink
.
data
.
dictionary
.
open
(
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
'
;
...
...
@@ -1044,30 +1051,29 @@ classdef SCDclass_expcode
function
obj
=
setupwrappers
(
obj
)
for
ii
=
1
:
numel
(
obj
.
wrapperlist
)
inode
=
obj
.
wrapperlist
{
ii
}{
1
};
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
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
otherwise
warning
(
'SCDclass_expcode:setupwrappers'
,
'not supported node'
);
end
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
case
{
1
,
8
}
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
}
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
function
addRFMbus
(
obj
,
dd
)
ddSection
=
dd
.
getSection
(
'Design Data'
);
zeroElem
=
Simulink
.
BusElement
;
...
...
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