Skip to content

Commit

Permalink
Fixed update_vars to reset the init flag in adevs event functions
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15712 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
smiz committed Mar 30, 2013
1 parent 10e9d84 commit ce16b0d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Compiler/Template/CodegenAdevs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ case SIMCODE(modelInfo = MODELINFO(varInfo = vi as VARINFO(__))) then
void external_event(double* q, double e,
const adevs::Bag<OMC_ADEVS_IO_TYPE>& xb){}
void confluent_event(double *q, const bool* state_event,
const adevs::Bag<OMC_ADEVS_IO_TYPE>& xb){}
const adevs::Bag<OMC_ADEVS_IO_TYPE>& xb)
{
internal_event(q,state_event);
}
void output_func(const double *q, const bool* state_event,
adevs::Bag<OMC_ADEVS_IO_TYPE>& yb){}
void gc_output(adevs::Bag<OMC_ADEVS_IO_TYPE>& gb){}
Expand Down Expand Up @@ -190,6 +193,9 @@ case SIMCODE(modelInfo = MODELINFO(varInfo = vi as VARINFO(__))) then
void update_vars(const double* q = NULL, bool doReinit = false)
{
calc_vars(q,doReinit);
for (int i = 0; i < numMathEvents(); i++)
if (eventFuncs[i] != NULL)
eventFuncs[i]->setInit(false);
save_vars();
}
/**
Expand Down

0 comments on commit ce16b0d

Please sign in to comment.