Skip to content

Commit

Permalink
- fix for #2840
Browse files Browse the repository at this point in the history
 - a bit of clean up in the fmi interfaces


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23803 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Dec 16, 2014
1 parent 58fad24 commit f792688
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 52 deletions.
25 changes: 0 additions & 25 deletions SimulationRuntime/fmi/export/fmi1/fmu1_model_interface.c
Expand Up @@ -874,28 +874,3 @@ fmiStatus fmiSetExternalFunction(fmiComponent c, fmiValueReference vr[], size_t
}
return fmiOK;
}

// relation functions used in zero crossing detection
fmiReal
FmiLess(fmiReal a, fmiReal b)
{
return a - b;
}

fmiReal
FmiLessEq(fmiReal a, fmiReal b)
{
return a - b;
}

fmiReal
FmiGreater(fmiReal a, fmiReal b)
{
return b - a;
}

fmiReal
FmiGreaterEq(fmiReal a, fmiReal b)
{
return b - a;
}
30 changes: 3 additions & 27 deletions SimulationRuntime/fmi/export/fmi2/fmu2_model_interface.c
Expand Up @@ -191,17 +191,18 @@ fmi2Status fmi2EventUpdate(fmi2Component c, fmi2EventInfo* eventInfo)
if(comp->fmuData->callback->checkForDiscreteChanges(comp->fmuData) || comp->fmuData->simulationInfo.needToIterate || checkRelations(comp->fmuData) || eventInfo->valuesOfContinuousStatesChanged)
{
FILTERED_LOG(comp, fmi2OK, LOG_FMI2_CALL, "fmi2EventUpdate: Need to iterate(discrete changes)!")
eventInfo->newDiscreteStatesNeeded = fmi2False;
eventInfo->newDiscreteStatesNeeded = fmi2True;
eventInfo->nominalsOfContinuousStatesChanged = fmi2False;
eventInfo->valuesOfContinuousStatesChanged = fmi2True;
eventInfo->terminateSimulation = fmi2False;
}
else
{
eventInfo->newDiscreteStatesNeeded = fmi2True;
eventInfo->newDiscreteStatesNeeded = fmi2False;
eventInfo->nominalsOfContinuousStatesChanged = fmi2False;
eventInfo->terminateSimulation = fmi2False;
}
FILTERED_LOG(comp, fmi2OK, LOG_FMI2_CALL, "fmi2EventUpdate: newDiscreteStatesNeeded %s",eventInfo->newDiscreteStatesNeeded?"true":"false");

/* due to an event overwrite old values */
overwriteOldSimulationData(comp->fmuData);
Expand Down Expand Up @@ -976,28 +977,3 @@ fmi2Status fmi2SetExternalFunction(fmi2Component c, fmi2ValueReference vr[], siz
}
return fmi2OK;
}

// relation functions used in zero crossing detection
fmi2Real
FmiLess(fmi2Real a, fmi2Real b)
{
return a - b;
}

fmi2Real
FmiLessEq(fmi2Real a, fmi2Real b)
{
return a - b;
}

fmi2Real
FmiGreater(fmi2Real a, fmi2Real b)
{
return b - a;
}

fmi2Real
FmiGreaterEq(fmi2Real a, fmi2Real b)
{
return b - a;
}

0 comments on commit f792688

Please sign in to comment.