-
Notifications
You must be signed in to change notification settings - Fork 164
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
ComplexInput and ComplexOutput icons have strange greyed boxes #2765
Comments
Confirmed. I always wondered about these grey boxes and strongly believe it is not by design to inherit the icon of the operator record Complex here. It actually looks like a design hole of the Modelica specification to me. Causal connectors can only be defined by short class definitions using the base-prefix input or output, see section 4.5.1 They cannot be defined by "long-class" extends clause. However, only for "long-class" definitions using inheritance the icon and diagram graphics of the base class can be remapped or set invisible, see section 18.6.3. Thus, we either have the short-class definition and get a causal connector along with the base class graphics or we have a "long-class" definition, but miss the base-prefix in any case: connector ComplexNotCausal "Not what we want"
extends Complex annotation(IconMap(primitivesVisible=false));
annotation(Icon(coordinateSystem(
extent={{-100,-100},{100,100}},
preserveAspectRatio=true,
initialScale=0.2), graphics={Polygon(
points={{-100,100},{100,0},{-100,-100},{-100,100}},
lineColor={85,170,255},
fillColor={85,170,255},
fillPattern=FillPattern.Solid)}));
end ComplexNotCausal; |
I see. Thank you for the explanation. |
I played around with an additional ComplexBase class (w/o) icon definition but failed. Probably, the easiest solution is to remove the icon graphics from the operator record (which is not displayed in the Dymola library panel anyway to pretend a builtin type Complex). |
A fallback option is just adding an intermediate rectangle between the grey and the triangle as follows. Does not solve the issue in its roots, but hides it, I suppose satisfactorily. connector ComplexOutput = output Complex "'output Complex' as connector"
annotation (
defaultComponentName="y",
Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100,
100}}),
graphics={Rectangle(
extent={{-100,102},{100,-100}},
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
pattern=LinePattern.None),
Polygon(
points={{-100,100},{100,0},{-100,-100},{-100,100}},
lineColor={85,170,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid)}),
Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{
100,100}}), graphics={Polygon(
points={{-100,50},{0,0},{-100,-50},{-100,50}},
lineColor={85,170,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid), Text(
extent={{30,110},{30,60}},
lineColor={0,0,127},
textString="%name")}),
Documentation(info="<html>
<p>
Connector with one output signal of type Complex.
</p>
</html>")); |
Possible. But not good enough for a standard library. |
Yes it is tricky. In addition, it works well with Dymola, but is unreliable in OM. |
I clarify a little. But such a choice should be painless for users. If does not work in OM it is unacceptable. |
Remove the icon graphics from the operator record Complex, and thus also from the ComplexInput/ComplexOutput (which inherited the graphics via the short-class connector definition)
@HansOlsson Do you confirm the language hole? Shall I create a separate issue (since it does neither fit in modelica/ModelicaSpecification#377 nor modelica/ModelicaSpecification#2200)? |
To me the simplest way of specifying it would be: As far as I can understand that should work according to 18.6: |
Ok. The other option would be to allow base-prefix for long-class definitions, which opens the general question if every short-class defintion must always be possible to be defined as long-class equivalent. |
Afaik, SimulationX, OMEdit and MapleSim support the IconMap. It's just that it is not yet used in the MSL and that there are some open clarification issues to be dealt with. |
Since you cannot combine the base-prefixed class with any other contents that seems like something that is easy to use incorrectly.
I specifically meant IconMap on short class. |
Right, got it. Will open a specification issue with your clarification proposal and a new MSL PR making it a tool issue then. |
ComplexBlocks.Interfaces.ComplexInput and ComplexBlocks.Interfaces.ComplexOutput icons have a strange greyed background (a rounded box below the arrow).
I don't know whether this is done on purpose, but it seems to me rather confusing.
I propose to remove those greyed boxes.
The text was updated successfully, but these errors were encountered: