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 | end M1;";
|
---|
9 | loadString(s1, "M1.mo");
|
---|
10 | getErrorString();
|
---|
11 | addClassAnnotation(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}})}));
|
---|
12 | getErrorString();
|
---|
13 | answer := "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}})}));
|
---|
22 | end M1;";
|
---|
23 | s2 := listFile(M1);
|
---|
24 | print(s2);
|
---|
25 | if 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());
|
---|
31 | end if;
|
---|