Skip to content

Commit

Permalink
- Make plot3() match plot() API
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@8514 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Apr 6, 2011
1 parent 1fbab5e commit a8f22b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions Compiler/FrontEnd/ModelicaBuiltin.mo
Expand Up @@ -1115,10 +1115,8 @@ function plot3 "Launches a plot window using OMPlot. Returns true on success.
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.";
input String yLabel := "" "This text will be used as the vertical label in the diagram.";
input Real xRange1 := 0.0 "Determines the horizontal interval that is visible in the diagram. {0,0} will select a suitable range.";
input Real xRange2 := 0.0 "Determines the horizontal interval that is visible in the diagram. {0,0} will select a suitable range.";
input Real yRange1 := 0.0 "Determines the vertical interval that is visible in the diagram. {0,0} will select a suitable range.";
input Real yRange2 := 0.0 "Determines the vertical interval that is visible in the diagram. {0,0} will select a suitable range.";
input Real xRange[2] := {0.0,0.0} "Determines the horizontal interval that is visible in the diagram. {0,0} will select a suitable range.";
input Real yRange[2] := {0.0,0.0} "Determines the vertical interval that is visible in the diagram. {0,0} will select a suitable range.";
output Boolean success "Returns true on success";
external "builtin";
end plot3;
Expand Down
10 changes: 4 additions & 6 deletions Compiler/Script/CevalScript.mo
Expand Up @@ -656,7 +656,7 @@ algorithm
Absyn.ComponentRef cr_1;
Integer size,length,resI,timeStampI,i,n;
list<String> vars_1,vars_2,args,strings,strVars,strs,visvars;
Real t1,t2,time,timeTotal,timeSimulation,timeStamp,val;
Real t1,t2,time,timeTotal,timeSimulation,timeStamp,val,x1,x2,y1,y2;
Interactive.InteractiveStmts istmts;
Boolean bval, b, externalWindow, legend, grid, logX, logY, points, gcc_res, omcfound, rm_res, touch_res, uname_res, extended, insensitive;
Env.Cache cache;
Expand Down Expand Up @@ -1580,10 +1580,8 @@ algorithm
Values.BOOL(logY),
Values.STRING(xLabel),
Values.STRING(yLabel),
xRange1,
xRange2,
yRange1,
yRange2
Values.ARRAY(valueLst={Values.REAL(x1),Values.REAL(x2)}),
Values.ARRAY(valueLst={Values.REAL(y1),Values.REAL(y2)})
},
st,msg)
equation
Expand All @@ -1603,7 +1601,7 @@ algorithm
// create the path till OMPlot
str2 = stringAppendList({omhome,pd,"bin",pd,"OMPlot",s1});
// create the list of arguments for OMPlot
str3 = "\"" +& filename +& "\" \"" +& title +& "\" \"" +& boolString(legend) +& "\" \"" +& boolString(grid) +& "\" \"" +& plotType +& "\" \"" +& boolString(logX) +& "\" \"" +& boolString(logY) +& "\" \"" +& xLabel +& "\" \"" +& yLabel +& "\" \"" +& ValuesUtil.valString(xRange1) +& "\" \"" +& ValuesUtil.valString(xRange2) +& "\" \"" +& ValuesUtil.valString(yRange1) +& "\" \"" +& ValuesUtil.valString(yRange2) +& "\" \"" +& str +& "\" -ew \"" +& boolString(externalWindow) +& "\"";
str3 = "\"" +& filename +& "\" \"" +& title +& "\" \"" +& boolString(legend) +& "\" \"" +& boolString(grid) +& "\" \"" +& plotType +& "\" \"" +& boolString(logX) +& "\" \"" +& boolString(logY) +& "\" \"" +& xLabel +& "\" \"" +& yLabel +& "\" \"" +& realString(x1) +& "\" \"" +& realString(x2) +& "\" \"" +& realString(y1) +& "\" \"" +& realString(y2) +& "\" \"" +& str +& "\" -ew \"" +& boolString(externalWindow) +& "\"";
call = str2 +& " " +& str3;

_ = System.spawnCall(str2, call);
Expand Down

0 comments on commit a8f22b2

Please sign in to comment.