Opened 5 years ago

Last modified 3 years ago

#5610 reopened defect

Implement IconMap and DiagramMap annotations

Reported by: Francesco Casella Owned by: Adeel Asghar
Priority: blocker Milestone: 1.19.0
Component: OMEdit Version: 1.18.0-dev
Keywords: Cc: Andrea Bartolini

Description

The IconMap and DiagramMap annotations were introduced in Modelica 3.0 long time ago, but they are still not implemented in OpenModelica.

The attached package provides a simple test case. The icon of the model in Test2 should only show "M2", and the diagram should be rescaled compared to the diagram of M1.

Attachments (2)

TestPrimitiveVisible.mo (697 bytes ) - added by Francesco Casella 5 years ago.
TestPrimitiveVisible1.mo (901 bytes ) - added by Andrea Bartolini 4 years ago.

Download all attachments as: .zip

Change History (8)

by Francesco Casella, 5 years ago

Attachment: TestPrimitiveVisible.mo added

comment:1 by Francesco Casella, 5 years ago

Cc: Andrea Bartolini added

comment:2 by Adeel Asghar, 5 years ago

Status: newaccepted
Type: defectenhancement

The example is wrong. The IconMap and DiagramMap annotations are for the extends clause. So the model M2 should be,

model M2
    extends M1 annotation(IconMap(primitivesVisible = false));
  annotation(Icon(graphics = {Text(origin = {-1, -49}, extent = {{-101, 49}, {101, -49}}, textString = "M2")}, coordinateSystem(initialScale = 0.1)));
end M2;

instead of,

model M2
    extends M1;
  annotation(
      IconMap(primitivesVisible = false),
      Icon(graphics = {Text(origin = {-1, -49}, extent = {{-101, 49}, {101, -49}}, textString = "M2")}, coordinateSystem(initialScale = 0.1)));
end M2;

The icon of the model in Test2 should only show "M2", and the diagram should be rescaled compared to the diagram of M1.

The rescaling is only done when the extent attribute is defined.

comment:3 by Adeel Asghar, 5 years ago

Resolution: fixed
Status: acceptedclosed

comment:4 by Andrea Bartolini, 4 years ago

Milestone: 1.14.01.18.0
Resolution: fixed
Status: closedreopened
Type: enhancementdefect
Version: 1.18.0-dev

Please consider the attached package TestPromotoveVisible1.mo

The model M2 extends M1 with the following annotation:

model M2
    extends M1 annotation(
      IconMap(primitivesVisible = false));

In the library tree the Model M2 icon is shown accordingly to the primitivesVisible = false modifier (i.e. the icon of the model M1 is not shown), but when the model M2 is dropped into the diagram of another model (model Test in this case) the icon of model M1 is shown again.

OMEdit - OpenModelica Connection Editor
Connected to OpenModelica 1.18.0~dev-43-g9c61439
sysop: ubuntu 18.04

by Andrea Bartolini, 4 years ago

Attachment: TestPrimitiveVisible1.mo added

comment:5 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

comment:6 by Francesco Casella, 3 years ago

Milestone: 1.19.0

1.18.0 blocker tickets moved to 1.19.0

Note: See TracTickets for help on using tickets.