Open ceraolo opened 1 year ago
After creating the ticket I checked with Dymola and found that what I expected is already there in Dymola, even when the FMU is created by OpenModelica. In enclose two screenshots.
Dymola does more than what I proposed: it also parses the table matrix in a structured way.
@ceraolo when you import an FMU in OpenModelica, a custom Modelica wrapper is generated. You can actually inspect it and modify it. I think the best way to proceed here is that you actually modify it once, adding all the required dialog annotations to fit your requirements, and then post the original and modified .mo files here. At that point, patching the diff of the two files onto the built-in wrapper code generator will be straightforward.
Would you like to give it a try?
I saw that in Dymola and in Matlab (and probably in other tools), submodels are shown as single entities in the main dialog box, and you can access the internal parameters through interaction with these single entities.
Matlab and Dymola create wrappers for the FMU, but, obviously, only Dymola does this in Modelica. So I thought to take inspiration from the Dymola wrapper.
To appreciate the differences, using Dymola, load the three mo files in MU wrapper.zip, open compare, and double click on either of the two submodels (indeed two wrappers of the same FMU, the left one created by OM the right by Dymola).
Some screenshots here:
I also tried to load the Dymola wrapper into OM but found that the result is different and not what we need:
So, I realized that Dymola, when creating its FMU wrapper, uses own extensions of Modelica, which it also uses for nested editing of parameters (I mean, changing parameter values of submodels of a main model from the dialog box of the main model).
I know that work is in progress to allow nested editing of parameters also in OM, even though insofar I could not locate the relevant ticket. EDIT: it is #2891
Maybe to approach this ticket it is better to wait that the nested editing of parameters to be implemented in OM? The same technique used for regular Modelica will then be used also for FMU wrappers.
Description
This is not a bug report, just a suggestion of a possible improvement
Imported FMUs created from modelica file show as parameters not only those available from the outside in the original modelica model, but also all the internal parameters, and show them in a non-structured way. In very simple the example given, the list is large and difficult to read, and can easily become huge and unmanageable. I propose to show parameters in a more structured way. See details below under "expected behaviour" I know that variables of imported FMUs are not shown as structured, also in output mat file; I miss a structured display also there, but I'll open a separate ticket for that.
Steps to Reproduce
Use the following file (without txt): TestWTable.mo.txt
Expected Behavior
In TestBlockFMU, upon double-clicking on "block1", I would expect as list of variables: K firstOrder myTable.
K would show its value, while firstOrder and my Table should be expandable to show their internal parameters.
Version and OS
OM 1.20-dev-398 Ubuntu 22.4 under a VirtualBox MSL 4.0
#