iconsmodelicadymola

Interface icon position wrongly linked between Icon Layer and Diagram Layer in DYMOLA/Modelica


This post about an annoying issue about Port icons position in Modelica language (DYMOLA GUI).

I have a model that uses Heatport and Fluid port interfaces.

What should happen, and happens most of the time :

Everything works fine usually for several models I use.

However, recently for one model, one of the ports in the DIagram layer is mysteriously linked to a port in the Icon layer. Hence they can't be move in the right position in both layers (Icon and Diagram).

The text code between the faulty (port_a_RES1) and rightly behaving ports (all other ports) are exactly the same, including the annotation :

 Fluid.Interfaces.FluidPort_a port_a_RES1(redeclare package Medium = Medium)    annotation (Placement(transformation(extent={{90,-110},{70,-90}}), iconTransformation(extent={{50,-110},{70,-90}})));
 Fluid.Interfaces.FluidPort_b port_b_RES2(redeclare package Medium = Medium)    annotation (Placement(transformation(extent={{-70,-110},{-90,-90}}),  iconTransformation(extent={{90,60},{110,80}})));

 Fluid.Interfaces.FluidPort_a port_a_RES2(redeclare package Medium = Medium)    annotation (Placement(transformation(extent={{-20,-110},{-40,-90}}), iconTransformation(extent={{90,30},{110,50}})));
 Fluid.Interfaces.FluidPort_b port_b_RES1(redeclare package Medium = Medium)    annotation (Placement(transformation(extent={{40,-110},{20,-90}}), iconTransformation(extent={{90,-80},{110,-60}})));

According to the Modelica specification https://specification.modelica.org/maint/3.5/annotations.html#annotations-for-graphical-objects extend is a list of 2 point, defining a rectangle that defines the Icon's position and shape.

The second couple of extent in the faulty port_a_RES1 transformation.extent[2] seems to stick to iconTransformation.extent[2] for some reason, when trying to graphically move the port_a_RES1 from etiher Icon or Diagram view.

I was able to manually correct the behaviour by modifing iconTransformation.extent.
But still, there appears to be some hidden variable here in DYMOLA, and it would be nice to know it...

Thanks for any insight !


Solution

  • Have you checked this option?

    Screenshot of Dymola's settings for Graphical Editor

    or the respective flag: Advanced.Editor.MoveConnectorsTogether?

    From what I recall the movement is only applied if the position in icon and graphical view are the same. Not 100% sure though...