Skip to content

Commit bcc9fb2

Browse files
committed
- Implemented fmiSetTime function for FMI 2.0 export.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20911 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 83a4d60 commit bcc9fb2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SimulationRuntime/fmi/export/fmi2/fmu2_model_interface.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,11 @@ fmiStatus fmiCompletedIntegratorStep(fmiComponent c, fmiBoolean noSetFMUStatePri
474474
}
475475

476476
fmiStatus fmiSetTime(fmiComponent c, fmiReal time) {
477-
// TODO Write code here
477+
ModelInstance *comp = (ModelInstance *)c;
478+
if (invalidState(comp, "fmiSetTime", modelInstantiated|modelInitialized|modelStepping))
479+
return fmiError;
480+
FILTERED_LOG(comp, fmiOK, LOG_FMI_CALL, "fmiSetTime: time=%.16g", time)
481+
comp->fmuData->localData[0]->timeValue = time;
478482
return fmiOK;
479483
}
480484

0 commit comments

Comments
 (0)