Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
dmt
Commits
11e0e8e5
Commit
11e0e8e5
authored
Apr 30, 2020
by
Laura Alexandra Sequeira Gouveia
Browse files
Simulink Mapper: Octet string convert uses loop instead of assigning
each element individually.
parent
6bf40fab
Changes
1
Hide whitespace changes
Inline
Side-by-side
dmt/B_mappers/simulink_B_mapper.py
View file @
11e0e8e5
...
...
@@ -158,9 +158,9 @@ class FromASN1SCCtoSimulink(RecursiveMapper):
lines
=
[]
# type: List[str]
limit
=
sourceSequenceLimit
(
node
,
srcVar
)
for
i
in
range
(
0
,
node
.
_range
[
-
1
]):
lines
.
append
(
"
if (%s>=%d)
%s.element_data[
%d
] = %s.arr[
%d]; else %s.element_data[%d] = 0;
\n
"
%
(
limit
,
i
+
1
,
dstSimulink
,
i
,
srcVar
,
i
,
dstSimulink
,
i
))
lines
.
append
(
"unsigned int i=0;
\n
"
);
lines
.
append
(
"
for(i=0; i<%s; i++)
\n
%s.element_data[
i
] = %s.arr[
i];
\n
"
%
(
limit
,
dstSimulink
,
srcVar
));
if
len
(
node
.
_range
)
>
1
and
node
.
_range
[
0
]
!=
node
.
_range
[
1
]:
lines
.
append
(
"%s.length = %s;
\n
"
%
(
dstSimulink
,
limit
))
return
lines
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment