Skip to content

Commit

Permalink
Allow setting continuous states in Event Mode (#619)
Browse files Browse the repository at this point in the history
fixes #618
  • Loading branch information
t-sommer authored Oct 28, 2024
1 parent 6d19392 commit 9319d64
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions BouncingBall/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9319d64

Please sign in to comment.