Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifiers applied to components of an extended model are not shown in the parameter dialog #10864

Closed
casella opened this issue Jun 20, 2023 · 5 comments · Fixed by #10867 or #11232
Closed
Assignees
Labels
COMP/GUI/InstBased Interface Issues with new instantiation-based OMEdit feature COMP/GUI/OMEdit Issue and pull request related to OMEdit
Milestone

Comments

@casella
Copy link
Contributor

casella commented Jun 20, 2023

Steps to Reproduce

  • open the attached InitBlocks.zip package

  • open InitBlocks.Examples.Tests.WaterHeater.TestWaterHeaterStepForward in OMEdit

  • the model contains the following code:

  extends BaseTests.BaseTestWaterHeater(
    initBlockOptions(mode = InitBlocks.Blocks.Options.BlockMode.SimulationOpenLoopOnDesign, normalization = true),
    outputBlock(y_norm = 380));

However, if I double-click on the salmon-hued outputBlock, y_norm is displayed with its default inherited value y_des. If I now type in another value, e.g. 400, this is correctly inserted in the modifier, but the parameter editing window still displays y_des.

I guess this is a problem with OMEdit, not with the API, but I'm not sure. @adeas31, @perost, could you please check?

Keeping @matteodepascali in the loop

Thanks!

@casella casella added COMP/GUI/OMEdit Issue and pull request related to OMEdit COMP/GUI/InstBased Interface Issues with new instantiation-based OMEdit feature labels Jun 20, 2023
@casella casella added this to the 1.22.0 milestone Jun 20, 2023
adeas31 added a commit to adeas31/OpenModelica that referenced this issue Jun 20, 2023
Fixes OpenModelica#10864
Check the complete list instead of just looking the first value.
Stop when value is found.
adeas31 added a commit that referenced this issue Jun 20, 2023
Fixes #10864
Check the complete list instead of just looking the first value.
Stop when value is found.
@casella
Copy link
Contributor Author

casella commented Jun 25, 2023

Thanks @adeas31!

@matteodepascali, please check that you can now use your library with the latest nightly build. If there are any issues, please report them here.

@matteodepascali
Copy link

Thank you, @adeas31!
I tried this morning with the last nightly and #10865 seems has been solved in every case. This issue instead is still there when multiple model extensions are present. In fact, if I extend one more time the model of this issue, the same behavior appears: when I modify a parameter, it is not updated in the parameter editing window.
Here is the new InitBlocks.zip with the new model InitBlocks.Examples.Tests.WaterHeater.TestWaterHeaterStepBackward.
Thanks for the help!

@casella casella reopened this Jun 27, 2023
@casella
Copy link
Contributor Author

casella commented Sep 11, 2023

Here is an updated MWE:

package TestInheritedParameter
    model M
    parameter Real p = 1;
    parameter Real q = 10;
  equation

  end M;

  model S1
  M m(p = 2, q = 20)  
annotation(
  Placement(visible = true, 
  transformation(origin = {-10, -2}, extent = {{-10, -10}, {10, 10}},
  rotation = 0)));
  equation

  end S1;

  model S2
    extends TestInheritedParameter.S1(m(p = 3, q = 30));
  equation

  end S2;

  model S3
    extends TestInheritedParameter.S2(m(p = 3));
  equation

  end S3;
end TestInheritedParameter;

When double-clicking on m in S3:

  • the modified parameter values are not shown
  • the shown default refer to the base class S1, not the the parent class S2

@perost, I guess this information should arrive to OMEdit straight from the instantiation API, can you please check that?

Thanks!

@casella
Copy link
Contributor Author

casella commented Sep 21, 2023

Thanks @adeas31! @matteodepascali please check with tomorrow's nightly build.

@matteodepascali
Copy link

Thank you @adeas31, I confirm the new nightly is fine and the bug is solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP/GUI/InstBased Interface Issues with new instantiation-based OMEdit feature COMP/GUI/OMEdit Issue and pull request related to OMEdit
Projects
None yet
4 participants