-
Notifications
You must be signed in to change notification settings - Fork 40
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
Appearance of initialization variables in the parameter dialog #3406
Comments
For the 2nd point I believe a better solution is the one implemented in Dymola - specifically that a variable with a Dialog-annotation has to appear in the user interface, unless it only contains The idea was based on requests, specifically that if you have a declaration: But you don't want the variable itself to appear, just because you didn't want the start-value to appear! However, if you set tab and/or group you obviously want the variable to appear there (and not the start-value). For the 1st point, I also agree that if you have a start-value it makes sense to show it as if
This makes the handling more uniform - if a variable has a start-value you as default change it in the Initialization-group. *: Another special case is that if it has |
@HansOlsson Thanks for the explanation. I personally agree with both of your points and also think that Dymola's behaviour is better. Regarding my first point (Appearance in UI based on start-value): Regarding the second point (Non appearance in UI if dialogue annotation only contains However, both your explanations are not part of the Modelica Specification. Am I right? Thanks for your assessment |
Other cases where I noticed tool inconsistencies are displaying in the Dialog of parameters with fixed = false and non-connector variables marked with input. Just adding here, so that, when we work on the specification, those cases do not get overlooked. |
Phone meeting: Add guideline (or recommendation) in the specification for this: Agree (to try at least). |
Regarding the first point:
If I remember correctly this is only true if the specified start value is a literal. In the example below, Dymola will show none of the variables' start values in the GUI. Whether or not this is intentional or what the motivation behind it is I don't know.
|
It is intentional. (Without checking, I also believe it is only literal, where negative numbers are seen as literal.) It's always a problem where to draw the line, but in the example below - it don't think you want both
If it is a literal value there's no similar confusion. |
So the relevant cases I can see are:
For consistency I believe we should generalize the showStartAttribute=false to also allow connectorSizing=false (even if no-one uses that). Obviously if the variable and/or modifier is final we shouldn't allow modification - and might skip showing them. (Dymola allows showing them - the reason is that you can also use the parameter dialog to see the current value.) Added: I'm now unsure about connectorSizing=false, since the annotation is normally on parameters, so too weird. |
This sounds reasonable to me. Thanks for the summary.
Currently Dymola does not show this but for example OMEdit does. Not showing them would also be OK for us. As mentioned above a similar look is most important for our use case. |
Showing public non-final
(Well, I believe there's a separate PR about removing the use of unitK.) |
For clarification. OMEdit only displays non-final public constants if they include a dialog annotation. So the constants from your MSL example are not shown there and we also do not want them be shown. The question whether non-final public constants with a dialog annotation should be displayed or not is also not that important for us. What matters most in our opinion is that a clarification in the specification is needed to reach a uniform dialog appearance across different tools. |
We can certainly add state that they should be added if they have a Dialog-annotation; I hope no-one uses that for such cases. |
So the proposed logic is:
We might also skip specifying the last two for now, and encourage users to actually use showStartAttribute=true for the last case. |
The specification shouldn't be overly detailed on what to show; tools also need freedom for intelligent behavior tailored for different situations. Also, not all tools look the same, and what makes sense to show in one tool may not always make sense to show in another tool, and vice versa. |
Hopefully, we will get the |
Description
During our Modelica library development at Bosch Rexroth we stumbled across the problem of initialization variables being shown in the parameter dialogue based on different conditions in different tools.
I read through existing issues regarding the default choice of
Dialog.showStartAttribute
#2823 and the usage of this Dialog annotation in the MSL modelica/ModelicaStandardLibrary#1855, modelica/ModelicaStandardLibrary#2896, modelica/ModelicaStandardLibrary#2897.All those issues are still open or marked as a wontfix until a completely new initialization approach is developed for the MSL from my understanding.
We do not want to debate those issues since we do not think that we are qualified to do so even though we would be highly interested in a solution.
For us, the most important thing is a coherent appearance in the parameter dialogue of different Modelica tools.
As shown by @beutlich in a comment to one of the above tickets modelica/ModelicaStandardLibrary#2896 (comment)_ the non-uniform handling of initialization leads to different visualizations in Dymola and SimulationX. Four years later this is still the case and now a problem in our development process as well.
Our two pain points, which result in different visualizations are:
showStartAttribute=false
annotation is present, Dymola won't show the variable in the dialogue and SimulationX will show the variable (but not its start value, which is correct according to the specification section 18.7).Way forward
We hope that there is a solution with a clarified specification regarding visualization that results in equally looking parameter dialogues without the need to redo the initialization concept in the tools and the MSL itself.
In the Modelica specification 3.6 I did not find a formulation regarding the appearance of variables in the user interface. I specifically searched in sections 4.4 (Component declarations) and 18.7 (annotations for graphical user interface). If I missed something, please let me know.
We expect that formulations like the two below would help to create a more uniform picture across different tools. (These formulations would obviously be overwritten by prefixes like
final
).Thanks for considering this
Aaron Buntrock - Bosch Rexroth
The text was updated successfully, but these errors were encountered: