Opened 9 years ago

Closed 7 years ago

Last modified 7 years ago

#3608 closed defect (worksforme)

Omedit shows a component's icon but when checking does not find it

Reported by: massimo ceraolo Owned by: Per Östlund
Priority: normal Milestone: 1.13.0
Component: Frontend Version: v1.11.0
Keywords: Cc: Adrian Pop, Adeel Asghar

Description

Consider the enclosed package "OOInertia.mo"

Select in OMEdit the model OOInertia.DO.ThreeLosses

The component "propdriver1" is correctly displayed (no red-box).
However, when checking this model OMC cannot find it because of a path issue.

Attachments (3)

OOInertia.mo (54.6 KB ) - added by massimo ceraolo 9 years ago.
P.mo (761 bytes ) - added by Adeel Asghar 9 years ago.
TestConnect.mo (12.3 KB ) - added by massimo ceraolo 9 years ago.

Download all attachments as: .zip

Change History (25)

by massimo ceraolo, 9 years ago

Attachment: OOInertia.mo added

comment:1 by Adeel Asghar, 9 years ago

Cc: Adrian Pop added
Component: OMEditFrontend
Owner: changed from Adeel Asghar to Per Östlund
Status: newassigned

comment:2 by Per Östlund, 9 years ago

Resolution: invalid
Status: assignedclosed

The model is wrong. The structure of the package looks like this:

package OOInertia
  package Components
    model PropDriver
      ...
    end PropDriver;
  end Components;

  package DO
    package OOInertia
      ...
    package OOInertia;
  
    package ThreeLosses
      OOInertia.Components.PropDriver propdriver1;
      ...
    end ThreeLosses;
end OOInertia;

When the compiler looks up the class for propdriver1 it will find OOInertia inside DO first, which does not contain a Components package. The Modelica name lookup rules then says that you should stop looking, so the compiler gives an error message. You need to declare the class for propdriver1 as either .OOInertia.Components.PropDriver or Component.PropDriver.

comment:3 by massimo ceraolo, 9 years ago

I suspected this.
What I meant with the ticket was that OM should behave consistently.

Either PropDriver should not be seen, not being visible according to the Modelica's rules, or It could be seen.

You've checked that that model must not be seen because of the Modelica visibility rules. In this case, this should also imply the red box in its place, when that model is open in graphical view.

comment:4 by Per Östlund, 9 years ago

Cc: Adeel Asghar added
Resolution: invalid
Status: closedreopened

Ok, I loaded the file in Dymola, and see what you mean. OMEdit is unfortunately completely broken for me though, so either someone needs to fix #3525 or tell me what's going wrong with OMEdit (I'm guessing it's some API issue).

by Adeel Asghar, 9 years ago

Attachment: P.mo added

comment:5 by Adeel Asghar, 9 years ago

I have created a small example of the same issue. The problem seems to be with getComponents API. The API should only return the qualified paths.

getComponents(P.DO.ThreeLosses)
{{P.Components.PropDriver,propdriver1,"", "public", false, false, false, false, "unspecified", "none", "unspecified",{}}}

comment:6 by Per Östlund, 9 years ago

In 08f0eec getComponents now returns an empty typename for any component for which the type can't be found.

comment:7 by Adeel Asghar, 9 years ago

Resolution: fixed
Status: reopenedclosed

comment:8 by massimo ceraolo, 9 years ago

Resolution: fixed
Status: closedreopened

comment:9 by massimo ceraolo, 9 years ago

The enclosed TestConnect.mo" shows the problem is still existing.

  • Open TestConnect
  • Select IdOnePwm the block "TestConnect.PwmPulser pmwPulser" is shown
  • check: OM complains about TestConnect.PwmPulser not being in scope.

Either PwmPulser is in scope (and the model should check) or it is not (and the red box should be displayed)

by massimo ceraolo, 9 years ago

Attachment: TestConnect.mo added

comment:10 by massimo ceraolo, 9 years ago

Note that this strange situation was created only acting graphically on OMEdit.

So, when this ticket is solved, I will try to single out which actions on OMEdit cause this type of code that, AFAIK, is invalid.
(I mean the IdOnePwm code in the context of the TestConnect package)

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

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:12 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:13 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:14 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:15 by Francesco Casella, 7 years ago

Milestone: 1.12.0Future

The milestone of this ticket has been reassigned to "Future".

If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.

If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".

In both cases, a short informative comment would be welcome.

comment:16 by massimo ceraolo, 7 years ago

Milestone: Future
Resolution: worksforme
Status: reopenedclosed
Version: v1.13.0-dev-nightly

With OM 1.13.0-dev 215 the issue is not there anymore. I'm going to close this ticket.

comment:17 by massimo ceraolo, 7 years ago

Pls check (and in case correct) the milestone. I don't see it in Italian and I don't know how to switch my trac GUI to English.

comment:18 by Adrian Pop, 7 years ago

You just go to Preferences: https://trac.openmodelica.org/OpenModelica/prefs, tab Language.

comment:19 by massimo ceraolo, 7 years ago

Ok I've changed to English.
But still don't know how to correctly close this ticket. The only thing I know is that two years ago the issue was there and with 1.13.0 Dev 215 it is not there anymore.
If I've closed it wrong I would gladly accept any correction.

comment:20 by massimo ceraolo, 7 years ago

Summary: Omedit shows a componet's icon but when checking does not find itOmedit shows a component's icon but when checking does not find it

comment:21 by Francesco Casella, 7 years ago

Milestone: 1.13.0

The "Version" field refers to the version of the sofware you experienced the problem with.

The "Milestone" filed refers to the point in time the problem was solved, or found to be solved. Which in this case is 1.13.0, if I understand it correctly.

comment:22 by massimo ceraolo, 7 years ago

Version: v1.13.0-dev-nightlyv1.11.0
Note: See TracTickets for help on using tickets.