Skip to content

Commit 522b1df

Browse files
author
Willi Braun
committed
- fixed terminal error in new fmi import
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13398 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 49a506d commit 522b1df

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Compiler/Template/CodegenFMU.tpl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,6 @@ case FMIIMPORT(fmiInfo=INFO(__),fmiExperimentAnnotation=EXPERIMENTANNOTATION(__)
11511151
Real flowControlEvent;
11521152
Real flowControlStatesInputs;
11531153
Boolean initializationDone(start=false);
1154-
Boolean deinitializationDone(start=false);
11551154
protected
11561155
<%dumpFMICommonObjects(platform)%>
11571156

@@ -1276,7 +1275,7 @@ case FMIIMPORT(fmiInfo=INFO(__),fmiExperimentAnnotation=EXPERIMENTANNOTATION(__)
12761275
<<
12771276
fmi_z = fmiFunctions.fmiGetEventIndicators(fmi, numberOfEventIndicators, flowControlEvent);
12781277
for i in 1:size(fmi_z,1) loop
1279-
fmi_z_positive[i] = fmi_z[i] > 0;
1278+
fmi_z_positive[i] = if not terminal() then fmi_z[i] > 0 else pre(fmi_z_positive[i]);
12801279
end for;
12811280
>>
12821281
%>
@@ -1292,11 +1291,7 @@ case FMIIMPORT(fmiInfo=INFO(__),fmiExperimentAnnotation=EXPERIMENTANNOTATION(__)
12921291
>>
12931292
%>
12941293
when terminal() then
1295-
// ensure that all deinitialization functions are called only once!
1296-
if not deinitializationDone then
12971294
fmi_status := fmiFunctions.fmiTerminate(fmi);
1298-
deinitializationDone := true;
1299-
end if;
13001295
end when;
13011296
equation
13021297
flowControlEvent = fmiFunctions.fmiCompletedIntegratorStep(fmi, callEventUpdate, flowControlStatesInputs);

0 commit comments

Comments
 (0)