Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- If fmi2Terminate is called and then fmi2Reset is called then reinitialize the data.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22422 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Sep 23, 2014
1 parent 1935535 commit 351ba91
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion SimulationRuntime/fmi/export/fmi2/fmu2_model_interface.c
Expand Up @@ -453,11 +453,17 @@ fmi2Status fmi2Reset(fmi2Component c) {
return fmi2Error;
FILTERED_LOG(comp, fmi2OK, LOG_FMI2_CALL, "fmi2Reset")

comp->state = modelInstantiated;
if (comp->state & modelTerminated) {
/* intialize modelData */
fmu2_model_interface_setupDataStruc(comp->fmuData);
initializeDataStruc(comp->fmuData);
}
/* reset the values to start */
setDefaultStartValues(comp);
setAllVarsToStart(comp->fmuData);
setAllParamsToStart(comp->fmuData);

comp->state = modelInstantiated;
return fmi2OK;
}

Expand Down

0 comments on commit 351ba91

Please sign in to comment.