From e4ec5de915a40e36193e8366fe5ef79adca4d561 Mon Sep 17 00:00:00 2001 From: Torsten Sommer Date: Mon, 28 Oct 2024 16:00:26 +0100 Subject: [PATCH] Allow setting continuous states in Event Mode fixes #618 --- BouncingBall/model.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/BouncingBall/model.c b/BouncingBall/model.c index 518a1921..7095e989 100644 --- a/BouncingBall/model.c +++ b/BouncingBall/model.c @@ -61,8 +61,9 @@ Status setFloat64(ModelInstance* comp, ValueReference vr, const double value[], #if FMI_VERSION > 1 if (comp->state != Instantiated && comp->state != InitializationMode && - comp->state != ContinuousTimeMode) { - logError(comp, "Variable \"h\" can only be set in Instantiated Mode, Initialization Mode, and Continuous Time Mode."); + comp->state != ContinuousTimeMode && + comp->state != EventMode) { + logError(comp, "Variable \"h\" can only be set in Instantiated Mode, Initialization Mode, Continuous Time Mode, and Event Mode."); return Error; } #endif @@ -73,8 +74,9 @@ Status setFloat64(ModelInstance* comp, ValueReference vr, const double value[], #if FMI_VERSION > 1 if (comp->state != Instantiated && comp->state != InitializationMode && - comp->state != ContinuousTimeMode) { - logError(comp, "Variable \"v\" can only be set in Instantiated Mode, Initialization Mode, and Continuous Time Mode."); + comp->state != ContinuousTimeMode && + comp->state != EventMode) { + logError(comp, "Variable \"v\" can only be set in Instantiated Mode, Initialization Mode, Continuous Time Mode, and Event Mode."); return Error; } #endif