Opened 6 years ago

Closed 8 weeks ago

#4839 closed defect (fixed)

Badly wrong visualization in OMEdit in a simple case

Reported by: ceraolo Owned by: adeas31
Priority: blocker Milestone: 2.0.0
Component: OMEdit Version:
Keywords: Cc: adrpo, sjolund.se

Description

Using only graphical operations on OMEdit I got to the enclosed BugConnection.mo.
Strangely, the visual representation does not correspond to the code.
Indeed, in the code resistor1.plug_n is connected to sineVoltage.plug_p, which does not correspond to the diagram (BugConnection.svg).

I think this correspondence should be restored ASAP. Once this is done, maybe I can report better how and when the wrong code is generated.

Tested with OMEdit v1.13.0-dev-95-g4eb7a19 (64-bit-Win)
Connected to v1.13.0-dev-380-g8b177b9 (64-bit-Win)

Attachments (3)

BugConnection.mo (2.3 KB) - added by ceraolo 6 years ago.
BugConnection.svg (85.2 KB) - added by ceraolo 6 years ago.
BugConnection2.png (7.5 KB) - added by ceraolo 4 years ago.

Download all attachments as: .zip

Change History (17)

Changed 6 years ago by ceraolo

Changed 6 years ago by ceraolo

comment:1 Changed 6 years ago by ceraolo

  • Milestone changed from Future to 1.13.0
  • Priority changed from high to blocker

comment:2 Changed 6 years ago by ceraolo

  • Summary changed from Badly visualization in OMEdit in a simple case to Badly wrong visualization in OMEdit in a simple case

comment:3 Changed 6 years ago by casella

  • Cc adrpo sjolund.se added
  • Component changed from *unknown* to OMEdit
  • Owner changed from somebody to adeas31

The problem in this case is that the connection between resistor1.plug_n and sineVoltage.plug_p is partially covered by the other two connections of the resistor and by the resistor itself, so it's not visible.

If I am not mistaken, we have already discussed a related issue, though unfortunately I can't trace the ticket or the e-mail thread.

I remember one proposed solution was to first draw the components and then the connections, which would ensure in this case that you see the connect line passing on top of the resistor and connecting to the negative plug. I remember there was an issue about how to correctly render the graphical appearence of the connection line close to the connector icon, and that I proposed a solution for that, i.e. ending the white strip around the connection line a bit earlier than the connection point, to avoid spoiling it, as well as what should be the ideal thickness of the white strip surrounding the connection line.

@adrpo, @sjolund.se, do you remember where this was?

Anyway, to summarize I think a good solution is to:

  • first draw the components, then the connections
  • draw slightly shorter white lines behind connection lines to avoid spoiling the connector icons

I guess as soon as Adeel is back from his vacation, he can give a look at that.

comment:4 Changed 6 years ago by ceraolo

We discussed this regarding diodes (#4645).
Since the diode symbol has a line connecting the two pins, an overlaid external line would be not visible. In that case I thought that the line was not visible just because superimposed to diode symbol.

Here the situation is much worse: no-one can suspect that a line exists behind the resistor symbol!

comment:5 Changed 6 years ago by ceraolo

Any news about this ticket (and #4645)? Any plans to work on it?

comment:6 Changed 6 years ago by casella

  • Milestone changed from 1.13.0 to 2.0.0

I discussed this with @adeas31. Fixing this issue requires to carry out some work, which is also needed to fix other pending issues in a proper way.

Adeel is currently busy on the OMSimulator project, so he can't do this in time for 1.13.0. We agreed to have it done in 2.0.0

comment:7 Changed 6 years ago by ceraolo

Ok. Thanks for the update.

comment:8 Changed 6 years ago by ceraolo

  • Milestone changed from 2.0.0 to 1.14.0

Now that we have 1.14.0 planned, I propose to switch this to this version.

comment:9 Changed 5 years ago by ceraolo

I have an even worse example of this bad behaviour.
Today a student of mine created the model "asma0BAD" enclosed.
the model works well, except that the torqueSensor output is always zero.
If we move around all the submodels, all connections seem to be rightly in place.
Only after studying the code, I could envisage that the student had connected the machine's flange to the wrong flange of torque sensor.

The student "went crazy" in trying to understand what was bad.
I think this example gives new evidence on the fact that this issue should be corrected soon.
Looking at this model within Dymola shows immediately what the issue is.

comment:10 Changed 5 years ago by casella

@adeas31, can you take care of this?

comment:11 Changed 5 years ago by adeas31

This is basically the same as #4645. I suggest we should take it in 2.0
Doing this change so close to 1.14 is not a good idea.

comment:12 Changed 5 years ago by casella

  • Milestone changed from 1.14.0 to 2.0.0

comment:13 Changed 4 years ago by ceraolo

The behaviour is totally changed with NF and OpenModelica v1.14.0-dev.beta1 (64-bit): see BugConnection2.png, probably because of #5662

Changed 4 years ago by ceraolo

comment:14 Changed 8 weeks ago by ceraolo

  • Resolution set to fixed
  • Status changed from new to closed

Fixed (see #4645)

Note: See TracTickets for help on using tickets.