Opened 8 years ago

Closed 8 months ago

#4288 closed defect (fixed)

A submodel is shown in a model diagram while its pathname is wrong and the model doesn't simulate

Reported by: massimo ceraolo Owned by: Adrian Pop
Priority: normal Milestone:
Component: Interactive Environment Version:
Keywords: Cc: Adeel Asghar, Adrian Pop, Per Östlund

Description (last modified by massimo ceraolo)

Consider the model InvPwmPQ in the attached package invPwmPkg.
I'm not sure whether its sub-model PwmPulser has a valid pathname.
But whatever the answer OMEdit seems inconsistent:
1) its icon is visible in the InvPwmPQ diagram
2) when the model is checked the following error is issued:

Error
[invPWMPkg: 12:5-12:156]: Class invPWMPkg.PwmPulser not found in scope invPWMPkg.InvPwmPQ.

I think that if PwmPulser is not in scope, its icon should not be visible.

* A later addition: comment 3 explains that PwmPulser is not in scope, and therefore it should not be visible in InvPwmPQ.

Attachments (1)

invPWMPkg.mo (10.6 KB ) - added by massimo ceraolo 8 years ago.

Download all attachments as: .zip

Change History (26)

by massimo ceraolo, 8 years ago

Attachment: invPWMPkg.mo added

comment:1 by Adeel Asghar, 8 years ago

Cc: Per Östlund Adrian Pop added

comment:2 by Adeel Asghar, 8 years ago

Cc: Adeel Asghar added; Per Östlund removed
Owner: changed from Adeel Asghar to Per Östlund
Status: newassigned

comment:3 by Per Östlund, 8 years ago

Cc: Per Östlund added; Adeel Asghar removed

The model is invalid, because looking up invPWMPkg requires going to the scope outside invPWMPkg. But since invPWMPkg is encapsulated that's not allowed. So to fix the model, just remove the invPWMPkg prefix from the pwmPulser component.

The icon lookup doesn't seem to follow those rules though, so that should be fixed.

comment:4 by Per Östlund, 8 years ago

Cc: Adeel Asghar added; Per Östlund removed

comment:5 by massimo ceraolo, 8 years ago

Ah. I did see that removing invPWMPkg prefix made the model solvable, but failed to track down this to the encapsulated keyword.
Naturally, the core of this ticket was consistency in OM behaviour (so perost's last sentence).

I must add that I'me pretty sure that somehow invPWMPkg prefix was created by OMEdit itself. If confirmed, that is another issue. I will try to produce an example to reproduce this.

Last edited 5 years ago by massimo ceraolo (previous) (diff)

comment:6 by Adeel Asghar, 7 years ago

Milestone: 1.12.01.13.0

comment:7 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:8 by Francesco Casella, 5 years ago

Milestone: 1.14.01.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:9 by massimo ceraolo, 5 years ago

Description: modified (diff)
Summary: A path issueA submodel is shown in a model diagram while its pathname is wrong and the model doesn't simulate

comment:10 by Francesco Casella, 4 years ago

@perost, I retried this with the latest nightly, and the model is compiled without a hiccup.

Does this mean that neither the NF, nor the API, handle lookup in encapsulated packages correctly?

in reply to:  10 comment:11 by Per Östlund, 4 years ago

Replying to casella:

@perost, I retried this with the latest nightly, and the model is compiled without a hiccup.

Does this mean that neither the NF, nor the API, handle lookup in encapsulated packages correctly?

Seems we've forgotten to implement support for encapsulated in the NF entirely. I'll fix it tomorrow.

comment:12 by Per Östlund, 4 years ago

Support for encapsulated in the NF has now been implemented in d253fa3.

comment:13 by massimo ceraolo, 4 years ago

The wrong behaviour mentioned in the ticket description is still there.

comment:14 by Per Östlund, 4 years ago

Owner: changed from Per Östlund to Adeel Asghar

comment:15 by Francesco Casella, 4 years ago

Cc: Per Östlund added

@perost, @adrpo, is this because the API uses the old frontend?

in reply to:  15 comment:16 by Per Östlund, 4 years ago

Replying to casella:

@perost, @adrpo, is this because the API uses the old frontend?

No, the old frontend gives the same error. This is an API issue.

comment:17 by Francesco Casella, 4 years ago

Component: OMEditInteractive Environment
Owner: changed from Adeel Asghar to Adrian Pop

Then should @adrpo take care of this?

comment:18 by Adrian Pop, 4 years ago

The OMC/OMEdit graphical API doesn't care if a model can check/simulate or not. Is only interested in fetching model annotations and displaying them. If we are to enforce all the rules, most of the incomplete models would not display due to missing constants, etc.
In this particular case the OMC/OMEdit graphical API doesn't use the lookup of the old or the new front-end, it just goes into the AST and gets the class using the given path.

Aslo, with regards to comment comment5, this is ticket #4372.

comment:19 by massimo ceraolo, 4 years ago

I understand that you feel like thinking general, and in general we cannot ensure that a displayed model checks.

But I think we must consider the user experience as well. If the user sees a submodel and when checking OM cannon see it, he is really disappointed.

This, for me, is totally different from when a model does not check because of a hidden model flaw.

comment:20 by Francesco Casella, 4 years ago

I do not fully agree with comment:18. In fact, we are not talking about whether or not a model can simulate, but about a more fundamental issue, i.e. a type error, which is not caught by the OMEdit API.

If I open the test case with Dymola, the pwmPulser object is crossed out, and if I hover on it I get the message "Did not find type invPWMPkg.PwmPulser for component pwmPulser", which is exactly what we only get in OMEdit when we check the model.

That said, we have at least one hundred issues of much higher priority regarding the user experience, so I'd keep this ticket with priority normal.

comment:21 by Adrian Pop, 4 years ago

Ok. I get the message. We can enforce some of these checks while searching for the class and maybe even displaying an error message.

Last edited 4 years ago by Adrian Pop (previous) (diff)

comment:22 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:23 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:24 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

comment:25 by massimo ceraolo, 8 months ago

Resolution: fixed
Status: assignedclosed

Today this iossue is not present anymore.

Note: See TracTickets for help on using tickets.