11package CodegenCpp
22
33import interface SimCodeTV;
4-
4+ import CodegenUtil.*;
55// SECTION: SIMULATION TARGET, ROOT TEMPLATE
66
77
@@ -1064,7 +1064,7 @@ template simulationResults(Boolean test, SimCode simCode)
10641064::=
10651065match simCode
10661066case SIMCODE(modelInfo=MODELINFO(__),makefileParams=MAKEFILE_PARAMS(__),simulationSettingsOpt = SOME(settings as SIMULATION_SETTINGS(__))) then
1067- let results = if test then "" else '<%makefileParams .compileDir%>/'
1067+ let results = if test then "" else '<%makefileParamst .compileDir%>/'
10681068<<
10691069<%results%><%fileNamePrefix%>_res.<%settings.outputFormat%>
10701070>>
@@ -2123,13 +2123,13 @@ case FUNCTION(outVars={}) then
21232123case FUNCTION(outVars=_) then
21242124 let fname = underscorePath(name)
21252125 <<
2126- /* functionHeaderRegularFunction2 */
2126+ /* functionHeaderRegularFunction2*/
21272127 <%fname%>RetType <%fname%>(<%functionArguments |> var => funArgDefinition(var,simCode) ;separator=", "%>);
21282128 >>
21292129case EXTERNAL_FUNCTION(outVars=var::_) then
21302130let fname = underscorePath(name)
21312131 <<
2132- /* functionHeaderRegularFunction2 */
2132+ /* functionHeaderRegularFunction2*/
21332133 <%fname%>RetType <%fname%>(<%funArgs |> var => funArgDefinition(var,simCode) ;separator=", "%>);
21342134 >>
21352135case EXTERNAL_FUNCTION(outVars={}) then
@@ -5430,20 +5430,20 @@ template initAliasValst(Text &varDecls /*BUFP*/,list<SimVar> varsLst, SimCode si
54305430 case vStr as "(0)" then
54315431 ' <% preExp%>
54325432 <% getAliasVarName(sv.aliasvar, simCode,context)%>=<% vStr%> ;//<% cref(sv.name)%>
5433- _start_values[" <%getAliasVarName (sv.aliasvar, simCode,context )%>" ]=<% vStr%> ;'
5433+ _start_values[" <%cref (sv.name )%>" ]=<% vStr%> ;'
54345434 case vStr as "" then
54355435 ' <% preExp%>
54365436 <% getAliasVarName(sv.aliasvar, simCode,context)%>= 0;//<% cref(sv.name)%>
5437- _start_values[" <%getAliasVarName (sv.aliasvar, simCode,context )%>" ]=<% vStr%> ;'
5437+ _start_values[" <%cref (sv.name )%>" ]=<% vStr%> ;'
54385438 case vStr then
54395439 ' <% preExp%>
54405440 <% getAliasVarName(sv.aliasvar, simCode,context)%>=<% vStr%> ;//<% cref(sv.name)%>
5441- _start_values[" <%getAliasVarName (sv.aliasvar, simCode,context )%>" ]=<% vStr%> ;'
5441+ _start_values[" <%cref (sv.name )%>" ]=<% vStr%> ;'
54425442 end match
54435443 else
54445444 ' <% preExp%>
54455445 <% getAliasVarName(sv.aliasvar, simCode,context)%>=<% startValue(sv.type_)%> ;////<% crefStr(sv.name)%>
5446- _start_values[" <%getAliasVarName (sv.aliasvar, simCode,context )%>" ]=<% startValue(sv.type_)%> ;'
5446+ _start_values[" <%cref (sv.name )%>" ]=<% startValue(sv.type_)%> ;'
54475447 ;separator="\n "
54485448end initAliasValst;
54495449
@@ -5614,7 +5614,7 @@ template expTypeShort(DAE.Type type)
56145614 case T_ARRAY(__) then expTypeShort(ty)
56155615 case T_COMPLEX(complexClassType=EXTERNAL_OBJ(__))
56165616 then "void*"
5617- case T_COMPLEX(__) then 'complex3 '
5617+ case T_COMPLEX(__) then 'ComplexType '
56185618 case T_METATYPE(__) case T_METABOXED(__) then "metatype"
56195619 case T_FUNCTION_REFERENCE_VAR(__) then "fnptr"
56205620 else "expTypeShort:ERROR"
@@ -5645,7 +5645,7 @@ template arrayCrefCStr2(ComponentRef cr)
56455645 case CREF_QUAL(__) then '<%unquoteIdentifier(ident)%>_P_<%arrayCrefCStr2(componentRef)%>'
56465646 else "CREF_NOT_IDENT_OR_QUAL"
56475647end arrayCrefCStr2;
5648-
5648+ /*
56495649template underscorePath(Path path)
56505650 "Generate paths with components separated by underscores.
56515651 Replaces also the . in identifiers with _.
@@ -5659,7 +5659,7 @@ template underscorePath(Path path)
56595659 case FULLYQUALIFIED(__) then
56605660 underscorePath(path)
56615661end underscorePath;
5662-
5662+ */
56635663template replaceDotAndUnderscore(String str)
56645664 "Replace _ with __ and dot in identifiers with _"
56655665::=
@@ -10208,12 +10208,12 @@ case MODELINFO(vars=SIMVARS(__)) then
1020810208
1020910209 void <%lastIdentOfPath(name)%>::getString(string* z)
1021010210 {
10211- /*
10211+
1021210212 <% System.tmpTickReset(0)%>
1021310213 <% vars.stringAlgVars |> var => giveVariablesDefault(var, System.tmpTick()) ;separator= " \n " %>
1021410214 <% vars.stringParamVars |> var => giveVariablesDefault(var, System.tmpTick()) ;separator= " \n " %>
1021510215 <% vars.stringAliasVars |> var => giveVariablesDefault(var, System.tmpTick()) ;separator= " \n " %>
10216- */
10216+
1021710217 }
1021810218
1021910219 void <%lastIdentOfPath(name)%>::setReal(const double* z)
@@ -10267,7 +10267,7 @@ template giveVariablesDefault(SimVar simVar, Integer valueReference)
1026710267::=
1026810268match simVar
1026910269 case SIMVAR(__) then
10270- let description = if comment then '// " <%comment%>" '
10270+ let description = if comment then '/* <%comment%> */ '
1027110271 <<
1027210272 z[<%valueReference%>] = <%cref(name)%>; <%description%>
1027310273 >>
0 commit comments