Skip to content

Commit

Permalink
- Avoid problems if omc crashes
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11092 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 13, 2012
1 parent e1689be commit dac7bc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Examples/BuildModelRecursive.mos
Expand Up @@ -5,7 +5,6 @@ log:="BuildModelRecursive.html";
MSLVersion:="3.1";
loadModel(Modelica,{MSLVersion});

/*
deleteClass(Modelica.Blocks);
deleteClass(Modelica.Electrical);
deleteClass(Modelica.Fluid);
Expand All @@ -14,7 +13,6 @@ deleteClass(Modelica.Mechanics);
deleteClass(Modelica.Media);
deleteClass(Modelica.Thermal);
deleteClass(Modelica.Utilities);
*/

system("rm -f Modelica");
system("ln -fs '"+getInstallationDirectoryPath()+"/lib/omlibrary/"+MSLVersion+"/' Modelica");
Expand Down Expand Up @@ -43,6 +41,8 @@ print("Number of classes to build: " + String(size(a,1)));
system("rm -f Modelica.* " + log);
min(writeFile(s + ".mos","
writeFile(\""+log+"\",\""+s+"\n\",append=true);
statFile := \""+s+".stat\";
writeFile(statFile,\"<tr><td bgcolor=\\\"#ff0000\\\">"+s+"</td></tr>\");getErrorString();
loadModel(Modelica,{\"3.1\"});
res:=buildModel("+s+");
errFile:=\""+s+".err\";
Expand Down Expand Up @@ -74,7 +74,7 @@ algorithm
end cell;
\");getErrorString();
str:=\"<tr><td>\" + (if err <> \"\" then \"<a href=\"+errFile+\">"+s+"</a>\" else \""+s+"\")+\"</td><td bgcolor=\\\"#\"+(if res[1]<>\"\" then \"00FF00\" else \"FF0000\")+\"\\\">\"+OpenModelica.Scripting.Internal.Time.readableTime(total)+\"</td>\" + sum(cell(d) for d in {frontend,backend,simcode,linearize,templates,build}) + \"</tr>\\n\";getErrorString();
writeFile(\""+s+".stat\",str);getErrorString();
writeFile(statFile,str);getErrorString();
") for s in a);
getErrorString();
min(0==system(omc + " " + s + ".mos") for s in a);
Expand Down

0 comments on commit dac7bc3

Please sign in to comment.