Skip to content

Commit

Permalink
- Handle the new plot grid options in plotting APIs & OMNotebook.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20538 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed May 9, 2014
1 parent fab8c2e commit 1a6bf90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Compiler/FrontEnd/ModelicaBuiltin.mo
Expand Up @@ -2328,7 +2328,7 @@ function plot "Launches a plot window using OMPlot."
input Boolean externalWindow := false "Opens the plot in a new plot window";
input String fileName := "<default>" "The filename containing the variables. <default> will read the last simulation result";
input String title := "" "This text will be used as the diagram title.";
input Boolean grid := true "Determines whether or not a grid is shown in the diagram.";
input String grid := "detailed" "Sets the grid for the plot i.e simple, detailed, none.";
input Boolean logX := false "Determines whether or not the horizontal axis is logarithmically scaled.";
input Boolean logY := false "Determines whether or not the vertical axis is logarithmically scaled.";
input String xLabel := "time" "This text will be used as the horizontal label in the diagram.";
Expand Down Expand Up @@ -2365,7 +2365,7 @@ function plotAll "Works in the same way as plot(), but does not accept any
input Boolean externalWindow := false "Opens the plot in a new plot window";
input String fileName := "<default>" "The filename containing the variables. <default> will read the last simulation result";
input String title := "" "This text will be used as the diagram title.";
input Boolean grid := true "Determines whether or not a grid is shown in the diagram.";
input String grid := "detailed" "Sets the grid for the plot i.e simple, detailed, none.";
input Boolean logX := false "Determines whether or not the horizontal axis is logarithmically scaled.";
input Boolean logY := false "Determines whether or not the vertical axis is logarithmically scaled.";
input String xLabel := "time" "This text will be used as the horizontal label in the diagram.";
Expand Down Expand Up @@ -2409,7 +2409,7 @@ function plotParametric "Launches a plotParametric window using OMPlot. Returns
input Boolean externalWindow := false "Opens the plot in a new plot window";
input String fileName := "<default>" "The filename containing the variables. <default> will read the last simulation result";
input String title := "" "This text will be used as the diagram title.";
input Boolean grid := true "Determines whether or not a grid is shown in the diagram.";
input String grid := "detailed" "Sets the grid for the plot i.e simple, detailed, none.";
input Boolean logX := false "Determines whether or not the horizontal axis is logarithmically scaled.";
input Boolean logY := false "Determines whether or not the vertical axis is logarithmically scaled.";
input String xLabel := "time" "This text will be used as the horizontal label in the diagram.";
Expand Down
23 changes: 10 additions & 13 deletions Compiler/Script/CevalScript.mo
Expand Up @@ -860,7 +860,7 @@ algorithm
Real timeTotal,timeSimulation,timeStamp,val,x1,x2,y1,y2,r,r1,r2,linearizeTime,curveWidth,offset,offset1,offset2,scaleFactor,scaleFactor1,scaleFactor2;
GlobalScript.Statements istmts;
list<GlobalScript.Statements> istmtss;
Boolean have_corba, bval, anyCode, b, b1, b2, externalWindow, grid, logX, logY, gcc_res, omcfound, rm_res, touch_res, uname_res, ifcpp, ifmsvc,sort, builtin, showProtected, inputConnectors, outputConnectors;
Boolean have_corba, bval, anyCode, b, b1, b2, externalWindow, logX, logY, gcc_res, omcfound, rm_res, touch_res, uname_res, ifcpp, ifmsvc,sort, builtin, showProtected, inputConnectors, outputConnectors;
Env.Cache cache;
list<GlobalScript.LoadedFile> lf;
Absyn.ComponentRef crefCName;
Expand Down Expand Up @@ -2674,7 +2674,7 @@ algorithm
Values.BOOL(externalWindow),
Values.STRING(filename),
Values.STRING(title),
Values.BOOL(grid),
Values.STRING(gridStr),
Values.BOOL(logX),
Values.BOOL(logY),
Values.STRING(xLabel),
Expand Down Expand Up @@ -2703,7 +2703,7 @@ algorithm
// create the path till OMPlot
str2 = stringAppendList({omhome,pd,"bin",pd,"OMPlot",s1});
// create the list of arguments for OMPlot
str3 = "--filename=\"" +& filename +& "\" --title=\"" +& title +& "\" --grid=" +& boolString(grid) +& " --plotAll --logx=" +& boolString(logX) +& " --logy=" +& boolString(logY) +& " --xlabel=\"" +& xLabel +& "\" --ylabel=\"" +& yLabel +& "\" --xrange=" +& realString(x1) +& ":" +& realString(x2) +& " --yrange=" +& realString(y1) +& ":" +& realString(y2) +& " --new-window=" +& boolString(externalWindow) +& " --curve-width=" +& realString(curveWidth) +& " --curve-style=" +& intString(curveStyle) +& " --legend-position=\"" +& legendPosition +& " --footer=\"" +& footer +& "\"";
str3 = "--filename=\"" +& filename +& "\" --title=\"" +& title +& "\" --grid=" +& gridStr +& " --plotAll --logx=" +& boolString(logX) +& " --logy=" +& boolString(logY) +& " --xlabel=\"" +& xLabel +& "\" --ylabel=\"" +& yLabel +& "\" --xrange=" +& realString(x1) +& ":" +& realString(x2) +& " --yrange=" +& realString(y1) +& ":" +& realString(y2) +& " --new-window=" +& boolString(externalWindow) +& " --curve-width=" +& realString(curveWidth) +& " --curve-style=" +& intString(curveStyle) +& " --legend-position=\"" +& legendPosition +& " --footer=\"" +& footer +& "\"";
call = stringAppendList({"\"",str2,"\""," ",str3});
0 = System.spawnCall(str2, call);
then
Expand All @@ -2715,7 +2715,7 @@ algorithm
Values.BOOL(_),
Values.STRING(filename),
Values.STRING(title),
Values.BOOL(grid),
Values.STRING(gridStr),
Values.BOOL(logX),
Values.BOOL(logY),
Values.STRING(xLabel),
Expand All @@ -2738,7 +2738,6 @@ algorithm
// create absolute path of simulation result file
str1 = System.pwd() +& pd +& filename;
filename = Util.if_(System.regularFileExists(str1), str1, filename);
gridStr = boolString(grid);
logXStr = boolString(logX);
logYStr = boolString(logY);
x1Str = realString(x1);
Expand All @@ -2763,7 +2762,7 @@ algorithm
Values.BOOL(externalWindow),
Values.STRING(filename),
Values.STRING(title),
Values.BOOL(grid),
Values.STRING(gridStr),
Values.BOOL(logX),
Values.BOOL(logY),
Values.STRING(xLabel),
Expand Down Expand Up @@ -2795,7 +2794,7 @@ algorithm
// create the path till OMPlot
str2 = stringAppendList({omhome,pd,"bin",pd,"OMPlot",s1});
// create the list of arguments for OMPlot
str3 = "--filename=\"" +& filename +& "\" --title=\"" +& title +& "\" --grid=" +& boolString(grid) +& " --plot --logx=" +& boolString(logX) +& " --logy=" +& boolString(logY) +& " --xlabel=\"" +& xLabel +& "\" --ylabel=\"" +& yLabel +& "\" --xrange=" +& realString(x1) +& ":" +& realString(x2) +& " --yrange=" +& realString(y1) +& ":" +& realString(y2) +& " --new-window=" +& boolString(externalWindow) +& " --curve-width=" +& realString(curveWidth) +& " --curve-style=" +& intString(curveStyle) +& " --legend-position=\"" +& legendPosition +& " --footer=\"" +& footer +& "\" \"" +& str +& "\"";
str3 = "--filename=\"" +& filename +& "\" --title=\"" +& title +& "\" --grid=" +& gridStr +& " --plot --logx=" +& boolString(logX) +& " --logy=" +& boolString(logY) +& " --xlabel=\"" +& xLabel +& "\" --ylabel=\"" +& yLabel +& "\" --xrange=" +& realString(x1) +& ":" +& realString(x2) +& " --yrange=" +& realString(y1) +& ":" +& realString(y2) +& " --new-window=" +& boolString(externalWindow) +& " --curve-width=" +& realString(curveWidth) +& " --curve-style=" +& intString(curveStyle) +& " --legend-position=\"" +& legendPosition +& " --footer=\"" +& footer +& "\" \"" +& str +& "\"";
call = stringAppendList({"\"",str2,"\""," ",str3});
0 = System.spawnCall(str2, call);
then
Expand All @@ -2808,7 +2807,7 @@ algorithm
Values.BOOL(_),
Values.STRING(filename),
Values.STRING(title),
Values.BOOL(grid),
Values.STRING(gridStr),
Values.BOOL(logX),
Values.BOOL(logY),
Values.STRING(xLabel),
Expand All @@ -2834,7 +2833,6 @@ algorithm
// create absolute path of simulation result file
str1 = System.pwd() +& pd +& filename;
filename = Util.if_(System.regularFileExists(str1), str1, filename);
gridStr = boolString(grid);
logXStr = boolString(logX);
logYStr = boolString(logY);
x1Str = realString(x1);
Expand Down Expand Up @@ -3097,7 +3095,7 @@ algorithm
Values.BOOL(externalWindow),
Values.STRING(filename),
Values.STRING(title),
Values.BOOL(grid),
Values.STRING(gridStr),
Values.BOOL(logX),
Values.BOOL(logY),
Values.STRING(xLabel),
Expand Down Expand Up @@ -3127,7 +3125,7 @@ algorithm
// create the path till OMPlot
str2 = stringAppendList({omhome,pd,"bin",pd,"OMPlot",s1});
// create the list of arguments for OMPlot
str3 = "--filename=\"" +& filename +& "\" --title=\"" +& title +& "\" --grid=" +& boolString(grid) +& " --plotParametric --logx=" +& boolString(logX) +& " --logy=" +& boolString(logY) +& " --xlabel=\"" +& xLabel +& "\" --ylabel=\"" +& yLabel +& "\" --xrange=" +& realString(x1) +& ":" +& realString(x2) +& " --yrange=" +& realString(y1) +& ":" +& realString(y2) +& " --new-window=" +& boolString(externalWindow) +& " --curve-width=" +& realString(curveWidth) +& " --curve-style=" +& intString(curveStyle) +& " --legend-position=\"" +& legendPosition +& " --footer=\"" +& footer +& "\" \"" +& str +& "\"";
str3 = "--filename=\"" +& filename +& "\" --title=\"" +& title +& "\" --grid=" +& gridStr +& " --plotParametric --logx=" +& boolString(logX) +& " --logy=" +& boolString(logY) +& " --xlabel=\"" +& xLabel +& "\" --ylabel=\"" +& yLabel +& "\" --xrange=" +& realString(x1) +& ":" +& realString(x2) +& " --yrange=" +& realString(y1) +& ":" +& realString(y2) +& " --new-window=" +& boolString(externalWindow) +& " --curve-width=" +& realString(curveWidth) +& " --curve-style=" +& intString(curveStyle) +& " --legend-position=\"" +& legendPosition +& " --footer=\"" +& footer +& "\" \"" +& str +& "\"";
call = stringAppendList({"\"",str2,"\""," ",str3});
0 = System.spawnCall(str2, call);
then
Expand All @@ -3141,7 +3139,7 @@ algorithm
Values.BOOL(_),
Values.STRING(filename),
Values.STRING(title),
Values.BOOL(grid),
Values.STRING(gridStr),
Values.BOOL(logX),
Values.BOOL(logY),
Values.STRING(xLabel),
Expand All @@ -3166,7 +3164,6 @@ algorithm
// create absolute path of simulation result file
str1 = System.pwd() +& pd +& filename;
filename = Util.if_(System.regularFileExists(str1), str1, filename);
gridStr = boolString(grid);
logXStr = boolString(logX);
logYStr = boolString(logY);
x1Str = realString(x1);
Expand Down

0 comments on commit 1a6bf90

Please sign in to comment.