Ticket #3424: addClassAnnotation.mos

File addClassAnnotation.mos, 1.4 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})}));
8end M1;";
9loadString(s1, "M1.mo");
10getErrorString();
11addClassAnnotation(M1, annotate=Icon(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}),Line(points={{0,90},{0,50}},color={0,0,255}),Rectangle(origin={-30,-43},extent={{-74,49},{74,-49}})}));
12getErrorString();
13answer := "model M1
14 annotation(Icon(coordinateSystem(
15 preserveAspectRatio=false,
16 extent={{-100,-100},{100,100}}, initialScale = 0.1, grid = {2, 2}), graphics={
17 Line(points={{-60,50},{60,50}}, color={0,0,255}),
18 Line(points={{-40,30},{40,30}}, color={0,0,255}),
19 Line(points={{-20,10},{20,10}}, color={0,0,255}),
20 Line(points={{0,90},{0,50}}, color={0,0,255}),
21 Rectangle(origin = {-30, -43}, extent = {{-74, 49}, {74, -49}})}));
22end M1;";
23s2 := listFile(M1);
24print(s2);
25if answer<>diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain) then
26 print("\nFailed \n");
27 print("\nStart model:\n\n" + s1 + "\n");
28 print("\nAdded rectangle+listFile:\n\n" + s2 + "\n");
29 print("\nDiff:\n\n" + diffModelicaFileListings(s1, s2) + "\n");
30 print(getErrorString());
31end if;