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

Hierarchical editing of models #2891

Open
OpenModelica-TracImporter opened this issue Jun 27, 2020 · 3 comments
Open

Hierarchical editing of models #2891

OpenModelica-TracImporter opened this issue Jun 27, 2020 · 3 comments
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

@OpenModelica-TracImporter
Copy link
Member

No description provided.

@casella
Copy link
Contributor

casella commented Jan 15, 2022

Original trac ticket: https://trac.openmodelica.org/OpenModelica/ticket/2891

@casella casella added this to the 1.21.0 milestone Oct 22, 2022
@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 Oct 22, 2022
@casella casella mentioned this issue Dec 13, 2022
@casella casella modified the milestones: 1.21.0, 1.22.0 Apr 18, 2023
@casella
Copy link
Contributor

casella commented May 29, 2023

Discussion with @adrpo, @adeas31 and @perost. All the required information is already provided by the new instance-based interface, which returns the information for the entire instance all the way down to the leaves.

This is actually already used to support redeclares: when editing the parameters of a redeclare, among them one can find another replaceable class, and that works recursively.

So, given the new inst-based infrastructure, most of the work is on the OMEdit GUI. Basically, the current editing is always referred to the top level anonymous node of the instance tree, the whole graphical rendering needs to be made parametric with respect of that reference node, that could be any component of the model, not just the top-level one. This could give access to the components in a graphical way (showing a diagram), where one can double-click on a component to change its parameter. Dymola calls this option "Show component", we could also name it "Edit component parameters" since it's not only showing.

A further way to allow hierarchical editing is to show the instance tree in a separate window, that can be explored. Double-clicking on a node shows the corresponding diagram, right-clicking on it should allow to select a menu item to change the parameters of that node.

@casella
Copy link
Contributor

casella commented May 29, 2023

BTW, we should also allow to edit the top-level parameters of a model. Currently, if you open this model in OMEdit

model Test
  parameter Real p = 1;
  Modelica.Blocks.Sources.Constant const(k = 3) (
    Placement(visible = true, transformation(origin = {-24, -14}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
end Test;

you can change the value of the k parameter in the component const using the GUI, by double-clicking on the Constant source icon. However, there is no way to inspect and change the parameters of the model itself, p in this case. The context menu that pops up when right-clicking on the model diagram or icon view (or on the node in the future instance tree view) should also include a "Parameters" item that opens a dialog to edit the top-level parameters using the GUI.

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
Status: No status
Development

No branches or pull requests

4 participants