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)
Change History (29)
comment:1 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 5 years ago
comment:3 by , 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 , 5 years ago
Attachment: | pnlib-omedit.PNG added |
---|
left: old frontend omc api; right: new frontend omc api
comment:4 by , 5 years ago
We'll try to have it fixed in 1.14.0 already, since this is a bad regression.
comment:5 by , 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 , 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 , 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
comment:8 by , 5 years ago
The fixed PNlib now works fine, but in fact the problem with -nfAPI
remains a regression.
comment:9 by , 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:11 by , 5 years ago
Milestone: | 1.15.0 → 1.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:13 by , 4 years ago
Cc: | added |
---|
comment:17 by , 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:20 by , 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 , 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 , 3 years ago
Owner: | changed from | to
---|
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 , 3 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:24 by , 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 , 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 , 3 years ago
@mwetter, the Windows nightly is now available, please test and report onthe mirror ticket at your earliest convenience.
comment:28 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed, see the mirror ticket on GitHub.
Related: https://github.com/OpenModelica/OpenModelica/pull/436