Skip to content

Commit

Permalink
Fixed a bug in SimCodeCpp.tpl:outputIndices.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10781 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Kaie Kubjas authored and Kaie Kubjas committed Dec 19, 2011
1 parent 1d0871d commit 1bc3c0d
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions Compiler/susan_codegen/SimCode/SimCodeCpp.tpl
Expand Up @@ -171,7 +171,7 @@ case SIMCODE(modelInfo = MODELINFO(__)) then
_event_handling.resetHelpVar = boost::bind(&<%lastIdentOfPath(modelInfo.name)%>::resetHelpVar, this, _1);
_historyImpl = new HistoryImplType(globalSettings);
<%arrayReindex(modelInfo)%>
/* <%arrayInit(simCode)%> */
<%arrayInit(simCode)%>
//Load Algloopsover library
type_map types;
std::string algsover_name(SYSTEM_LIB);
Expand Down Expand Up @@ -1148,6 +1148,7 @@ case SIMCODE(modelInfo = MODELINFO(__)) then
<%initEventHandling%>
_event_handling.init(this,<%helpvarlength(simCode)%>);
saveAll();
vector<unsigned int> var_ouputs_idx;
<%initOutputIndices%>;
_historyImpl->setOutputs(var_ouputs_idx);
_historyImpl->clear();
Expand Down Expand Up @@ -2752,15 +2753,6 @@ case MODELINFO(vars=SIMVARS(__)) then
<%initValst(vars.intAliasVars, simCode)%>
<%initValst(vars.boolAliasVars, simCode)%>
<%initValst(vars.constVars, simCode)%>
/*
<%initValst(vars.intConstVars, simCode)%>
<%initValst(vars.boolConstVars, simCode)%>
<%initValst(vars.stringConstVars, simCode)%>
<%initValst(vars.paramVars, simCode)%>
<%initValst(vars.intParamVars, simCode)%>
<%initValst(vars.boolParamVars, simCode)%>
<%initValst(vars.stringParamVars, simCode)%>
*/
>>
end initvar;
Expand Down Expand Up @@ -2794,13 +2786,12 @@ template boundParameters(list<SimEqSystem> parameterEquations,Text &varDecls,Sim
end boundParameters;
template outputIndices(ModelInfo modelInfo)
::=
match modelInfo
case MODELINFO(vars=SIMVARS(__)) then
::= match modelInfo
case MODELINFO(varInfo=VARINFO(__),vars=SIMVARS(__)) then
if varInfo.numOutVars then
<<
vector<unsigned int> var_ouputs_idx;
var_ouputs_idx+=//<%vars.outputVars |> SIMVAR(__) => '<%index%>';separator=","%>
<%{(vars.algVars |> SIMVAR(__) => if isOutput(causality) then '<%index%>';separator=","),
var_ouputs_idx+=<%
{(vars.algVars |> SIMVAR(__) => if isOutput(causality) then '<%index%>';separator=","),
(vars.intAlgVars |> SIMVAR(__) => if isOutput(causality) then '<%numAlgvar(modelInfo)%>+<%index%>';separator=","),
(vars.boolAlgVars |> SIMVAR(__) => if isOutput(causality) then '<%numAlgvar(modelInfo)%>+<%numIntAlgvar(modelInfo)%>+<%index%>';separator=","),
(vars.stateVars |> SIMVAR(__) => if isOutput(causality) then '<%numAlgvars(modelInfo)%>+<%index%>';separator=","),
Expand Down Expand Up @@ -3096,7 +3087,7 @@ template equation_(SimEqSystem eq, Context context, Text &varDecls, SimCode simC
_algLoopSolver<%index%>->solve(command);
>>
else
"NOT IMPLEMENTED EQUATION"
"NOT IMPLEMENTED EQUATION"
end equation_;
template generateAlgloopsolvers(list<list<SimEqSystem>> continousEquations,list<SimEqSystem> discreteEquations,list<SimWhenClause> whenClauses,list<SimEqSystem> parameterEquations,SimCode simCode)
Expand Down

0 comments on commit 1bc3c0d

Please sign in to comment.