Opened 5 years ago

Last modified 3 years ago

#5639 new defect

Issues with WasteWater library

Reported by: Francesco Casella Owned by: Per Östlund
Priority: blocker Milestone: 1.19.0
Component: *unknown* Version:
Keywords: Cc: Adrian Pop, Adeel Asghar, Dietmar Winkler

Description

@dietmarw reports some issues with the WasteWater library that we shuould address, because they may also affect other libraries and users quite badly.

The first issue is reported in ticket:5461#comment:16

I think I found another related quirk. I described in the small screen cast. The library version I used to demonstrate is this: https://github.com/dietmarw/WasteWater/releases/tag/v3.0.0-alpha.2

Here the screen cast: https://www.dropbox.com/s/7i1pu67j2iyqw46/2019-09-20_OMCNameLookup.mkv?dl=0

On one hand, probably due to component lookup failure by the API, one component icon does not show up. This is a new issue, since some time ago the diagram was displayed correctly. Could be either a NF issue or a nfAPI issue. I don't see anything strange with that lookup, @perost could you comment on that?

Furthermore, if a new component is added manually to the text layer, all the icons get broken, as demonstrated in the video. This is quite scary and shouldn't really happen.

Additionally, it seems that there are some issues with inner/outer lookup: if I check the model, I get the following error:

[1] 19:22:19 Translation Error
[WasteWater.Components: 231:3-231:95]:
Variable WWS.BioTreat not found in scope Deni.

Now, WWS is the system object, that shows up neatly in the bottom left corner of the diagram, and BioTreat is a parameter of that model, so this is also quite strange.

@perost, @adrpo, @adeas31, can you please download the library, check the video, and comment on what is going on in this case?

I guess since we have a regression we should try to fix this for 1.14.0. If this turns out to be too time-consuming, we'll reschedule to the next release.

Thanks!

Attachments (2)

getComponentsNFAPI.mos (419 bytes ) - added by Adeel Asghar 5 years ago.
getComponentsAPI.mos (159 bytes ) - added by Adeel Asghar 5 years ago.

Download all attachments as: .zip

Change History (14)

by Adeel Asghar, 5 years ago

Attachment: getComponentsNFAPI.mos added

by Adeel Asghar, 5 years ago

Attachment: getComponentsAPI.mos added

comment:1 by Adeel Asghar, 5 years ago

The getComponents API behaves weird when nfAPI flag is set. I have created two scripts one uses nfAPI called getComponentsNFAPI.mos and the other don't called getComponentsAPI.mos. The package.mo used in the scripts is the waste water library downloaded from the link provided in the description.

Note in getComponentsNFAPI.mos calling getComponents first time gives wrong results but the later calls gives correct results. That is totally strange.

in reply to:  description comment:2 by Per Östlund, 5 years ago

Replying to casella:

Additionally, it seems that there are some issues with inner/outer lookup: if I check the model, I get the following error:

[1] 19:22:19 Translation Error
[WasteWater.Components: 231:3-231:95]:
Variable WWS.BioTreat not found in scope Deni.

Now, WWS is the system object, that shows up neatly in the bottom left corner of the diagram, and BioTreat is a parameter of that model, so this is also quite strange.

The issue seems to be that the NF doesn't handle inner/outer records correctly.

comment:3 by Francesco Casella, 5 years ago

@perost, do you think we can fix this in 1.14.0, or at least in a subsequent 1.14.x maintenance release?

comment:4 by Dietmar Winkler, 5 years ago

No proper support for inner and outer should be enough to be a blocker for any stable release version. As this is quite a common used feature in models.

in reply to:  3 comment:5 by Per Östlund, 5 years ago

Replying to casella:

@perost, do you think we can fix this in 1.14.0, or at least in a subsequent 1.14.x maintenance release?

If you mean the inner/outer record issue it's probably not a trivial fix, so I can't really say.

Replying to dietmarw:

No proper support for inner and outer should be enough to be a blocker for any stable release version. As this is quite a common used feature in models.

It's not a regression in terms of the new frontend though, this specific case of inner/outer has never worked as far as I know. It does seem to work with the old frontend, but the old frontend has lots of other inner/outer issues on its own.

My understanding is that it's been decided to switch to the new frontend by default in 1.14.0 and handle regressions by falling back to the old frontend. Obviously that doesn't seem to work in all cases yet though.

comment:6 by Francesco Casella, 5 years ago

Milestone: 1.14.01.15.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2.

This issue, previously marked as blocker for 1.14.0, is rescheduled to 1.15.0

comment:7 by Adrian Pop, 5 years ago

This is a really strange bug. I tried to make a smaller model with this issue but I could not, it worked fine anything I tried. If you do the change below, it starts working fine so maybe this gives Per some idea where the problem is.

  • WasteWater/Components.mo

    diff --git a/WasteWater/Components.mo b/WasteWater/Components.mo
    index db0ebcb..4e51062 100644
    a b model Deni "Denitrification tank"  
    226226//    replaceable model ASMx = Interfaces.ASM2d
    227227//      constrainedby Interfaces.ASMbase
    228228//      annotation (choicesAllMatching=true);
    229229  protected
    230   parameter Types.BioTreatment BioTreat=WWS.BioTreat "Type of biological treatment set in WWS";
     230  Components.WWSystem w = WWS;
     231  parameter Types.BioTreatment BioTreat=w.BioTreat "Type of biological treatment set in WWS";

comment:8 by Francesco Casella, 4 years ago

Milestone: 1.15.01.16.0

Release 1.15.0 was scrapped, because replaceable support eventually turned out to be more easily implemented in 1.16.0. Hence, all 1.15.0 tickets are rescheduled to 1.16.0

comment:9 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:10 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Rescheduled to 1.18.0

comment:11 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

comment:12 by Francesco Casella, 3 years ago

Milestone: 1.19.0

1.18.0 blocker tickets moved to 1.19.0

Note: See TracTickets for help on using tickets.