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
52821624
Commit
52821624
authored
4 years ago
by
Cristian Galperti
Browse files
Options
Downloads
Patches
Plain Diff
multiple MDS source wavegen MARTe2 cfg printer working
parent
0857650c
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
code/classes/SCDclass_expcode.m
+18
-11
18 additions, 11 deletions
code/classes/SCDclass_expcode.m
code/classes/SCDclass_mdsobjcontainer.m
+55
-7
55 additions, 7 deletions
code/classes/SCDclass_mdsobjcontainer.m
with
73 additions
and
18 deletions
code/classes/SCDclass_expcode.m
+
18
−
11
View file @
52821624
...
...
@@ -494,17 +494,24 @@ classdef SCDclass_expcode
obj
.
mdscontainer
.
printMARTe2parconfig
(
shot
);
end
function
printMARTe2wgbusconfig
(
obj
,
shot
,
ddname
,
busname
,
frequency
)
fprintf
(
"+MDSWavegen_%s = {\n"
,
busname
);
fprintf
(
" Class = MDSWavegen\n"
);
%fprintf(" Shot = %d\n",shot);
fprintf
(
" Shot = MDSSRCSHOT\n"
);
fprintf
(
" Frequency = %.2f\n"
,
frequency
);
dim
=
obj
.
mdscontainer
.
printMARTe2wgbusconfig
(
shot
,
ddname
,
busname
);
fprintf
(
" Signals = {\n"
);
fprintf
(
" wavegen_%s = { Type = float32 NumberOfElements = %d }\n"
,
busname
,
dim
);
fprintf
(
" }\n"
);
fprintf
(
"}\n"
);
function
printMARTe2wgbusconfig
(
obj
,
shot
,
busname
,
frequency
,
varargin
)
% printMARTe2wgbusconfig(obj, shot, busname, frequency, varargin)
%
% prints cfg file for loading busname Simulink.Bus
% as a wavegen (or a set of them) in MARTe2
% shot can be -1 or a fixed shot (usually -1), but currently
% the Shot= entry is populated by a fixed macro
% frequency is the frequency of signal generation in MARTe2
% the optional parameter 'ddname' can be given to specify
% the data dictionary where the bus definition is, if omitted
% tcv.sldd is used
p
=
inputParser
;
addParameter
(
p
,
'ddname'
,
'tcv.sldd'
,
@
(
x
)
ischar
(
x
));
parse
(
p
,
varargin
{:});
ddname
=
p
.
Results
.
ddname
;
dim
=
obj
.
mdscontainer
.
printMARTe2wgbusconfig
(
shot
,
ddname
,
busname
,
frequency
);
end
function
printparameters
(
obj
)
...
...
This diff is collapsed.
Click to expand it.
code/classes/SCDclass_mdsobjcontainer.m
+
55
−
7
View file @
52821624
...
...
@@ -276,6 +276,16 @@ classdef SCDclass_mdsobjcontainer
[
~
,
iorder
]
=
sortrows
(
mdsservertree
);
end
function
iorder
=
geWavegensServerTreeOrder
(
obj
)
% find server-tree order of wavegens
mdsservertree
=
cell
(
numel
(
obj
.
mdswavegens
),
2
);
for
ii
=
1
:
numel
(
obj
.
mdswavegens
)
mdsservertree
{
ii
,
1
}
=
obj
.
mdswavegens
(
ii
)
.
getMDSserver
;
mdsservertree
{
ii
,
2
}
=
obj
.
mdswavegens
(
ii
)
.
getMDStree
;
end
[
~
,
iorder
]
=
sortrows
(
mdsservertree
);
end
function
printMARTe2wgconfig
(
obj
,
shot
)
for
ii
=
1
:
obj
.
numwavegens
if
(
strcmp
(
obj
.
modeltogenerate
,
'all'
))
...
...
@@ -290,20 +300,25 @@ classdef SCDclass_mdsobjcontainer
end
end
function
overalldim
=
printMARTe2wgbusconfig
(
obj
,
shot
,
ddname
,
busname
)
function
overalldim
=
printMARTe2wgbusconfig
(
obj
,
shot
,
ddname
,
busname
,
frequency
)
dd
=
SCDconf_getdatadict
(
ddname
);
bus
=
dd
.
getEntry
(
busname
)
.
getValue
;
nelems
=
numel
(
bus
.
Elements
);
server
=
''
;
tree
=
''
;
dimension
=
0
;
overalldim
=
0
;
nwavegen
=
1
;
fprintf
(
"+MDSWavegen_%s_%d = {\n"
,
busname
,
nwavegen
);
fprintf
(
" Class = MDSWavegen\n"
);
fprintf
(
" Shot = MDSSRCSHOT\n"
);
fprintf
(
" Frequency = %.2f\n"
,
frequency
);
for
elem
=
1
:
nelems
signame
=
bus
.
Elements
(
elem
)
.
Name
;
found
=
false
;
for
wgs
=
1
:
obj
.
numwavegens
%signame
%obj.mdswavegens(wgs).gettarget
if
(
strcmp
(
obj
.
mdswavegens
(
wgs
)
.
gettarget
,
signame
))
found
=
true
;
break
;
...
...
@@ -312,13 +327,36 @@ classdef SCDclass_mdsobjcontainer
if
(
~
found
)
error
(
'SCDclass_mdsobjcontainer:wgnotfound'
,
'Signal %s not found in configured wavegens objects'
,
signame
);
else
actserver
=
obj
.
mdswavegens
(
wgs
)
.
getMDSserver
;
acttree
=
obj
.
mdswavegens
(
wgs
)
.
getMDStree
;
if
(
~
strcmp
(
actserver
,
server
)
||
~
strcmp
(
acttree
,
tree
))
if
(
~
strcmp
(
server
,
''
)
||
~
strcmp
(
tree
,
''
))
error
(
'SCDclass_mdsobjcontainer:multipleconnections'
,
'multiple MDS+ connections/trees not supported within the same wavegen generator'
);
fprintf
(
" Signals = {\n"
);
fprintf
(
" wavegen_%s_%d = { Type = float32 NumberOfElements = %d }\n"
,
busname
,
nwavegen
,
dimension
);
fprintf
(
" }\n"
);
fprintf
(
"}\n"
);
nwavegen
=
nwavegen
+
1
;
overlalldim
=
overalldim
+
dimension
;
dimension
=
0
;
fprintf
(
"+MDSWavegen_%s_%d = {\n"
,
busname
,
nwavegen
);
fprintf
(
" Class = MDSWavegen\n"
);
fprintf
(
" Shot = MDSSRCSHOT\n"
);
fprintf
(
" Frequency = %.2f\n"
,
frequency
);
server
=
actserver
;
tree
=
acttree
;
fprintf
(
' Server=%s\n'
,
server
);
fprintf
(
' Tree=%s\n'
,
tree
)
% error('SCDclass_mdsobjcontainer:multipleconnections','multiple MDS+ connections/trees not supported within the same wavegen generator');
else
server
=
actserver
;
tree
=
acttree
;
fprintf
(
' Server=%s\n'
,
server
);
...
...
@@ -332,9 +370,19 @@ classdef SCDclass_mdsobjcontainer
end
end
overalldim
=
dimension
;
fprintf
(
" Signals = {\n"
);
fprintf
(
" wavegen_%s_%d = { Type = float32 NumberOfElements = %d }\n"
,
busname
,
nwavegen
,
dimension
);
fprintf
(
" }\n"
);
fprintf
(
"}\n"
);
if
nwavegen
>
1
warning
(
'SCDclass_mdsobjcontainer:multipleconnections'
,
'multiple MDS+ connections/trees detected, an IOGAM must be used to concatenate wavegens outputs at MARTe2 RTThread level'
);
end
%overalldim=dimension;
%overlalldim=overalldim+dimension;
end
function
iorder
=
getWavegensServerTreeOrder
(
obj
)
...
...
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