Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#4295 closed defect (fixed)

new "checkbox" annotation is ignored if combined with any other choices annotation

Reported by: Dietmar Winkler Owned by: Adeel Asghar
Priority: high Milestone: 1.12.0
Component: OMEdit Version:
Keywords: Cc:

Description

The implementation of enabling the checkbox=true feature in OMEdit does not work when also any other annotation is present as part of choices().

So this works:

model test
parameter Boolean foo=true "Activate foo"
  annotation (Dialog(group="bar"),
   choices(checkbox=true));
end test;

and this does not (but should really).

model test
parameter Boolean foo=true "Activate foo"
  annotation (Dialog(group="bar"),
   choices(checkbox=true,foo=true));
end test;

This is important for example when creating a tool independent library. For example in order to have this feature work in Dymola(which up to at least version 2017FD01 does not support the standard checkbox) and OMEdit:

model test
parameter Boolean foo=true "Activate foo"
  annotation (Dialog(group="bar"),
   choices(checkbox=true,__Dymola_checkBox=true));
end test;

Change History (3)

comment:1 by Dietmar Winkler, 8 years ago

As an addition to make live for users easier and to improve support for older Dymola style libraries it would be nice if OMEdit would also support the following Dymola annoation with some warning messages:

  • only __Dymola_checkBox=true present: Accept but display "Warning: Non-standard annotation __Dymola_checkBox used in xxx, use standard-compliant annotation checkbox instead."
  • only checkBox=true present: Accept but display "Warning: Non-standard annotation checkBox used in xxx, use standard-compliant annotation checkbox instead."
  • both __Dymola_checkBox=true and checkbox=true: Accept but no need to display anything since the presence of boths seems to indicate this was done on purpose for backward compatibility.
Last edited 8 years ago by Dietmar Winkler (previous) (diff)

comment:2 by Dietmar Winkler, 8 years ago

Turns out (DS support came back to me) that checkbox is a typo in the specifications.
https://trac.modelica.org/Modelica/ticket/1770

This means you only need to fix the spelling and can forget about the warnings. Well maybe is __Dymola_checkBox is used instead of checkBox.

comment:3 by Adeel Asghar, 8 years ago

Resolution: fixed
Status: newclosed

Fixed in 2d2b491/OMCompiler & a2c3963/OMEdit.
__Dymola_checkBox is also considered now.

Note: See TracTickets for help on using tickets.