Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#2506 closed enhancement (fixed)

Keep connecting lines manhattanized

Reported by: massimo ceraolo Owned by: Adeel Asghar
Priority: normal Milestone: 1.9.2
Component: OMEdit Version: trunk
Keywords: Cc:

Description

Connecting lines must typically stay manhattanized (i.e. horziontal or vertical, not oblique) when components are dragged.
However, very often OMEdit creates strange lines, with several oblique segments.

For instance try moving around the components of the enclosed circuit.
I think that OMEdit should keep lines manhattanized when dragging, at least as an option.

Attachments (1)

RLC.mo (1.6 KB ) - added by massimo ceraolo 11 years ago.

Download all attachments as: .zip

Change History (15)

by massimo ceraolo, 11 years ago

Attachment: RLC.mo added

comment:1 by jan.kokert@…, 11 years ago

Hi ceraolo!

You are totally right. Wiring in OMEdit is almost unusable.
(No snap to grid, no undo, no manhattanized, no standard conform code generation)

Probably the whole connection representation must be reworked:
When I create a model (with Dymola or SystemModeler) for example, the wires in OMEdit are totally messed up.

comment:2 by Martin Sjölund, 11 years ago

Priority: lownormal

comment:3 by massimo ceraolo, 11 years ago

Two additions to my original post on this issue.
1) I've checked that connecting lines don't stay manhattanised in models originally created in Dymola. I din not observe this behaviour in models originally drawn in OMEdit.
Is this issue caused by non-standard annotations from Dymola or it is an OM issue?

2) When I first posted this thicket I tried to move objects with mouse.
I've recently also found that (on the attached RLC.mo model( if we try to move objects with keyboard arrows an even stranger behaviour is observed! (r20668)

comment:4 by Francesco Casella, 10 years ago

A good management of manhattanized connections should make sure that one can start from the RLC model posted above (which is written in perfectly legal and standard Modelica) and move any of its components so that:

  • the motion takes place on a step-2 grid (currently it is much more than that)
  • manhattanized connections are preserved as such, and not transformed into oblique connections

comment:5 by Francesco Casella, 10 years ago

See also #2477

comment:6 by Martin Sjölund, 10 years ago

Milestone: 1.9.11.9.2

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).

comment:7 by massimo ceraolo, 10 years ago

The situation has improved after the fixing of tickets #2477 and #2956.

Now moving around an object has less weird effects.
Maybe a simple and effective solution to this ticket can now be obtained allowing the user to add a node in a line (using context menu).

Now (r23316) if for instance in rlc.mo one moves "resistor" upwards, a line at its right becomes oblique. Would the user be allowed to add a node in that line, exploiting the now effective snap-to-grid function, I expect will be very easy to obtain the wished result, acting on that node.

comment:8 by Adeel Asghar, 10 years ago

You can add more points using the Connection Properties dialog. Double click the connection or right click and select properties.

However, note that currently I am working on this ticket. I want to keep lines manhattanized when things move around and add points automatically if required.

comment:9 by massimo ceraolo, 10 years ago

Aha.
I didn't see that dialog.
However that dialog asks you to write X and Y coordinates, that is a bit tricky.
Maybe you could add in the context menu an "add point" item, which adds the point where the mouse is (but snapped to grid).

Naturally, if you are able to manage auto-manhattanize with automatic addition of points, this could be even better.

One thing does not exclude the other.

comment:10 by Adeel Asghar, 10 years ago

In r23357 I have added some support for keeping the lines manhattanized which works pretty fine with Dymola (even with the attached model) & SystemModeler models. But there are still some glitches e.g when you add/remove points using the dialog then things won't remain very smooth. I will fix those minor issues soon so I am keeping the ticket open.

in reply to:  9 comment:11 by Adeel Asghar, 10 years ago

Replying to ceraolo:

Aha.
I didn't see that dialog.
However that dialog asks you to write X and Y coordinates, that is a bit tricky.

Yes, but it also suggests the center of two points automatically which is same what Dymola do on insert point.

Maybe you could add in the context menu an "add point" item, which adds the point where the mouse is (but snapped to grid).

Naturally, if you are able to manage auto-manhattanize with automatic addition of points, this could be even better.

One thing does not exclude the other.

True. I will introduce a new context menu item.

in reply to:  10 comment:12 by massimo ceraolo, 10 years ago

Replying to adeas31:

In r23357 I have added some support for keeping the lines manhattanized which works pretty fine with Dymola (even with the attached model) & SystemModeler models. But there are still some glitches e.g when you add/remove points using the dialog then things won't remain very smooth. I will fix those minor issues soon so I am keeping the ticket open.

I've checked the behaviour and I like it a lot.
I've also seen that if the user adds manually a node, he can then move a corner node to create "Z-shaped" connecting lines that in several cases are useful.
The only suggestion I would make is to make it easier to add a generic point (=node): either by addition of an item in the context menu, as already discussed, and/or making more friendly the "Connection Properties" dialog.

comment:13 by Adeel Asghar, 10 years ago

Resolution: fixed
Status: newclosed

This was one hell of an enhancement. It is fixed now. I completed it in four different revisions r23357, r23371, r23376 and r23379.

In my opinion with my changes addPoint option in context menu is not needed. If you add a point in the middle of two points it will be automatically removed by removeRedundantPoints method. If you add a point which creates an oblique line then it will be automatically removed by manhattanizeShape method. I don't see a real use of addPoint.

If you provide me a case where addPoint is really important then I will add it but perhaps now when you use the new OMEdit you will probably agree with me.

in reply to:  13 comment:14 by massimo ceraolo, 10 years ago

You are perfectly right: only by everyday usage some feature is seen to be really useful or not.
I hoped for the addPoint command to be added when we did not have a well-performing manhattanizing algorithm.

BTW, thank you for the tremendous effort you are putting in fixing tickets about OMEdit during recent weeks. The program is fast enhancing every day, thanks to this excellent work.

Note: See TracTickets for help on using tickets.