forked from OpenModelica/OMLibraries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMSL.3.2.3.mos
53 lines (47 loc) · 2.74 KB
/
MSL.3.2.3.mos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
tmpScript:="Modelica.3.2.3.tmp.mos";
if 0<>system("patch --ignore-whitespace -d build/ -f -p1 < 'Modelica 3.2.3.manual.patch'") or
0<>system("patch --ignore-whitespace -d build/ -f -p1 < 'ModelicaServices 3.2.3.manual.patch'") then
exit(1);
end if;
for pack in {"Complex","Modelica","ModelicaServices","ModelicaTest"} loop
suffix := if pack=="Complex" then ".mo" else "/package.mo";
if not loadFile("build/"+pack+" 3.2.3"+suffix) then
print("Failed to load "+pack+" 3.2.3\n");
print(getErrorString());
exit(1);
end if;
end for;
getErrorString();
fundamentalWaveFile := getSourceFile(Modelica.Magnetic.QuasiStatic.FundamentalWave);
fileStrFundamentalWave := readFile(fundamentalWaveFile);
addClassAnnotation(Modelica.Magnetic.QuasiStatic.FundamentalWave.Examples.BasicMachines.InductionMachines.IMC_YD, __OpenModelica_simulationFlags(nls = "newton"));
addClassAnnotation(Modelica.Magnetic.QuasiStatic.FundamentalWave.Examples.BasicMachines.InductionMachines.IMC_Transformer, __OpenModelica_simulationFlags(nls = "newton"));
listing := listFile(Modelica.Magnetic.QuasiStatic.FundamentalWave);
fileStrFundamentalWave := diffModelicaFileListings(fileStrFundamentalWave, listing, OpenModelica.Scripting.DiffFormat.plain);
writeFile(fundamentalWaveFile, fileStrFundamentalWave);getErrorString();
echo(false);mathFile:=getSourceFile(Modelica.Math);mathFileStr:=readFile(mathFile);echo(true);
getErrorString();
echo(false);
servicesFile:=getSourceFile(ModelicaServices);
servicesFileStr:=readFile(servicesFile);
setClassComment(ModelicaServices, "ModelicaServices (OpenModelica implementation) - Models and functions used in the Modelica Standard Library requiring a tool specific implementation");
servicesFileStr := diffModelicaFileListings(servicesFileStr, listFile(ModelicaServices), OpenModelica.Scripting.DiffFormat.plain);
setComponentModifierValue(ModelicaServices, target, $Code(="OpenModelica"));
servicesFileStr := diffModelicaFileListings(servicesFileStr, listFile(ModelicaServices), OpenModelica.Scripting.DiffFormat.plain);
setComponentModifierValue(ModelicaServices.Machine, Integer_inf, $Code(=OpenModelica.Internal.Architecture.integerMax()));
servicesFileStr := diffModelicaFileListings(servicesFileStr, listFile(ModelicaServices), OpenModelica.Scripting.DiffFormat.plain);
addClassAnnotation(ModelicaServices.ExternalReferences.loadResource, annotate=__OpenModelica_EarlyInline(true));
servicesFileStr := diffModelicaFileListings(servicesFileStr, listFile(ModelicaServices), OpenModelica.Scripting.DiffFormat.plain);
err := getErrorString();
if err<>"" then
print(err);
exit(1);
end if;
echo(true);
writeFile(servicesFile, servicesFileStr);
if
0<>system("make 'Modelica 3.2.3.patch'") or
0<>system("make 'ModelicaServices 3.2.3.patch'")
then
exit(1);
end if;