Skip to content

Commit c6fe683

Browse files
Add missing check for changed simulation stopping time to SystemSC::stepUntil()
1 parent 25e1a2b commit c6fe683

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/OMSimulatorLib/SystemSC.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,10 @@ oms_status_enu_t oms::SystemSC::stepUntil(double stopTime)
959959
if (status != oms_status_ok)
960960
logWarning("Bad return code at time " + std::to_string(time));
961961

962+
// Check whether stopping time has changed due to a request from an FMU
963+
if (getModel().getStopTime() < endTime)
964+
endTime = getModel().getStopTime();
965+
962966
if (isTopLevelSystem() && Flags::ProgressBar() && time > lastTime + maximumStepSize)
963967
{
964968
Log::ProgressBar(startTime, stopTime, time);

0 commit comments

Comments
 (0)