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
fd288143
Commit
fd288143
authored
3 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
Add timing to wrapper and check correct algo dt when adding
parent
ac893d2f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
code/classes/SCDclass_component.m
+6
-0
6 additions, 0 deletions
code/classes/SCDclass_component.m
code/classes/SCDclass_node.m
+0
-1
0 additions, 1 deletion
code/classes/SCDclass_node.m
code/classes/SCDclass_wrapper.m
+4
-2
4 additions, 2 deletions
code/classes/SCDclass_wrapper.m
with
10 additions
and
3 deletions
code/classes/SCDclass_component.m
+
6
−
0
View file @
fd288143
...
...
@@ -12,6 +12,7 @@ classdef SCDclass_component
mdlname
% simulink model name
ddname
% data dictionary name
algos
% algorithms contained in this wrapper
timing
% sample time
end
methods
...
...
@@ -19,6 +20,11 @@ classdef SCDclass_component
function
obj
=
addalgo
(
obj
,
algo
)
% add an algorithm object
assert
(
isa
(
algo
,
'SCDclass_algo'
));
assert
(
algo
.
gettiming
.
dt
==
obj
.
timing
.
dt
,
...
'Algorithm %s sample time: %f does not match %s sample time: %f'
,
...
algo
.
getname
,
algo
.
gettiming
.
dt
,
obj
.
name
,
obj
.
timing
.
dt
)
obj
.
algos
=
[
obj
.
algos
;
algo
];
end
...
...
This diff is collapsed.
Click to expand it.
code/classes/SCDclass_node.m
+
0
−
1
View file @
fd288143
...
...
@@ -11,7 +11,6 @@ classdef SCDclass_node < SCDclass_component
hasethercat
ncpu
% number of CPUs
cputype
timing
buildcfg
initscdbeforecomp
cpuactive
...
...
This diff is collapsed.
Click to expand it.
code/classes/SCDclass_wrapper.m
+
4
−
2
View file @
fd288143
classdef
SCDclass_wrapper
<
SCDclass_component
% Wrapper class containing algos
methods
function
obj
=
SCDclass_wrapper
(
name
)
function
obj
=
SCDclass_wrapper
(
name
,
dt
)
if
nargin
<
2
,
dt
=
1e-3
;
end
% default wrapper period
obj
.
name
=
name
;
obj
.
algos
=
[];
obj
.
ddname
=
[
name
,
'.sldd'
];
obj
.
mdlname
=
[
name
,
'.slx'
];
obj
.
timing
=
struct
(
'dt'
,
dt
);
assert
(
~
isempty
(
which
(
obj
.
mdlname
)),
...
'could not find %s for SCD component %s'
,
obj
.
mdlname
,
obj
.
name
);
end
...
...
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