Skip to content

Commit d222ae1

Browse files
committed
Fix icon inheritance
1 parent d2f3507 commit d222ae1

File tree

3 files changed

+280
-115
lines changed

3 files changed

+280
-115
lines changed

Complex.mo

+14-11
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,22 @@ operator record Complex "Complex number with overloaded operators"
1818
end fromReal;
1919
annotation (Documentation(info="<html>
2020
<p>Here the constructor operator(s) is/are defined.</p>
21-
</html>"), Icon(graphics={Rectangle(
21+
</html>"), Icon(
22+
graphics={
23+
Rectangle(
2224
lineColor={200,200,200},
2325
fillColor={248,248,248},
2426
fillPattern=FillPattern.HorizontalCylinder,
2527
extent={{-100,-100},{100,100}},
26-
radius=25.0), Rectangle(
28+
radius=25.0),
29+
Rectangle(
2730
lineColor={128,128,128},
2831
extent={{-100,-100},{100,100}},
29-
radius=25.0)}));
32+
radius=25.0),
33+
Text(
34+
textColor={128,128,128},
35+
extent={{-90,-90},{90,90}},
36+
textString="f")}));
3037
end 'constructor';
3138

3239
encapsulated operator function '0' "Zero-element of addition (= Complex(0))"
@@ -131,14 +138,10 @@ operator record Complex "Complex number with overloaded operators"
131138
lineColor={128,128,128},
132139
extent={{-100,-100},{100,100}},
133140
radius=25.0),
134-
Line(
135-
points={{-42,36},{39,-34}}),
136-
Line(
137-
points={{-42,-35},{39,37}}),
138-
Line(
139-
points={{-55,1},{52,1}}),
140-
Line(
141-
points={{-1.5,55},{-2,-53}})}));
141+
Line(points={{-40,35},{40,-35}}),
142+
Line(points={{-40,-35},{40,35}}),
143+
Line(points={{-55,0},{55,0}}),
144+
Line(points={{0,55},{0,-55}})}));
142145
end '*';
143146

144147
encapsulated operator function '+' "Add two complex numbers"

Modelica/Icons.mo

+39-8
Original file line numberDiff line numberDiff line change
@@ -530,29 +530,60 @@ This icon is designed for a <strong>translational sensor</strong> model.
530530
extent={{-150,60},{150,100}},
531531
textString="%name"),
532532
Rectangle(
533-
origin={0.0,-25.0},
533+
origin={0,-25},
534534
lineColor={64,64,64},
535535
fillColor={255,215,136},
536536
fillPattern=FillPattern.Solid,
537-
extent={{-100.0,-75.0},{100.0,75.0}},
538-
radius=25.0),
537+
extent={{-100,-75},{100,75}},
538+
radius=25),
539539
Line(
540-
points={{-100.0,0.0},{100.0,0.0}},
540+
points={{-100,0},{100,0}},
541541
color={64,64,64}),
542542
Line(
543-
origin={0.0,-50.0},
544-
points={{-100.0,0.0},{100.0,0.0}},
543+
origin={0,-50},
544+
points={{-100,0},{100,0}},
545545
color={64,64,64}),
546546
Line(
547-
origin={0.0,-25.0},
548-
points={{0.0,75.0},{0.0,-75.0}},
547+
origin={0,-25},
548+
points={{0,75},{0,-75}},
549549
color={64,64,64})}), Documentation(info="<html>
550550
<p>
551551
This icon is indicates a record.
552552
</p>
553553
</html>"));
554554
end Record;
555555

556+
partial operator record OperatorRecord "Icon for operator records"
557+
558+
annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics={
559+
Text(
560+
textColor={0,0,255},
561+
extent={{-150,60},{150,100}},
562+
textString="%name"),
563+
Rectangle(
564+
origin={0,-25},
565+
lineColor={64,64,64},
566+
fillColor={255,215,136},
567+
fillPattern=FillPattern.Solid,
568+
extent={{-100,-75},{100,75}},
569+
radius=25),
570+
Line(
571+
points={{-100,0},{100,0}},
572+
color={64,64,64}),
573+
Line(
574+
origin={0,-50},
575+
points={{-100,0},{100,0}},
576+
color={64,64,64}),
577+
Line(
578+
origin={0,-25},
579+
points={{0,75},{0,-75}},
580+
color={64,64,64})}), Documentation(info="<html>
581+
<p>
582+
This icon is indicates an operator record.
583+
</p>
584+
</html>"));
585+
end OperatorRecord;
586+
556587
type TypeReal "Icon for Real types"
557588
extends Real;
558589
annotation(Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={

0 commit comments

Comments
 (0)