MarekMatejak / Physiolibrary

Modelica library for Physiology
BSD 3-Clause "New" or "Revised" License
33 stars 19 forks source link

Are parameter dependent annotations for code generation legal? #9

Open tbeu opened 9 years ago

tbeu commented 9 years ago

I guess it is not legal to set parameter dependent annotation values like Physiolibrary.Chemical.Interfaces.ConditionalVolume.useNormalizedVolume.

     parameter Boolean useNormalizedVolume = true
        "Normalized volume of solution is 1 liter"
      annotation(Evaluate=true, HideResult=true, choices(__Dymola_checkBox=true),Dialog(group="External inputs/outputs"));

      Types.Volume volume "Solution volume" annotation(HideResult=useNormalizedVolume);
mesamis commented 9 years ago

May be it is not the same, but in MSL 3.2.1 are also some parameter dependent annotations such as in Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort:

parameter Boolean useHeatPort = false; parameter Modelica.SIunits.Temperature T=293.15 annotation(Dialog(enable=not useHeatPort));

I do not see the functional problem, because the parameters must be constant during simulation, so they can theoretically set also the annotations for setting of Modelica environment before, during and after simulation.

However in this case, the visibility of volume in results can be pernament, it is not the key feature for user. ;)

tbeu commented 9 years ago

OK, it may be a tool issue. Will check it.

tbeu commented 9 years ago

We could not conclude if this is legal or not. At least it is currently not supported in SimulationX. See https://trac.modelica.org/Modelica/ticket/1672 for my question to the Modelica community.