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
5f54d62f
Commit
5f54d62f
authored
2 years ago
by
Cristian Galperti
Browse files
Options
Downloads
Patches
Plain Diff
shot optional parameter added
parent
809f886c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
algos/template/algoobj_template.m
+1
-1
1 addition, 1 deletion
algos/template/algoobj_template.m
classes/SCDclass_mdswg.m
+36
-14
36 additions, 14 deletions
classes/SCDclass_mdswg.m
with
37 additions
and
15 deletions
algos/template/algoobj_template.m
+
1
−
1
View file @
5f54d62f
...
...
@@ -22,7 +22,7 @@ obj=obj.addparameter(SCDclass_mdsparnumeric('kv2','colvect' ,'srcsrv','s
obj
=
obj
.
addparameter
(
SCDclass_mdsparnumeric
(
'km1'
,
'matrix'
,
'srcsrv'
,
'spcpc171.epfl.ch'
,
'srctree'
,
'martetest'
,
'shot'
,
parshot
));
%% Wavegens
obj
=
obj
.
addwavegen
(
SCDclass_mdswgsigsingle
(
'wg1'
,
'ai.ch001'
,
'srcsrv'
,
'spcpc171.epfl.ch'
,
'srctree'
,
'martetest'
,
'shot'
,
parshot
));
obj
=
obj
.
addwavegen
(
SCDclass_mdswgsigsingle
(
'ai.ch001'
,
'wg1'
,
'srcsrv'
,
'spcpc171.epfl.ch'
,
'srctree'
,
'martetest'
,
'shot'
,
parshot
));
%% Buses
obj
=
obj
.
addbus
(
'algo_template_inBus'
,
'algo_template_inBus_def'
);
...
...
This diff is collapsed.
Click to expand it.
classes/SCDclass_mdswg.m
+
36
−
14
View file @
5f54d62f
...
...
@@ -25,6 +25,9 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous
mdshelpstr
% MDS help string used in tree autopopulation
mdsvalidationstr
% MDS validation string used in autopopulation
overrideshot
% =1 if instantiated with overridden shot number, in this case this shot number will be always used during actualization
overrideshotn
% shot number in case of overridden shot number
end
properties
...
...
@@ -43,6 +46,7 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous
addParameter
(
obj
.
cparser
,
'modelname'
,
''
,
@
(
x
)
ischar
(
x
));
addParameter
(
obj
.
cparser
,
'mdshelp'
,
''
,
@
(
x
)
ischar
(
x
));
addParameter
(
obj
.
cparser
,
'mdsvalid'
,
'1'
,
@
(
x
)
ischar
(
x
));
addParameter
(
obj
.
cparser
,
'shot'
,
NaN
,
@
(
x
)
isnumeric
(
x
)
&&
isscalar
(
x
));
obj
.
verbose
=
1
;
obj
.
wavegenbasestruct
=
''
;
...
...
@@ -50,14 +54,22 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous
function
obj
=
parseconstructor
(
obj
,
srctdi
,
destwavegen
,
varargin
)
parse
(
obj
.
cparser
,
srctdi
,
destwavegen
,
varargin
{:}{:});
obj
.
mdsserver
=
obj
.
cparser
.
Results
.
srcsrv
;
obj
.
mdstree
=
obj
.
cparser
.
Results
.
srctree
;
obj
.
tdiexpr
=
obj
.
cparser
.
Results
.
srctdi
;
obj
.
wavegentarget
=
obj
.
cparser
.
Results
.
destwavegen
;
obj
.
modelname
=
obj
.
cparser
.
Results
.
modelname
;
obj
.
mdshelpstr
=
obj
.
cparser
.
Results
.
mdshelp
;
obj
.
mdsvalidationstr
=
obj
.
cparser
.
Results
.
mdsvalid
;
P
=
obj
.
cparser
.
Results
;
obj
.
mdsserver
=
P
.
srcsrv
;
obj
.
mdstree
=
P
.
srctree
;
obj
.
tdiexpr
=
P
.
srctdi
;
obj
.
wavegentarget
=
P
.
destwavegen
;
obj
.
modelname
=
P
.
modelname
;
obj
.
mdshelpstr
=
P
.
mdshelp
;
obj
.
mdsvalidationstr
=
P
.
mdsvalid
;
if
isnan
(
P
.
shot
)
obj
.
overrideshot
=
0
;
else
obj
.
overrideshot
=
1
;
obj
.
overrideshotn
=
P
.
shot
;
end
end
end
...
...
@@ -76,10 +88,23 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous
% Not abstract methods common to all child classes
methods
function
mdsconnect
(
obj
,
shot
)
assert
(
~~
exist
(
'mdsconnect'
,
'file'
),
...
'SCD:NoMDS'
,
'mdsconnect not found, are the mds matlab tools installed?'
)
% If the class has been declared with a 'shot' parameter, then
% the shotnumber used for param loading is overridden by this
% parameter, otherwise it is taken from the global shot number
% given to the actualize command
if
obj
.
overrideshot
==
1
localshot
=
obj
.
overrideshotn
;
else
localshot
=
shot
;
end
mdsconnect
(
obj
.
mdsserver
);
s
=
mdsopen
(
obj
.
mdstree
,
shot
);
str
=
sprintf
(
'SCDclass_mdswavegen (%s), failed opening MDS+ tree'
,
obj
.
wavegentarget
);
assert
(
s
==
shot
,
str
);
[
~
,
s
]
=
mdsopen
(
obj
.
mdstree
,
localshot
);
if
~
rem
(
s
,
2
)
warning
(
'SCDclass_mdspar:MDSerror'
,
'MDS+ tree open error for parameter %s. Actualization skipped.'
,
obj
.
modelparam
);
obj
.
actualizable
=
false
;
end
end
function
printinfo
(
obj
)
...
...
@@ -226,9 +251,6 @@ classdef SCDclass_mdswg < matlab.mixin.Heterogeneous
% Generate MARTe2 configuration entry
entrystring
=
genMARTe2entry
(
obj
,
shot
)
% Prints the parameter info summary
printinfo
(
obj
)
% Populates the corresponding MDS node with workspace values
autopopulatemds
(
obj
,
shot
)
...
...
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