Opened 3 years ago

Closed 3 years ago

#6299 closed defect (duplicate)

Multiple extends does not work in GUI

Reported by: Christian Kral <dr.christian.kral@…> Owned by: adeas31
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@…> 3 years ago.
Modelica package to demonstrate problem of parameter changes in extended models

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by Christian Kral <dr.christian.kral@…>

Modelica package to demonstrate problem of parameter changes in extended models

comment:1 Changed 3 years ago by adrpo

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

comment:2 Changed 3 years ago by casella

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 Changed 3 years ago by casella

  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.