#4204 closed defect (fixed)
Parameter string not displayed correctly in diagram view
Reported by: | Owned by: | Adeel Asghar | |
---|---|---|---|
Priority: | high | Milestone: | 1.12.0 |
Component: | OMEdit | Version: | |
Keywords: | Cc: |
Description
Consider the following model
package TestName record ModuleData extends Modelica.Icons.Record; parameter String moduleName = "Generic"; annotation( defaultComponentName = "moduleData", defaultComponentPrefixes = "parameter", Icon(graphics = {Text(origin = {0, -130}, extent = {{-148, -20}, {148, 20}}, textString = "%moduleName")})); end ModuleData; model Module1 extends TestName.ModuleData(moduleName="Module1"); annotation( defaultComponentName = "moduleData", defaultComponentPrefixes = "parameter", Icon(coordinateSystem(initialScale = 0.1), graphics = {Text(origin = {0, -180}, lineColor = {255, 0, 0}, extent = {{-150, -10}, {150, 30}}, textString = "%moduleName", fontName = "DejaVu Sans Mono")})); end Module1; model Example extends Modelica.Icons.Example; parameter TestName.ModuleData moduleData annotation( Placement(visible = true, transformation(origin = {-30, 2}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); parameter TestName.Module1 moduleData1 annotation( Placement(visible = true, transformation(origin = {50, 2}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); end Example; end TestName;
Now switch to the Diagram View of Example. The string moduleName
is written in black in record ModuleData
using the text string %moduleName
in the icon layer. Record Module1
extends from ModuleData
and changes the text string. However, the inherited text string %moduleName
(black) does not show the correct name, but the additional text string %moduleName
(red) of Module1
is displayed correctly. The black and red text shall be equal.
Change History (3)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Milestone: | Future → 1.12.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in 7054a8c/OMEdit.
comment:3 by , 8 years ago
I forgot to fix the issue you mentioned in the comment.
But it is fixed now in eb8557c/OMEdit.
Note:
See TracTickets
for help on using tickets.
One additional note here: By default,
fontName = "DejaVu Sans Mono"
was inserted by OpenModelica. Since this font is specific to my (Linux) system, it may not be available on a Windows computer. To me it seems to make more sense to not insert a default name when creating a text field in the icon layer of Modelica class.