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
6b21a65a
Commit
6b21a65a
authored
4 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix
parent
979af079
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_algo.m
+8
-8
8 additions, 8 deletions
code/classes/SCDclass_algo.m
with
8 additions
and
8 deletions
code/classes/SCDclass_algo.m
+
8
−
8
View file @
6b21a65a
...
...
@@ -194,7 +194,7 @@ classdef SCDclass_algo
% as an optional third argument of addtunparamstruct
% method
dict
=
Simulink
.
data
.
dictionary
.
open
(
obj
.
getdatadictionary
);
DD
=
getSection
(
dict
,
'Design Data'
);
designDataobj
=
getSection
(
dict
,
'Design Data'
);
for
ii
=
1
:
numel
(
obj
.
exportedtps
)
if
~
isempty
(
obj
.
exportedtpsdefaults
{
ii
})
% get current value of parameters from the function
...
...
@@ -211,8 +211,8 @@ classdef SCDclass_algo
P
.
CoderInfo
.
StorageClass
=
'ExportedGlobal'
;
% updates default tunable parameters structure in data dictionary
tmplname
=
sprintf
(
'%s_tmpl'
,
obj
.
exportedtps
{
ii
});
if
DD
.
exist
(
tmplname
)
oldEntry
=
DD
.
getEntry
(
tmplname
);
if
designDataobj
.
exist
(
tmplname
)
oldEntry
=
designDataobj
.
getEntry
(
tmplname
);
if
isequal
(
oldEntry
.
getValue
.
Value
,
P
.
Value
)
fprintf
(
'%s: keep old template %s since not changed\n'
,
obj
.
getname
,
tmplname
);
continue
;
...
...
@@ -223,7 +223,7 @@ classdef SCDclass_algo
end
else
fprintf
(
' %s: added new %s\n'
,
obj
.
getname
,
tmplname
);
DD
.
addEntry
(
tmplname
,
P
);
designDataobj
.
addEntry
(
tmplname
,
P
);
end
end
end
...
...
@@ -485,9 +485,9 @@ classdef SCDclass_algo
end
end
function
changed
=
replaceorcreateddentry
(
obj
,
d
d
,
entry
,
value
)
if
d
d
.
exist
(
entry
)
oldEntry
=
d
d
.
getEntry
(
entry
);
function
changed
=
replaceorcreateddentry
(
obj
,
d
esignDataObj
,
entry
,
value
)
if
d
esignDataObj
.
exist
(
entry
)
oldEntry
=
d
esignDataObj
.
getEntry
(
entry
);
if
isequal
(
oldEntry
.
getValue
,
value
)
fprintf
(
'%s: keep old value of %s since not changed\n'
,
obj
.
getname
,
entry
);
changed
=
false
;
...
...
@@ -498,7 +498,7 @@ classdef SCDclass_algo
end
else
fprintf
(
' %s: added new %s\n'
,
obj
.
getname
,
entry
);
DD
.
addEntry
(
entry
,
value
);
designDataObj
.
addEntry
(
entry
,
value
);
changed
=
true
;
end
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