Skip to content

Automatic conversion of parameters from type Boolean to type enumeration #3840

@AHaumer

Description

@AHaumer

Assume we have a parameter Boolean b, and we want to add more choices than true|false. Of course we would use an enumeration: parameter MyChoices myChoice

type MyChoices = enumeration(
  choice1 "former false", 
  choice2 "former true", 
  choice3 "new choice");

Of course we couly use a work-around:

parameter Boolean b;
parameter MyChoices myChoice=if b then MyChoices.choice1 else MyChoices.choice2;

The user can specify b and ignore myChoice, or ignore b and specify myChoice.
More elegant would be a conversion script converting parameter Boolean b to parameter MyChoices myChoice.
As far as I know this is'nt possible up to now. Are there any considerations solving this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionDiscussion issue that it not necessarily related to a concrete bug or feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions