Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to use default Ellipse closure with DynamicSelect #3646

Open
henrikt-ma opened this issue Feb 5, 2025 · 0 comments
Open

Impossible to use default Ellipse closure with DynamicSelect #3646

henrikt-ma opened this issue Feb 5, 2025 · 0 comments

Comments

@henrikt-ma
Copy link
Collaborator

It seems like an omission to not define the default for Ellipse.closure using a dedicated enumerator. From https://specification.modelica.org/master/annotations.html#ellipse:

  EllipseClosure closure =
    if startAngle == 0 and endAngle == 360 then
      EllipseClosure.Chord
    else
      EllipseClosure.Radial;

Since the startAngle and endAngle can't be referenced in an expression, there currently is no way to put the default behavior in the first argument of a DynamicSelect.

I suggest that the default is described using a dedicated enumerator, and that the behavior is described in the text instead:

  EllipseClosure closure = EllipseClosure.Default;

The behavior of EllipseClosure.Default is defined as EllipseClosure.Radial unless when startAngle is 0 and endAngle is 360, when it is EllipseClosure.Chord instead.

I am not suggesting this because the use of DynamicSelect is extremely relevant for closure, but because this makes it impossible for GUIs to treat this attribute consistently with the other Ellipse attributes, and we have already lost too much time whining about this trivially fixable problem internally at Wolfram.

@henrikt-ma henrikt-ma changed the title Impossible to use default ellipse closure with DynamicSelect Impossible to use default Ellipse closure with DynamicSelect Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant