﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4381	OMEdit: A for loop in equations leads to vanishing of connection annotations (wires)	Jan Kokert	Adeel Asghar	"We just figured out another very strange bug in OMEdit. Consider the following example:
{{{
#!modelica
model test
  Modelica.Electrical.Analog.Basic.Ground ground1 annotation(
    Placement(visible = true, transformation(origin = {-30, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.Ground ground2 annotation(
    Placement(visible = true, transformation(origin = {30, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.Resistor resistor1 annotation(
    Placement(visible = true, transformation(origin = {30, 10}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Analog.Basic.Capacitor capacitor1 annotation(
    Placement(visible = true, transformation(origin = {-30, 10}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));

  Real a,b;
equation
  for i in 1:2 loop
    a = b;
  end for;
  connect(resistor1.n, ground2.p) annotation(
    Line(points = {{30, 0}, {30, 0}, {30, -20}, {30, -20}}, color = {0, 0, 255}));
  connect(capacitor1.p, resistor1.p) annotation(
    Line(points = {{-30, 20}, {-30, 20}, {-30, 30}, {30, 30}, {30, 20}, {30, 20}}, color = {0, 0, 255}));
  connect(capacitor1.n, ground1.p) annotation(
    Line(points = {{-30, 0}, {-30, 0}, {-30, -20}, {-30, -20}}, color = {0, 0, 255}));
  
  annotation(
    uses(Modelica(version = ""3.2.2"")));
end test;
}}}

The connection annotation between capacitor1 and ground1 '''is not shown'''. You can put a {{{/* ... */}}} comment around the {{{for loop}}} block and the connection will be displayed corretly.

It is always the annotation of the '''last''' connection statement, which is not evaluated. I guess, that the internal iterator which evaluates the connection annotations somehow interprets also the {{{for}}} statement and then one annotation is missing in the end.

I hope this analysis helps to fix this issue.
"	defect	closed	normal	1.12.0	OMEdit		fixed	for loop connection annotations	
