Skip to content

Commit

Permalink
SIMVAR's numArrayElement is not sufficient, ticket:4093
Browse files Browse the repository at this point in the history
It may contain a dimension for a scalar. See e.g.
Modelica.Electrical.PowerConverters.Examples.ACDC.Rectifier1Pulse.Thyristor1Pulse_R
  • Loading branch information
rfranke authored and OpenModelica-Hudson committed Oct 29, 2016
1 parent c655395 commit 4a3540b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -11255,7 +11255,7 @@ template preCallExp(Exp left, Exp right, Context context, Text &varDecls, SimCod
case left as DAE.CREF(componentRef = cr) then
let var = cref1(cr, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, context, varDecls, stateDerVectorName, useFlatArrayNotation)
match cref2simvar(cr, simCode)
case SIMVAR(numArrayElement = {}) then
case SIMVAR(arrayCref = NONE()) then
<<
<%var%> = _discrete_events->pre(<%var%>);
>>
Expand All @@ -11268,11 +11268,11 @@ template preCallExp(Exp left, Exp right, Context context, Text &varDecls, SimCod
<%forLoops%>
<%var%>(<%indices%>) = _discrete_events->pre(<%var%>(<%indices%>));
>>
else
<<; // unknown pre type>>
end match
else
<<; // unknown lhs for pre>>
<<
#error unknown preCallExp <%ExpressionDumpTpl.dumpExp(left, "\"")%>
>>
end match
end preCallExp;

Expand Down

0 comments on commit 4a3540b

Please sign in to comment.