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={{-40,30},{40,30}}, color={0,0,255}),
|
---|
8 | Line(points={{-20,10},{20,10}}, color={0,0,255}),
|
---|
9 | Line(points={{0,90},{0,50}}, color={0,0,255})}));
|
---|
10 | end M1;";
|
---|
11 | loadString(s1, "M1.mo");
|
---|
12 | getErrorString();
|
---|
13 | addComponent(m1, Real, M1, annotate=Placement(visible=true, transformation=transformation(origin={-24,-54}, extent={{-10,-10},{10,10}}, rotation=0)));
|
---|
14 | getErrorString();
|
---|
15 | s2 := listFile(M1);
|
---|
16 | getErrorString();
|
---|
17 | contents := diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain);
|
---|
18 | getErrorString();
|
---|
19 | deleteComponent(m1, M1);
|
---|
20 | getErrorString();
|
---|
21 | s2 := listFile(M1);
|
---|
22 | if s1<>diffModelicaFileListings(contents, s2, OpenModelica.Scripting.DiffFormat.plain) then
|
---|
23 | print("\nFailed \n");
|
---|
24 | print("\nStart model:\n\n" + contents + "\n");
|
---|
25 | print("\ndeleteComponent+listFile:\n\n" + s2 + "\n");
|
---|
26 | print("\nDiff:\n\n" + diffModelicaFileListings(contents, s2) + "\n");
|
---|
27 | print(getErrorString());
|
---|
28 | end if;
|
---|