Can constants be used in graphical annotations? #3464
Labels
clarification
Specification of feature is unclear, but not incorrect
discussion
Indicates that there's a discussion; not clear if bug, enhancement, or working as intended
Milestone
We are updating the PowerGrids library to version 2.0.0. One new feature there is that component icons optionally show variables such as active and reactive power, voltage magnitude and phase, using DynamicSelect for their values. This works fine.
One problem here is that we have one base partial class for one-port components and one base class for two-port components, but there is no single placement of those labels that fits all the components inheriting from those base classes, because of the much different shape of the icons of, say, a bus, a machine, or a load. Unfortunately, once these labels have been defined in the base class, there is no way to modify their location when extending them.
An easy solution for that is to set the coordinates of such labels to some class constants, and then change them appropriately when inheriting from the base classes. This works out of the box in OpenModelica, whose front-end constant-evaluates all constants, but apparently doesn't work in Dymola.
It is not clear to me what the specification actually says about it. The Placement modifier contains a component of
Transformation
type, which contains aPoint
that is an array ofDrawingUnit
, which is just aReal
. Until Section 18.6.6 (Variable Graphics and Schematic Animation) there is no mention of the fact that those Reals should be constants, or even literal constants.Section 18.6.6 says:
It is not entirely clear to me if "variable" here means an actual, time-varying variable, or also a constant or a parameter. The words "Variable Graphics", "Animation" and "DynamicSelect" point out very clearly in the direction of time-varying stuff, there's not much animation or dynamics in a constant value. I guess this should be clarified.
In any case, I see two very different requirements here. One is to enable animation, and for that DynamicSelect is just fine. The other one is just to allow changing the location of graphical primitives when inheriting from a base class. For the latter purpose, being able to use constants (that can be changed when inheriting from base classes) to specify the placement of a graphic primitive would be really helpful. Restricting to constants that are bound directly to a literal constant value (i.e. non complicated constant expressions to evaluate) would be ok.
I would propose to allow this explicitly in the specification and to ask tool vendors to support this feature. This doesn't seem to me to be particularly difficult to implement.
What do you think?
Keeping @AndreaBartolini and @ceraolo in the loop.
The text was updated successfully, but these errors were encountered: