Skip to content

Commit

Permalink
- The buildModel script now include the log of the simulation executa…
Browse files Browse the repository at this point in the history
…bles

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12930 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 14, 2012
1 parent eb5668c commit e7de5b6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Examples/BuildModelRecursive.mos
Expand Up @@ -50,7 +50,9 @@ writeFile(statFile,\"<tr><td bgcolor=\\\"#ff0000\\\">"+s+"</td></tr>\");getError
loadModel(Modelica,{\"3.1\"});"+loadModelicaTest+"
res:=buildModel("+s+");
errFile:=\""+s+".err\";
simFile:=\""+s+".sim\";
err:=getErrorString();
system(\"rm -f \" + errFile + \" \" + simFile);
if err <> \"\" then
writeFile(errFile,err);
end if;
Expand All @@ -70,7 +72,7 @@ linearize:=if linearize <> -1.0 then linearize-templates else -1.0;
templates:=if templates <> -1.0 then templates-build else -1.0;

OpenModelica.Scripting.Internal.Time.timerTick(OpenModelica.Scripting.Internal.Time.RT_CLOCK_USER_RESERVED);
simRes := if res[1] == \"\" then false else 0 == system(\"ulimit -t "+ulimitExe+" ; ./"+s+"\");
simRes := if res[1] == \"\" then false else 0 == system(\"ulimit -t "+ulimitExe+" ; ./"+s+" > \"+simFile+\" 2>&1\");
timeSim := OpenModelica.Scripting.Internal.Time.timerTock(OpenModelica.Scripting.Internal.Time.RT_CLOCK_USER_RESERVED);
timeSim := if simRes then timeSim else -1.0;

Expand All @@ -84,7 +86,10 @@ algorithm
OpenModelica.Scripting.Internal.Time.readableTime(if time < 1e-5 then 0 else time)+\\\"</td>\\\");
end cell;
\");getErrorString();
str:=\"<tr><td>\" + (if err <> \"\" then \"<a href=\"+errFile+\">"+s+"</a>\" else \""+s+"\")+\"</td>\" +
sim:=readFile(simFile);
str:=\"<tr><td>\" + (if err <> \"\" then \"<a href=\"+errFile+\">"+s+"</a>\" else \""+s+"\") +
(if sim <> \"\" then \" (<a href=\"+simFile+\">sim</a>)\" else \"\") +
\"</td>\" +
cell(timeSim,greenOnOk=true) +
\"<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();
Expand Down

0 comments on commit e7de5b6

Please sign in to comment.