Opened 5 years ago

Closed 3 years ago

#5631 closed defect (fixed)

Fix DynamicSelect for new API

Reported by: Adeel Asghar Owned by: Per Östlund
Priority: blocker Milestone: 1.19.0
Component: Interactive Environment Version:
Keywords: Cc: Michael Wetter

Description

The -nfAPI flag simply ignores the DynamicSelect annotation. To get DynamicSelect -nfAPIDynamicSelect should be used but it just returns the DynamicSelect as expression and OMEdit needs parser to evaluate them.

For now since -nfAPI is default in OMEdit so it should return the same for DynamicSelect as the old API was doing.

Attachments (1)

pnlib-omedit.PNG (95.4 KB ) - added by Lennart Ochel 5 years ago.
left: old frontend omc api; right: new frontend omc api

Download all attachments as: .zip

Change History (29)

comment:1 by Adeel Asghar, 5 years ago

Owner: changed from somebody to Adrian Pop
Status: newassigned

comment:3 by Lennart Ochel, 5 years ago

I think all examples from the PNlib are visualized wrong due to this dynamicSelect annotation. Basically all components are just shown as a box, ignoring the graphical annotations.

by Lennart Ochel, 5 years ago

Attachment: pnlib-omedit.PNG added

left: old frontend omc api; right: new frontend omc api

comment:4 by Francesco Casella, 5 years ago

We'll try to have it fixed in 1.14.0 already, since this is a bad regression.

comment:5 by Adrian Pop, 5 years ago

The problem with this is (run with -d=nfApi,nfAPINoise):

// [PNlib/Components/PD.mo:133:43-149:32:writable] Error: Function realString not found in scope PD.
The annotation in PD.mo reads:
textString=DynamicSelect("%startTokens", if animateMarking then realString(t, 1, 0) else " ")),

So when running getIconAnnotation(PNlib.Components.PD); we get a bad reply from OMC.

I guess if we fail to type check the dynamic part of DynamicSelect(static, dynamic) we should just return the static part. I'll do that.

comment:6 by Lennart Ochel, 5 years ago

You are right! The annotations are wrong. I managed to identify the wrong expressions using -d=nfAPINoise. Thanks for your help.

comment:7 by Francesco Casella, 5 years ago

Does this mean that an updated PNLib will work with omc as it is? In that case, this is no longer a blocker and we can move it to 1.16.0

Last edited 5 years ago by Francesco Casella (previous) (diff)

comment:8 by Francesco Casella, 5 years ago

The fixed PNlib now works fine, but in fact the problem with -nfAPI remains a regression.

comment:9 by Francesco Casella, 5 years ago

@adrpo, as I understand this is still to be done:

For now since -nfAPI is default in OMEdit so it should return the same for DynamicSelect as the old API was doing.

comment:10 by Francesco Casella, 5 years ago

Milestone: 1.14.01.15.0

Rescheduled to 1.15.0 due to lack of time

comment:11 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:12 by Francesco Casella, 4 years ago

@adrpo, see ticket:5924#comment:3

Can we fix this for 1.16.0?

comment:13 by Francesco Casella, 4 years ago

Cc: Michael Wetter added

comment:14 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:15 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Rescheduled to 1.18.0

comment:16 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

comment:17 by Per Östlund, 3 years ago

How is DynamicSelect even supposed to work? If you have e.g.:

DynamicSelect("%y", String(y, significantDigits = 3))

in an annotation, the nfAPI will just return "%y" when calling getIconAnnotation. But the old API instead returns {"%y", y, 3}, which just seems nonsensical to me (what happened with String?). What is OMEdit actually expecting to receive?

comment:18 by Francesco Casella, 3 years ago

Milestone: 1.19.0

1.18.0 blocker tickets moved to 1.19.0

comment:19 by Francesco Casella, 3 years ago

@adeas31, could you please comment on @perost's request?

comment:20 by Adeel Asghar, 3 years ago

Yes I agree what is implemented is not good. I think we shouldn't consider what is already implemented and think about it from start.

I am actually not sure what is a good output format. You can have dynamic select for everything e.g.,

fillColor = DynamicSelect ({0 , 0 , 255} , if overflow then {255 , 0 , 0} else {0 , 0 , 255})

I guess we need to have different output for different graphical elements.

comment:21 by Per Östlund, 3 years ago

Now that I check how it's actually implemented in the old frontend it actually only handles the case in my example. So I guess I can start by implementing the same thing in the new frontend, then it will at least work as before.

comment:22 by Francesco Casella, 3 years ago

Owner: changed from Adrian Pop to Per Östlund

Fixed in PR #7891.

@mwetter, could some of your group check that you now get the expected behaviour with tomorrow's nightly build?

You can report any feedback on the mirror ticket on github.

Thanks!

comment:23 by Francesco Casella, 3 years ago

Resolution: fixed
Status: assignedclosed

comment:24 by Adrian Pop, 3 years ago

Currently the windows builds are broken due to some CPP runtime build issues. Will try to fix this asap.

comment:25 by Francesco Casella, 3 years ago

Thanks Adrian for the tip. I usually check that the Hudson job is alive before recommending new nightlies, this time I skipped that, and of course broken it was.

comment:26 by Francesco Casella, 3 years ago

@mwetter, the Windows nightly is now available, please test and report onthe mirror ticket at your earliest convenience.

comment:27 by Francesco Casella, 3 years ago

Resolution: fixed
Status: closedreopened

See comment on GitHub.

comment:28 by Francesco Casella, 3 years ago

Resolution: fixed
Status: reopenedclosed

Fixed, see the mirror ticket on GitHub.

Note: See TracTickets for help on using tickets.