Ticket #3424: addClassAnnotation1.mos

File addClassAnnotation1.mos, 1.7 KB (added by Adeel Asghar, 9 years ago)
Line 
1echo(false);
2s1 := "model M1
3 annotation(Icon(coordinateSystem(
4 preserveAspectRatio=false,
5 extent={{-100,-100},{100,100}}), graphics={
6 Line(points={{-60,50},{60,50}}, color={0,0,255}),
7 Line(points={{0,90},{0,50}}, color={0,0,255})}),
8 Diagram(coordinateSystem(
9 preserveAspectRatio=false,
10 extent={{-100,-100},{100,100}}), graphics={
11 Line(points={{-60,50},{60,50}}, color={0,0,255})}));
12end M1;";
13loadString(s1, "M1.mo");
14getErrorString();
15addClassAnnotation(M1, annotate=Diagram(coordinateSystem=CoordinateSystem(extent={{-100, -100}, {100, 100}}, preserveAspectRatio=false, initialScale=0.1, grid={2, 2}), graphics={Line(points={{-60,50},{60,50}},color={0,0,255}),Rectangle(origin={-30,-43},extent={{-74,49},{74,-49}})}));
16getErrorString();
17answer := "model M1
18 annotation(Icon(coordinateSystem(
19 preserveAspectRatio=false,
20 extent={{-100,-100},{100,100}}, initialScale = 0.1, grid = {2, 2}), graphics={
21 Line(points={{-60,50},{60,50}}, color={0,0,255}),
22 Line(points={{-40,30},{40,30}}, color={0,0,255}),
23 Line(points={{-20,10},{20,10}}, color={0,0,255}),
24 Line(points={{0,90},{0,50}}, color={0,0,255})}),
25 Diagram(coordinateSystem(
26 preserveAspectRatio=false,
27 extent={{-100,-100},{100,100}}), graphics={
28 Line(points={{-60,50},{60,50}}, color={0,0,255}),
29 Rectangle(origin = {-30, -43}, extent = {{-74, 49}, {74, -49}})}));
30end M1;";
31s2 := listFile(M1);
32print(s2);
33if answer<>diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain) then
34 print("\nFailed \n");
35 print("\nStart model:\n\n" + s1 + "\n");
36 print("\nAdded rectangle+listFile:\n\n" + s2 + "\n");
37 print("\nDiff:\n\n" + diffModelicaFileListings(s1, s2) + "\n");
38 print(getErrorString());
39end if;