-
Notifications
You must be signed in to change notification settings - Fork 169
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
Change proposal to show calculation equation in icon of Division #2471
Conversation
It were actually also very helpful to allow modifications of doc strings, particularly in blocks: block Division "Output first input divided by second input"
extends Modelica.Blocks.Interfaces.SI2SO(
u1 "Dividend",u2 "Divisior", y "Quotient u1 / u2");
equation
y = u1/u2;
end Division; Apparently this code is legal in Modelica but the doc strings are not modified, neither in OpenModelica nor Dymola. |
I'd propose to apply the same font style, size and color as in Modelica.Blocks.Math.Add. |
block Division "Output first input divided by second input"
extends Modelica.Blocks.Interfaces.SI2SO(
u1 "Dividend",u2 "Divisior", y "Quotient u1 / u2");
equation
y = u1/u2;
end Division;
FYI, modification of description strings is properly supported by SimulationX. |
I wonder if we should pick the same font and color as in Modelica.ComplexBlocks.ComplexMath.Sqrt, as the text is more related to calculation function (as sqrt) than the parameters in Add. |
Good to know. I think we should then at least add the description string modifiers, even though some tools do not yet support this feature. |
To be even more concise and consistent: the text string shall only be |
I was not absolutely sure if comment modification is legal Modelica or not. If we add it here, it will open new possibilities for comments of all other classes as well. |
The comment modifications are legal in themselves (i.e. modifications can have such comments), but their semantics is not well-defined as far as I know. In particular it is not clear whether it is a description for the modification itself, or intended to override (or amend) the description of the original component. For the actual proposals: The updated original idea of just having "u1 / u2" in the icon-layer suffices for me, and can also be generalized to other cases where we don't have as well-known names for the operands, like matrix left-division. |
Should the text field height follow the recommendations in Modelica.UsersGuide.Conventions.Icons, i.e. 30 units? Actually, there are recommendations only for Component Name and Parameter Name in that Icon design guide. I think there should also be some for other auxilliary text. |
@HansOlsson and @sjoelund: do you know whether the modified descriptions strings are legal? Both Dymola and OpenModelica process the modifiers without complaints (but without effect)... |
... sorry -- I didn't update my browser and did not see your comments when responding I would then propose to add description text such as "u1 / u2" to the icon layer to better explain the behavior. |
I agree, we do not have guidelines for the text format of description strings. In Modelica.Blocks.Math the following text format is used:
Since we use text height of 40 for both |
@christiankral ... with option of 30 or minimum of 20 units. This could be esp. needed to not overcrowd the icon if there are used both an auxilliary text and a parameter text. Should we also give a recommendation for the color? The icon guide states: ...main icon color of a component shall be the same for all components of one library. Does this also apply for the auxilliary text or would it be better to recommend some particular color (e.g. gray) as this is the case for the Parameter name? |
Sounds like a plan: default text height is 40, optional 30, minimum 20. Personally, I think it is good to fix a default color for descriptive text. Once you understand the color scheme, you understand the meaning of each text element. I actually wanted to stick with the text color used in Summary of icon text colors:
If we stick with such a scheme, we have to modify a couple more icons to my understanding. To start from somewhere, I listed some models of the Analog package. @tobolar could you please double check if you agree with my color change proposals?
|
@HansOlsson SimulationX interpretes the comment modification as overriding the description of the original component. Can you please file a new Modelica language clarification ticket. Not sure if we need an MCP for this. Thanks. |
@christiankral I would prefer fixed color pattern as well. That shade of gray you suggest is also used in Modelica.Mechanics.MultiBody. So from my perspective the color is fine. I have also checked the Analog package. Beside those listed in your post, I have additionally found the following classes which should be adapted:
I also wonder whether we should have a particular definition for a connector descriptive text as is often used in MultiBody, see e.g. text a and b in |
@tobolar In order to reduce the complexity of rules I would go for the same color and size of descriptive text of connectors. The descriptive text "u1 / u2" of the Division block could also be seen as descriptive text of the output connector. In terms of location, I would tend to keep the descriptive inside the icon. Actually, when playing with text sizes it turns out that text height of 30 is still OK, as the greater text size of 40 may dominate the icon appearance. So my proposal in addition to Modelica.UsersGuide.Conventions.Icons for any kind of descriptive text is:
Example of Diagram View: |
@christiankral Your suggestion complies to my experience so far. So it's fully fine to me. |
Are there any additional comments and/or opinions on descriptive icon text? |
To me it seems a bit problematic to add a text "a", "b", "torque", "resolve" next to the connectors with the same names. That is nothing new with this ticket, but it made me realize this and instead of improving the text-layout we should reconsider it. Some problems are:
|
|
You are right for physical connectors where the maning should be clear. I see the meaning of the connector descriptive text especially for the real/boolean/integer connectors where the signals depend on the component they are used. The tooltips are meaningful rather for clarification of a conector of a particular instance in the model. In contrast, the connector descriptive text is helpful for fast understanding / checking of the model at once.
This is a discrepancy to be solved once the convention is clearly defined.
Could this be solved using |
I agree that it might be useful for those case, and not in other cases. However, in those cases this leads to the problem with base-classes as for Division - and it would be unfortunate if people don't use base-classes because of such texts. Thus a more general tool setting to show the connector name and/or the description might be better.
The visible attribute might help to de-clutter - but also cause issues; since there are reasons to show a disabled connector in some cases. |
I think that we should rather try to avoid additional connector descriptive text, as tooltips help a lot in identifying which connector is which. Therefore, I would rather see descriptive text to be part of the icon than over-explaining the connectors. I understand that "torque" is better to understand than "tau". In the same we use descriptive text to distinguish, e.g., the Electrical.Analog.Sensors, which would otherwise look (almost) all the same: So I think it makes sense to avoid descriptive text associated to connectors as far as possible.
@tobolar Could you possibly provide an example of such a component? |
Well the most striking component to me is Another example is To conclude, a connector descriptive text would be probably helpful where more real/boolean/integer connectors are used within a component. |
FYI: This will be clarified in specification version 3.5. |
Every time I am using
Modelica.Blocks.Math.Division
I cannot figure out intuitively whether the output is calculated byy = u1 / u2
ory = u2 / u1
. I thus propose to add the calculation formulay = u1 / u2
information to icon (right icon,division_proposal
):