Skip to content

Is DynamicSelect allowed in sub-expressions? #3667

@maltelenz

Description

@maltelenz

Section 18.9.6 says:

Any value (coordinates, color, text, etc.) in graphical annotations can be dependent on class variables using DynamicSelect.

And has the example:

 annotation(Icon(graphics = {
  Rectangle(
    extent =
      DynamicSelect({{0, 0}, {20, 20}},
                    {{0, 0}, {20, level}}),
    fillColor =
      DynamicSelect({0, 0, 255},
                    if overflow then {255, 0, 0} else {0, 0, 255})
  )})); 

My question is if it is allowed to use DynamicSelect on values further down in a hierarchy as well.

For example, would it be legal to rewrite the extent in the example above as:

    extent =
      {{0, 0}, {20, DynamicSelect(20, level)}}

For the record, this currently doesn't work in System Modeler. From what I can tell it doesn't work in OpenModelica either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clarificationSpecification of feature is unclear, but not incorrect

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions