#5671 closed defect (fixed)
Bad scaling of icons in graphical view
Reported by: | Oliver Lenord | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | high | Milestone: | 1.16.0 |
Component: | OMEdit | Version: | v1.14.0-dev-nightly |
Keywords: | schema view, icon | Cc: |
Description
The icon of a model is badly scaled.
The corresponding annotation is:
Circuits.MTCircuit mTCircuit
annotation (Placement(transformation(extent={{32,-80},{80,80}})));
This is obviously wrong in OMEdit.
In Dymola it looks fine, see attached png.
Attachments (6)
Change History (19)
by , 5 years ago
Attachment: | Dymola.png added |
---|
comment:1 by , 5 years ago
Milestone: | 1.14.0 → 1.15.0 |
---|
by , 5 years ago
Attachment: | MTCircuit.mo added |
---|
comment:3 by , 5 years ago
Doesn't seems like correct model as referenced in the screenshots. Also it depends and is part of GFA_ThermoModel.IdealCoolantCircuitTRex.Circuits
library. Maybe you can make a minimal working example.
comment:4 by , 5 years ago
Milestone: | 1.15.0 → 2.0.0 |
---|
Moving this ticket to 2.0. More information is required.
comment:6 by , 5 years ago
1) Create package IconScaling
2) Create model IconClass within IconScaling
3) Create rectangle for IconClass
model IconClass equation annotation( Icon(graphics = {Rectangle(extent = {{-40, 100}, {40, -100}})})); end IconClass;
4) Create model IconInstance within IconScaling
5) drag IconClass into graphics window
model IconInstance IconClass iconClass annotation( Placement(visible = true, transformation(origin = {0, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); equation end IconInstance;
6) Change extent of IconClass icon
model IconClass equation annotation( Icon(graphics = {Rectangle(extent = {{-40, 100}, {40, -100}})}, coordinateSystem(extent = {{-40, -100}, {40, 100}})), Diagram(coordinateSystem(extent = {{-40, -100}, {40, 100}}))); end IconClass;
7) add another IconClass to IconInstance
package IconScaling model IconClass equation annotation( Icon(graphics = {Rectangle(extent = {{-40, 100}, {40, -100}})}, coordinateSystem(extent = {{-40, -100}, {40, 100}})), Diagram(coordinateSystem(extent = {{-40, -100}, {40, 100}}))); end IconClass; model IconInstance IconClass iconClass annotation( Placement(visible = true, transformation(origin = {0, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); IconClass iconClass1 annotation( Placement(visible = true, transformation(origin = {0, -10}, extent = {{-4, -10}, {4, 10}}, rotation = 0))); equation end IconInstance; end IconScaling;
Even though both icons are displayed identical in the graphics window, they show different values for the x-coordinate of the extent in the annotations.
Opening the same model in Dymola shows the two boxes at different widths.
This could also be a bug in Dymola or an impreciseness in the Modelica specification.
In fact I do like the behavior of OMEdit better, but it is annoying to get different results.
by , 5 years ago
Attachment: | IconScaling.mo added |
---|
by , 5 years ago
Attachment: | IconInstance_dymola.png added |
---|
by , 5 years ago
Attachment: | IconInstance_OMEdit.png added |
---|
comment:9 by , 5 years ago
Status: | new → accepted |
---|
I think I know what the problem is.
While creating the model you changed the coordinate system of IconClass
and that change is not sent out to the instances.
I will if I can fix this real quick.
comment:10 by , 5 years ago
OK. I have a fix but I need to clean up, make it proper and test a bit.
Basically when the coordinate system changes we should update the bounding rectangle of the component instance and apply all the transformations again using the new coordinates.
comment:11 by , 5 years ago
Please backport this to maintenance/v1.15
as well. I think we should leave 1.14.0 alone, just in case. The official release should be made tomorrow, I'll take no chances of breaking it.
comment:12 by , 5 years ago
Milestone: | 1.16.0 → 1.15.0 |
---|---|
Resolution: | → fixed |
Status: | accepted → closed |
Fixed in c3a557c/OpenModelica and ported to 1.15 as well.
comment:13 by , 4 years ago
Milestone: | 1.15.0 → 1.16.0 |
---|
Release 1.15.0 was scrapped, because replaceable support eventually turned out to be more easily implemented in 1.16.0. Hence, all 1.15.0 tickets are rescheduled to 1.16.0
Expected output (Dymola)