Opened 4 years ago

Closed 4 years ago

#6420 closed enhancement (duplicate)

Detection of wrong connections

Reported by: Christian Kral Owned by: Adeel Asghar
Priority: high Milestone: NeedsInput
Component: OMEdit Version: 1.16.2
Keywords: Cc:

Description

This is a feature request, resulting as a conclusion of the non-working models of my students that I had to investigate over the last years.

Whenever the connections of a graphical model in Modelica looks OK but the connections are not OK, it is very hard to identify the underlying problem. Typical issues in electrical circuits are:

  • Shortening the two pins the current path of (a) a current or (b) a power sensor (see attachment Example1: wrong connect(currentSensor.p, currentSensor.n))
  • Instead of connecting the two connectors of a component, the connections are made to the same one connector of the component (see attachment Example1: connect(ground.p, resistor.p) instead of connect(ground.p, resistor.n))

Such issues can usually not be identified in the diagram layer, as the wrong connections interfere with the icon. Depending on the complexity of the model, is more less time consuming to identify such issues in OpenModelica.

In order to trace such issue a button like "Check connections" could be introduced. This could for example trigger some simple checks:

  • List the not connected connectors (possibly output connectors could be excluded from the list)
  • Highlight the connection with bold line width (and shade and flashing or whatever) in the foreground so that the icons are in the background and each connection can be checked thoroughly

Attachments (2)

Example1.mo (1.4 KB ) - added by Christian Kral 4 years ago.
Example with two wrong connections
Example1.png (5.3 KB ) - added by Christian Kral 4 years ago.
Diagram view of an example with two wrong connections

Download all attachments as: .zip

Change History (6)

by Christian Kral, 4 years ago

Attachment: Example1.mo added

Example with two wrong connections

by Christian Kral, 4 years ago

Attachment: Example1.png added

Diagram view of an example with two wrong connections

comment:1 by massimo ceraolo, 4 years ago

Maybe it is even more important to see all the time whether connections are good or not.
In this direction, I think solving #4645 is of the utmost importance.

in reply to:  1 comment:2 by Francesco Casella, 4 years ago

Replying to ceraolo:

Maybe it is even more important to see all the time whether connections are good or not.
In this direction, I think solving #4645 is of the utmost importance.

I agree with @ceraolo, and in fact I wanted to bring up that old ticket. @chrstiankral, would that be ok for you?

However, I think having a list of unconnected connectors would be a nice thing to have, for diagnostic purposes. Of course in some cases they may just be fine, e.g. in thermofluid models, where they correspond to insulated thermal ports or plugged fluid ports. In the electrical case, it is normally an error if you leave some pins unconnected.

I just opened #6423 on this topic.

comment:3 by Christian Kral <dr.christian.kral@…>, 4 years ago

I agree with @ceraolo, and in fact I wanted to bring up that old ticket. @chrstiankral, would that be ok for you?

Yes this is fine with me.

comment:4 by Francesco Casella, 4 years ago

Resolution: duplicate
Status: newclosed

OK, I raised the priority of #4645. For the unconnected connectors, see #6423. We can close this ticket.

Note: See TracTickets for help on using tickets.