Skip to content

Commit

Permalink
- mind your tabs please!
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13945 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Nov 18, 2012
1 parent d6f21de commit b7a7195
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Compiler/Template/CodegenAdevs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ case SIMCODE(modelInfo = MODELINFO(varInfo = vi as VARINFO(__))) then
void save_vars();
void restore_vars();
void clear_event_flags();
bool check_for_new_events();
bool check_for_new_events();
bool initial() const { return atInit; }

void calc_vars(const double* q = NULL, bool doReinit = false);
Expand Down Expand Up @@ -414,24 +414,24 @@ case SIMCODE(modelInfo = MODELINFO(vars = vars as SIMVARS(__))) then

bool <%lastIdentOfPath(modelInfo.name)%>::check_for_new_events()
{
bool result = false;
double* z = new double[numZeroCrossings()];
bool result = false;
double* z = new double[numZeroCrossings()];
<%zeroCrossingEqns(relations)%>
for (int i = 0; i < numZeroCrossings(); i++)
{
if (z[i] < -epsilon && zc[i] == 1)
{
result = true;
zc[i] = 0;
}
else if (z[i] > epsilon && zc[i] == 0)
{
result = true;
zc[i] = 1;
}
}
delete [] z;
return result;
for (int i = 0; i < numZeroCrossings(); i++)
{
if (z[i] < -epsilon && zc[i] == 1)
{
result = true;
zc[i] = 0;
}
else if (z[i] > epsilon && zc[i] == 0)
{
result = true;
zc[i] = 1;
}
}
delete [] z;
return result;
}

void <%lastIdentOfPath(modelInfo.name)%>::state_event_func(const double* q, double* z)
Expand Down Expand Up @@ -635,7 +635,7 @@ case SIMCODE(modelInfo = MODELINFO(vars = vars as SIMVARS(__))) then
// Calculate the odes
<%allEqns(allEquations,whenClauses)%>
if (atEvent)
newEvents = check_for_new_events();
newEvents = check_for_new_events();
if (reInit || newEvents)
{
save_vars();
Expand Down

0 comments on commit b7a7195

Please sign in to comment.