Skip to content

Commit

Permalink
- Print user-friendly times (not 7.83e3 sec...)
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11088 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 10, 2012
1 parent d9d3bb3 commit e36aff9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Examples/BuildModelRecursive.mos
Expand Up @@ -2,8 +2,10 @@

OpenModelica.Scripting.Internal.Time.timerTick(OpenModelica.Scripting.Internal.Time.RT_CLOCK_USER_RESERVED);
log:="BuildModelRecursive.html";
loadModel(Modelica,{"3.1"});
MSLVersion:="3.1";
loadModel(Modelica,{MSLVersion});

/*
deleteClass(Modelica.Blocks);
deleteClass(Modelica.Electrical);
deleteClass(Modelica.Fluid);
Expand All @@ -12,9 +14,10 @@ deleteClass(Modelica.Mechanics);
deleteClass(Modelica.Media);
deleteClass(Modelica.Thermal);
deleteClass(Modelica.Utilities);
*/

system("rm -f Modelica");
system("ln -fs '"+getInstallationDirectoryPath()+"/lib/omlibrary/Modelica 3.1/' Modelica");
system("ln -fs '"+getInstallationDirectoryPath()+"/lib/omlibrary/"+MSLVersion+"/' Modelica");
omc:=getInstallationDirectoryPath()+"/bin/omc";
loadString("
function subScript
Expand Down Expand Up @@ -67,10 +70,10 @@ function cell
input Real time;
output String str;
algorithm
str := if time==-1.0 then \\\"<td bgcolor=\\\\\\\"#FF0000\\\\\\\">&nbsp;</td>\\\" else \\\"<td>\\\"+String(if time < 1e-5 then 0 else time,significantDigits=3)+\\\"</td>\\\";
str := if time==-1.0 then \\\"<td bgcolor=\\\\\\\"#FF0000\\\\\\\">&nbsp;</td>\\\" else \\\"<td>\\\"+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><td bgcolor=\\\"#\"+(if res[1]<>\"\" then \"00FF00\" else \"FF0000\")+\"\\\">\"+String(total,significantDigits=3)+\"</td>\" + sum(cell(d) for d in {frontend,backend,simcode,linearize,templates,build}) + \"</tr>\\n\";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();
") for s in a);
getErrorString();
Expand Down

0 comments on commit e36aff9

Please sign in to comment.