Opened 4 years ago

Last modified 4 years ago

#6279 reopened defect

FMU shows parameters that should be hidden — at Version 3

Reported by: massimo ceraolo Owned by: Lennart Ochel
Priority: high Milestone:
Component: FMI Version: v1.17.0-dev
Keywords: Cc: Karim Adbdelhak, Andreas Heuermann, arunkumar palanisamy

Description (last modified by massimo ceraolo)

Consider model TestFMU below (annotations dropped)

model TestFMU 
  parameter Real K = 1;
  Modelica.Blocks.Interfaces.RealInput u;
  Modelica.Blocks.Interfaces.RealOutput;
  Modelica.Blocks.Math.Gain gain1(k = K / 2);
Modelica.Blocks.Math.Gain gain(k = 1);
equation
  connect(gain1.u, u);
  connect(gain1.y, gain.u);
  connect(gain.y, y);
end TestFMU;

I exported it as FMU-ME 2.0 and imported into Dymola the parameter window is as in the enclosed file screen.png.
I think the parameter gain1_k shouldn't be visible in the dialog box, since it is internally computed through a binding formula.

Change History (6)

by massimo ceraolo, 4 years ago

Attachment: screen.png added

by massimo ceraolo, 4 years ago

Attachment: TestFMU.mo added

by massimo ceraolo, 4 years ago

Attachment: settings.png added

comment:1 by Francesco Casella, 4 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

@ceraolo, the binding is not final, so it can still be changed at runtime.

Try with

model TestFMU 
  parameter Real K = 1;
  Modelica.Blocks.Interfaces.RealInput u;
  Modelica.Blocks.Interfaces.RealOutput y;
  Modelica.Blocks.Math.Gain gain1(final k = K / 2);
  Modelica.Blocks.Math.Gain gain(final k = 1);
equation
  connect(gain1.u, u);
  connect(gain1.y, gain.u);
  connect(gain.y, y);
end TestFMU;
Last edited 4 years ago by Francesco Casella (previous) (diff)

comment:2 by massimo ceraolo, 4 years ago

Resolution: invalid
Status: closedreopened

Two objections to comment 1
1) If @casella is right and the model as written in this ticket's description implies that the parameter gain1.k must be visible from the outside, then we've got a problem with OM: it does not show it! Otherwise it should not appear even when a fmu is created from that model
2) however, even if I add final on binding in gain1:

 Modelica.Blocks.Math.Gain gain1(final k = K / 2);

the fmu still shows this parameter in its dialog box (when imported in Dymola) and this is even more unacceptable.

comment:3 by massimo ceraolo, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.