1 | echo(false);
|
---|
2 | s1 := "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})}));
|
---|
12 | end M1;";
|
---|
13 | loadString(s1, "M1.mo");
|
---|
14 | getErrorString();
|
---|
15 | addClassAnnotation(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}})}));
|
---|
16 | getErrorString();
|
---|
17 | answer := "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}})}));
|
---|
30 | end M1;";
|
---|
31 | s2 := listFile(M1);
|
---|
32 | print(s2);
|
---|
33 | if 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());
|
---|
39 | end if;
|
---|