-
Notifications
You must be signed in to change notification settings - Fork 297
/
AddClassAnnotation.mos
57 lines (48 loc) · 4.41 KB
/
AddClassAnnotation.mos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// name: AddClassAnnotation
// keywords:
// status: correct
// cflags: -d=-newInst
//
// Tests the addClassAnnotation API.
//
loadString("
model PA
annotation (Icon(graphics={Polygon(lineColor={0,0,127}, fillColor={0,0,127},
fillPattern=FillPattern.Solid, points={{-100.0,100.0},{100.0,0.0},{-100.0,-100.0}})}));
end PA;
model PB end PB;
type DA = Real annotation (Icon(graphics={Polygon(lineColor={0,0,127}, fillColor={0,0,127},
fillPattern=FillPattern.Solid, points={{-100.0,100.0},{100.0,0.0},{-100.0,-100.0}})}));
type DB = Real;
type EA = enumeration(a, b, c) annotation (Icon(graphics={Polygon(lineColor={0,0,127}, fillColor={0,0,127},
fillPattern=FillPattern.Solid, points={{-100.0,100.0},{100.0,0.0},{-100.0,-100.0}})}));
type EB = enumeration(x, y, z);
"); getErrorString();
addClassAnnotation(PA, annotate=Icon(graphics={Polygon(lineColor={0,0,127},fillColor={0,0,127},fillPattern=FillPattern.Solid,points={{0,50},{100,0},{0,-50},{0,50}}),Rectangle(lineColor={0,0,255},fillColor={0,0,255},extent={{-100,100},{100,-100}})}));
addClassAnnotation(PB, annotate=Icon(graphics={Polygon(lineColor={0,0,127},fillColor={0,0,127},fillPattern=FillPattern.Solid,points={{0,50},{100,0},{0,-50},{0,50}}),Rectangle(lineColor={0,0,255},fillColor={0,0,255},extent={{-100,100},{100,-100}})}));
addClassAnnotation(DA, annotate=Icon(graphics={Polygon(lineColor={0,0,127},fillColor={0,0,127},fillPattern=FillPattern.Solid,points={{0,50},{100,0},{0,-50},{0,50}}),Rectangle(lineColor={0,0,255},fillColor={0,0,255},extent={{-100,100},{100,-100}})}));
addClassAnnotation(DB, annotate=Icon(graphics={Polygon(lineColor={0,0,127},fillColor={0,0,127},fillPattern=FillPattern.Solid,points={{0,50},{100,0},{0,-50},{0,50}}),Rectangle(lineColor={0,0,255},fillColor={0,0,255},extent={{-100,100},{100,-100}})}));
addClassAnnotation(EA, annotate=Icon(graphics={Polygon(lineColor={0,0,127},fillColor={0,0,127},fillPattern=FillPattern.Solid,points={{0,50},{100,0},{0,-50},{0,50}}),Rectangle(lineColor={0,0,255},fillColor={0,0,255},extent={{-100,100},{100,-100}})}));
addClassAnnotation(EB, annotate=Icon(graphics={Polygon(lineColor={0,0,127},fillColor={0,0,127},fillPattern=FillPattern.Solid,points={{0,50},{100,0},{0,-50},{0,50}}),Rectangle(lineColor={0,0,255},fillColor={0,0,255},extent={{-100,100},{100,-100}})}));
getIconAnnotation(PA);
getIconAnnotation(PB);
getIconAnnotation(DA);
getIconAnnotation(DB);
getIconAnnotation(EA);
getIconAnnotation(EB);
// Result:
// true
// ""
// true
// true
// true
// true
// true
// true
// {-,-,-,-,-,-,-,,{Polygon(true, {0.0, 0.0}, 0, {0, 0, 127}, {0, 0, 127}, LinePattern.Solid, FillPattern.Solid, 0.25, {{0, 50}, {100, 0}, {0, -50}, {0, 50}}, Smooth.None), Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 255}, LinePattern.Solid, FillPattern.None, 0.25, BorderPattern.None, {{-100, 100}, {100, -100}}, 0)}}
// {-,-,-,-,-,-,-,,{Polygon(true, {0.0, 0.0}, 0, {0, 0, 127}, {0, 0, 127}, LinePattern.Solid, FillPattern.Solid, 0.25, {{0, 50}, {100, 0}, {0, -50}, {0, 50}}, Smooth.None), Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 255}, LinePattern.Solid, FillPattern.None, 0.25, BorderPattern.None, {{-100, 100}, {100, -100}}, 0)}}
// {-,-,-,-,-,-,-,,{Polygon(true, {0.0, 0.0}, 0, {0, 0, 127}, {0, 0, 127}, LinePattern.Solid, FillPattern.Solid, 0.25, {{0, 50}, {100, 0}, {0, -50}, {0, 50}}, Smooth.None), Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 255}, LinePattern.Solid, FillPattern.None, 0.25, BorderPattern.None, {{-100, 100}, {100, -100}}, 0)}}
// {-,-,-,-,-,-,-,,{Polygon(true, {0.0, 0.0}, 0, {0, 0, 127}, {0, 0, 127}, LinePattern.Solid, FillPattern.Solid, 0.25, {{0, 50}, {100, 0}, {0, -50}, {0, 50}}, Smooth.None), Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 255}, LinePattern.Solid, FillPattern.None, 0.25, BorderPattern.None, {{-100, 100}, {100, -100}}, 0)}}
// {-,-,-,-,-,-,-,,{Polygon(true, {0.0, 0.0}, 0, {0, 0, 127}, {0, 0, 127}, LinePattern.Solid, FillPattern.Solid, 0.25, {{0, 50}, {100, 0}, {0, -50}, {0, 50}}, Smooth.None), Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 255}, LinePattern.Solid, FillPattern.None, 0.25, BorderPattern.None, {{-100, 100}, {100, -100}}, 0)}}
// {-,-,-,-,-,-,-,,{Polygon(true, {0.0, 0.0}, 0, {0, 0, 127}, {0, 0, 127}, LinePattern.Solid, FillPattern.Solid, 0.25, {{0, 50}, {100, 0}, {0, -50}, {0, 50}}, Smooth.None), Rectangle(true, {0.0, 0.0}, 0, {0, 0, 255}, {0, 0, 255}, LinePattern.Solid, FillPattern.None, 0.25, BorderPattern.None, {{-100, 100}, {100, -100}}, 0)}}
// endResult