Opened 5 years ago
Closed 5 years ago
#5923 closed defect (fixed)
OMEdit moves connectors in icons when they are moved in the block diagram and vice-versa
Reported by: | Andrea Bartolini | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | blocker | Milestone: | 1.16.0 |
Component: | OMEdit | Version: | v1.16.0-dev |
Keywords: | Cc: | Francesco Casella |
Description
Step to reproduce the issue:
1) open attached test.mo model
2) switch to the icon view
3) move a connector as you want
4) switch to the diagram view, the connector moved in icon view has moved also here
5) move a connector as you want in diagram view
6) switch back to the icon view, the connector moved in diagram view as moved also here
OMEdit - OpenModelica Connection Editor
Connected to OpenModelica 1.16.0~dev-301-g801a3d5
sysop ubuntu 18.04
Attachments (1)
Change History (6)
by , 5 years ago
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Hi Adeel... strange feature... icon and diagram are completely different contexts, so this kind of link is not so natural in my opinion, and usually in non trivial models the area of the diagram is bigger than the area of the icon, and the position of connectors in the diagram doesn't reflect the position in the icon.
In any case, it is very annoying (and also difficult to explain to the beginners) to have to manually change the coordinates in the text view in order to "detach" the connectors in the two views. It is advisable to implement some wildcard "like ctrl+something" to be used to easily make this detachment or, in my opinion better, keep the views detached by default and create a wildcard to move the connectors in both views at the same time.
Another possibility may be implement a flag in the options, in order to allow the user to choose the default behavior it prefers.
Kind regards,
Andrea
comment:3 by , 5 years ago
Additional note:
suppose to have a complex model and to need to add a connector on the icon. Suppose also that you need to move some connectors in the icon in order to properly place the new connector.
If the connectors are moved also in the diagram, the wires connected to them are rerouted and the probability that connectors or wires overlap other components in the diagram is very high...
If the user forget to "detach" the diagram from the icon (by manually change coordinates in the connectors annotation), this side effect can lead to the need to spend a lot of time in order to rearrange the diagram when a connector in the icon is moved, ...
Andrea
comment:4 by , 5 years ago
@adeas31, when you are dealing with complex diagrams, the best positions for connectors in the diagram (i.e. when you look into the guts of the model) may not be the same as in the icon (i.e., when you connect the model to others in a system).
Forcing connectors to have the same positions in those two views is not a good idea, because it may end up in spaghetti-diagrams with wires going around all over the place because the right position in the icon is just a dumb position in the diagram. Besides, if you can have different extents for the diagram and icon, of course you must allow to have different positions for the connector in diagram and icon.
This feature was introduced in Modelica 2.0 about 18 years ago, so it is coming of age now; it's time to support it in OMEdit :)
To summarize: in general the extent of diagram and icon can be different, and the positions of connectors in diagram and icons can also be different. We need a setting for both; the default may well be "keep the same" but there should be an option to make them different. BTW, this is already possible in the case of the extent.
comment:5 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
38a1cbb/OpenModelica. I have added a flag to enable disable this feature as we discussed in yesterdays developers meeting. Now there is a checkbox Move connectors together on both icon and diagram layers
under Tools->Options->Graphical Views
. By default this feature is disabled.
This is not a bug. Its a feature!
Connector is one component with two different views i.e., icon and diagram. Change in one view is also done in another view as long as they have the same transformation annotation. If they have different transformation annotations then they don't mimic each other. Try that by changing lets say iconTransformation of the connector. Add for example different rotation and then try moving one of them.