Opened 4 years ago

Closed 4 years ago

#6299 closed defect (duplicate)

Multiple extends does not work in GUI

Reported by: Christian Kral <dr.christian.kral@…> Owned by: Adeel Asghar
Priority: high Milestone: 1.16.2
Component: OMEdit Version: v1.17.0-dev
Keywords: Cc:

Description

Consider the following attached example:

package Extending
  model Model1
    Modelica.Electrical.Analog.Basic.Ground ground annotation(
      Placement(visible = true, transformation(origin = {0, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage annotation(
      Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  equation
    connect(constantVoltage.n, ground.p) annotation(
      Line(points = {{0, -10}, {0, -20}}, color = {0, 0, 255}));
  end Model1;

  model Model2
    extends Extending.Model1(constantVoltage.V = 10);
  equation

  end Model2;

  model Model3
    extends Extending.Model2;
  equation

  end Model3;
  annotation(
    uses(Modelica(version = "3.2.3")));
end Extending;

Apply the following action in the Diagram view:

  1. Make a double click on the voltage model of Model2. Change parameter V. The changed parameter is stored in the model as one can check in the Text view.
  1. Make a double check on the voltage model of Model3. Change parameter V. The changed parameter is NOT stored in the model as one can check in the Text view:
model Model3
  extends Extending.Model2;
equation

end Model3;

Attachments (1)

Extending.mo (788 bytes ) - added by Christian Kral <dr.christian.kral@…> 4 years ago.
Modelica package to demonstrate problem of parameter changes in extended models

Download all attachments as: .zip

Change History (4)

by Christian Kral <dr.christian.kral@…>, 4 years ago

Attachment: Extending.mo added

Modelica package to demonstrate problem of parameter changes in extended models

comment:1 by Adrian Pop, 4 years ago

Yes, it seems setExtendsModifierValue has some bugs in it. I also discovered this while trying to make an example for #6291.

comment:2 by Francesco Casella, 4 years ago

This is a duplicate of #4809.

We should at least figure out if it's a simple bug to fix, as ticket:4809#comment:2 seemed to imply, and then just do it in 1.17.0, or if it is something more involved.

comment:3 by Francesco Casella, 4 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.