﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5628	OMEdit doesn't allow to choose the array element when a connection is made from graphical view	Andrea.bartolini	Adeel Asghar	"in the current nightly OMEdit doesn't allow to choose the array element when a connection to an array connector is made from graphical view.
The automatic selection of the array element is made instead (in ascending order).

This may lead to misbehavior of model in some cases, and some bugs are present in this new feature.

1)'''[misbehavior]''' there are models in which different order of the connection of scalar outputs to an input array changes the behavior of the model itself. In this case the impossibility to choose the element order of the connections to the array may lead the model to work not properly.

2)'''[bug]''' if you try to connect an array output to an array input this is what you obtain:

Before connection:
{{{
model test
  Modelica.Blocks.MathBoolean.And and1(nu = 3)  annotation(...);
  Modelica.Blocks.Sources.BooleanExpression booleanExpression1[3] annotation(...);
equation
end test;
}}}

After connection:
{{{
model test
  Modelica.Blocks.MathBoolean.And and1(nu = 1)  annotation(...);
  Modelica.Blocks.Sources.BooleanExpression booleanExpression1[2] annotation(...);
equation
  connect(booleanExpression1.y, and1.u[1]) annotation(...);
end test;
}}}

OMEdid has arbitrarily changed the dimension of and1 and the result is wrong

3)'''[bug]'''  same behavior is obtained when you try to connect an expandable connector to an array input:

expandable connector:
{{{  
expandable connector Bus annotation(...);
end Bus;
}}}
  
before connection:
{{{
model M
  Modelica.Blocks.MathBoolean.And and1(nu=3) annotation(...);
  test.Bus bus1 annotation(...);
equation
end M;
}}}

after connection:
{{{
model M
  Modelica.Blocks.MathBoolean.And and1(nu= 1) annotation(...);
  test.Bus bus1 annotation(...);
equation
  connect(bus1, and1.u[1]) annotation(...);
end M;
}}}

In this case two errors are obtained, the first is the same of the previous case, the second is that not any element of the expandable connector may be selected.

In my opinion the possibility to select the array and the expandable connector element should be restored (as was been in the past), and the user should be choose what kind of graphical connection method it wants to use, for example via a new flag in the OMEdit setting.

OMEdit - OpenModelica Connection Editor
Connected to OpenModelica 1.14.0~dev-26688-gbe00c7f
sysop Ubuntu 18.04
"	defect	closed	blocker	1.14.0	OMEdit	v1.14.0-dev-nightly	fixed		Francesco Casella
