Search code examples
parametersmodelicaopenmodelicagraphical-interaction

How to improve GUI for parameter interaction to handle models as type parameters and their internal parameters?


I have for several years developed and used a Modelica library based only on code and compilation to FMU. The interaction with he FMU generated from, JModelica, Impact, OpenModelica works mainly fine. Now I try to make use of "Modelica standard GUI" and raises several new questions.

Key components in my library are parametrised with packages and even models. The formal type packages contain constants. but the formal type models contain further parameters. In the GUI Parameter menu you can select package and models to use, and it all works. But it would be good to be able to at least inspect the type formal parameter model internal parameters, and even better to adjust them, before simulation. This you can do for the FMU. After simulation you can access and modify these parameters, re-simulate. Would be good to have the possibility to do it before simulation as I can for FMU.

Below a screenshot of the Parameter menu in OpenModelica illustrates the problem. Thus, I would like to somehow inspect and modify the parameters of BPL_TEST2.Culture2.

enter image description here

My experience with Modelica GUI is limited to OpenModelica but I suspect the limitation of what kinds of parameters you can set are general. Is here perhaps some setting in the annotations to enable access to parameters inside a type formal parameter (model or block)?


Solution

  • The Modelica language allows modifiers in the ... for redeclare model Culture=BPL_TEST2.Culture(...).

    Dymola (at least since Dymola 2018) allow you to set those parameters by clicking on the usual hierarchical edit button as shown below.

    Dymola dialog for editing of redeclare model

    The test-model was:

    model U
      replaceable model Load=Modelica.Electrical.Analog.Interfaces.TwoPin annotation(choicesAllMatching=true);
    end U;