You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by davies on 6 Jul 2012 05:59 UTC
I'm new to Modelica, via Wolfram System Modeler. To convert a colleague's model into System Modeler, I needed an Add4 module. Yes, I could have built it out of Add and/or Add3, but I thought I would accelerate my learning by creating my own new block, basically expanding Add3 into Add4. In trying to understand the graphical annotations for Add3, it seemed like there was a lot of code there for such a simple icon. First, I learned the distinction between Icon and Diagram accounting for one level of duplication: for this simple block, the icon and diagram appear to be the same. Next, however, I looked closely at the diagram code and noticed that it seemed to contain two almost identical copies of the same drawing sequence. Presumably one is unnecessary. Is this true, or am I missing something?
Here's the diagram code, with a little formatting to clarify:
Comment by dietmarw on 6 Jul 2012 07:58 UTC
Thanks for the report. You are right this is most likely some leftover which is not easy to detect when only looking at the diagram layer. I'm going to remove the duplicate definition (also present in "Add" btw) right away.
Reported by davies on 6 Jul 2012 05:59 UTC
I'm new to Modelica, via Wolfram System Modeler. To convert a colleague's model into System Modeler, I needed an Add4 module. Yes, I could have built it out of Add and/or Add3, but I thought I would accelerate my learning by creating my own new block, basically expanding Add3 into Add4. In trying to understand the graphical annotations for Add3, it seemed like there was a lot of code there for such a simple icon. First, I learned the distinction between Icon and Diagram accounting for one level of duplication: for this simple block, the icon and diagram appear to be the same. Next, however, I looked closely at the diagram code and noticed that it seemed to contain two almost identical copies of the same drawing sequence. Presumably one is unnecessary. Is this true, or am I missing something?
Here's the diagram code, with a little formatting to clarify:
Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100,100}}, grid={2,2}),
graphics={
Rectangle(extent={{-100,-100},{100,100}}, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.Solid),
Text(extent={{-100,50},{5,90}}, lineColor={0,0,0}, textString="%k1"),
Text(extent={{-100,-20},{5,20}}, lineColor={0,0,0}, textString="%k2"),
Text(extent={{-100,-50},{5,-90}}, lineColor={0,0,0}, textString="%k3"),
Text(extent={{2,36},{100,-44}}, lineColor={0,0,0}, textString="+"),
Rectangle(extent={{-100,-100},{100,100}}, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.Solid),
Text(extent={{-100,50},{5,90}}, lineColor={0,0,0}, textString="k1"),
Text(extent={{-100,-20},{5,20}}, lineColor={0,0,0}, textString="k2"),
Text(extent={{-100,-50},{5,-90}}, lineColor={0,0,0}, textString="k3"),
Text(extent={{2,36},{100,-44}}, lineColor={0,0,0}, textString="+")}))
The only apparent difference between the two chunks is the % sign before the text strings k1, k2, k3? Is this meaningful?
Migrated-From: https://trac.modelica.org/Modelica/ticket/772
The text was updated successfully, but these errors were encountered: