Changeset 1a3fa31f in OpenModelica
- Timestamp:
- 2019-12-04T01:11:45+01:00 (4 years ago)
- Parents:
- e7ab1da5
- git-author:
- Adrian Pop <adrian.pop@…> (12/03/19 20:52:13)
- git-committer:
- Adrian Pop <adrian.pop@…> (12/04/19 01:11:45)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/Template/CodegenFMU.tpl
r48efb091 r1a3fa31f 1628 1628 Real triggerDSSEvent; 1629 1629 Real nextEventTime; 1630 <%if intGt(listLength(fmiInfo.fmiNumberOfContinuousStates), 0) then "Boolean doReinit(start = false, fixed = true);"%> 1630 1631 initial equation 1631 1632 flowStartTime = fmi1Functions.fmi1SetTime(fmi1me, time, 1); … … 1683 1684 if newStatesAvailable then 1684 1685 fmi_x_new := fmi1Functions.fmi1GetContinuousStates(fmi1me, numberOfContinuousStates, flowStatesInputs); 1685 <%fmiInfo.fmiNumberOfContinuousStates |> continuousStates => "reinit(fmi_x["+continuousStates+"], fmi_x_new["+continuousStates+"]);" ;separator="\n"%> 1686 doReinit := true; 1687 else 1688 doReinit := false; 1686 1689 end if; 1687 1690 >> 1688 1691 %> 1689 1692 end when; 1693 <%if intGt(listLength(fmiInfo.fmiNumberOfContinuousStates), 0) then 1694 << 1695 equation 1696 when doReinit then 1697 <%fmiInfo.fmiNumberOfContinuousStates |> continuousStates => "reinit(fmi_x["+continuousStates+"], fmi_x_new["+continuousStates+"]);" ;separator="\n"%> 1698 end when; 1699 >> 1700 %> 1690 1701 annotation(experiment(StartTime=<%fmiExperimentAnnotation.fmiExperimentStartTime%>, StopTime=<%fmiExperimentAnnotation.fmiExperimentStopTime%>, Tolerance=<%fmiExperimentAnnotation.fmiExperimentTolerance%>)); 1691 1702 annotation (Icon(graphics={ … … 1990 2001 Real triggerDSSEvent; 1991 2002 Real nextEventTime(fixed = true); 2003 <%if intGt(listLength(fmiInfo.fmiNumberOfContinuousStates), 0) then "Boolean doReinit(start = false, fixed = true);"%> 1992 2004 initial equation 1993 2005 flowStartTime = fmi2Functions.fmi2SetTime(fmi2me, time, 1); … … 2054 2066 if newStatesAvailable then 2055 2067 fmi_x_new := fmi2Functions.fmi2GetContinuousStates(fmi2me, numberOfContinuousStates, flowStatesInputs); 2056 <%fmiInfo.fmiNumberOfContinuousStates |> continuousStates => "reinit(fmi_x["+continuousStates+"], fmi_x_new["+continuousStates+"]);" ;separator="\n"%> 2068 doReinit := true; 2069 else 2070 doReinit := false; 2057 2071 end if; 2058 2072 >> 2059 2073 %> 2060 2074 end when; 2075 <%if intGt(listLength(fmiInfo.fmiNumberOfContinuousStates), 0) then 2076 << 2077 equation 2078 when doReinit then 2079 <%fmiInfo.fmiNumberOfContinuousStates |> continuousStates => "reinit(fmi_x["+continuousStates+"], fmi_x_new["+continuousStates+"]);" ;separator="\n"%> 2080 end when; 2081 >> 2082 %> 2061 2083 annotation(experiment(StartTime=<%fmiExperimentAnnotation.fmiExperimentStartTime%>, StopTime=<%fmiExperimentAnnotation.fmiExperimentStopTime%>, Tolerance=<%fmiExperimentAnnotation.fmiExperimentTolerance%>)); 2062 2084 annotation (Icon(graphics={
Note: See TracChangeset
for help on using the changeset viewer.