Commit 9f4134a1 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Merge branch 'improv-simulink' into 'master'

Simulink Mapper improvement

See merge request !9
parents e8266a91 541a01ca
Pipeline #1627 passed with stage
in 3 minutes and 30 seconds
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment