Skip to content

Commit

Permalink
*Added static Qt libraries for MinGW
Browse files Browse the repository at this point in the history
*The MinGW version of Omc is now built with static Qt libraries 
*Added some Qt header files
*Added range options to plot2/plotParametric2
*Removed some unnecessary files.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2931 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Henrik Eriksson committed Sep 25, 2007
1 parent 390b0b7 commit d8f64dc
Show file tree
Hide file tree
Showing 12 changed files with 419 additions and 180 deletions.
43 changes: 29 additions & 14 deletions Compiler/Ceval.mo
Expand Up @@ -1921,12 +1921,17 @@ algorithm
compiledFunctions = cf)),msg)
equation
(cache,executable,method_str,st,_) = buildModel(cache,env, exp, st_1, msg) "Build and simulate model" ;
// print("simulate1\n");
// _ = System.addToEnv("PATH", System.readEnv("OPENMODELICAHOME") +& "/lib");
print(System.readEnv("PATH"));
print("\n\n");

cit = winCitation();
pd = System.pathDelimiter();
executableSuffixedExe = stringAppend(executable, ".exe");
sim_call = Util.stringAppendList(
{cit,executableSuffixedExe,cit," > output.log 2>&1"});
//print(sim_call);
// print(sim_call);
0 = System.systemCall(sim_call);
result_file = Util.stringAppendList({executable,"_res.plt"});
simValue = Values.RECORD(Absyn.IDENT("SimulationResult"),
Expand Down Expand Up @@ -2187,14 +2192,15 @@ algorithm
expLst = {
Exp.CODE(Absyn.C_TYPENAME(className),_),
Exp.ARRAY(array = vars),
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points)
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points), xRange, yRange
}),
(st as Interactive.SYMBOLTABLE(
ast = p,explodedAst = sp,instClsLst = ic,
lstVarVal = iv,compiledFunctions = cf,
loadedFiles = lf)),msg)
local
Integer res;
Exp.Exp xRange, yRange;
list<Exp.Exp> vars;
String interpolation, title, xLabel, yLabel;
Boolean legend, grid, logX, logY, points;
Expand All @@ -2208,7 +2214,7 @@ algorithm

value = System.readPtolemyplotDataset(filename, vars_2, 0);

res = Values.sendPtolemyplotDataset(value, vars_2, "Plot by OpenModelica", interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points);
res = Values.sendPtolemyplotDataset(value, vars_2, "Plot by OpenModelica", interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points, Exp.printExpStr(xRange), Exp.printExpStr(yRange));

then
(cache,Values.BOOL(true),st);
Expand All @@ -2219,7 +2225,7 @@ algorithm
expLst = {
Exp.CODE(Absyn.C_TYPENAME(className),_),
Exp.ARRAY(array = vars),
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points)
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points), xRange, yRange
}),
(st as Interactive.SYMBOLTABLE(
ast = p,explodedAst = sp,instClsLst = ic,
Expand All @@ -2228,6 +2234,7 @@ algorithm

local
Integer res;
Exp.Exp xRange, yRange;
list<Exp.Exp> vars;
String interpolation, title, xLabel, yLabel;
Boolean legend, grid, logX, logY, points;
Expand All @@ -2248,14 +2255,15 @@ algorithm
Exp.CALL(
path = Absyn.IDENT(name = "plot2"),
expLst = {Exp.ARRAY(array = vars),
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points)
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points), xRange, yRange
}),
(st as Interactive.SYMBOLTABLE(
ast = p,explodedAst = sp,instClsLst = ic,
lstVarVal = iv,compiledFunctions = cf,
loadedFiles = lf)),msg)
local
Integer res;
Exp.Exp xRange, yRange;
list<Exp.Exp> vars;
String interpolation, title, xLabel, yLabel;
Boolean legend, logX, logY, points;
Expand All @@ -2267,7 +2275,7 @@ algorithm
(cache,Values.RECORD(_,{Values.STRING(filename)},_),_) = ceval(cache,env,
Exp.CREF(Exp.CREF_IDENT("currentSimulationResult",{}),Exp.OTHER()), true, SOME(st), NONE, msg);
value = System.readPtolemyplotDataset(filename, vars_2, 0);
res = Values.sendPtolemyplotDataset(value, vars_2, "Plot by OpenModelica", interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points);
res = Values.sendPtolemyplotDataset(value, vars_2, "Plot by OpenModelica", interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points, Exp.printExpStr(xRange), Exp.printExpStr(yRange));

then
(cache,Values.BOOL(true),st);
Expand All @@ -2276,14 +2284,15 @@ algorithm
Exp.CALL(
path = Absyn.IDENT(name = "plot2"),
expLst = {Exp.ARRAY(array = vars),
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points)
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points), xRange, yRange
}),
(st as Interactive.SYMBOLTABLE(
ast = p,explodedAst = sp,instClsLst = ic,
lstVarVal = iv,compiledFunctions = cf,
loadedFiles = lf)),msg)
local
Integer res;
Exp.Exp xRange, yRange;
list<Exp.Exp> vars;
String interpolation, title, xLabel, yLabel;
Boolean legend, logX, logY, points;
Expand All @@ -2303,14 +2312,15 @@ algorithm
Exp.CALL(
path = Absyn.IDENT(name = "plot2"),
expLst = {Exp.ARRAY(array = vars),
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points)
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points), xRange, yRange
}),
(st as Interactive.SYMBOLTABLE(
ast = p,explodedAst = sp,instClsLst = ic,
lstVarVal = iv,compiledFunctions = cf,
loadedFiles = lf)),msg)
local
Integer res;
Exp.Exp xRange, yRange;
list<Exp.Exp> vars;
String interpolation, title, xLabel, yLabel;
Boolean legend, grid, logX, logY, points;
Expand All @@ -2328,14 +2338,15 @@ algorithm
Exp.CALL(
path = Absyn.IDENT(name = "plot2"),
expLst = {Exp.ARRAY(array = vars),
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points)
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points), xRange, yRange
}),
(st as Interactive.SYMBOLTABLE(
ast = p,explodedAst = sp,instClsLst = ic,
lstVarVal = iv,compiledFunctions = cf,
loadedFiles = lf)),msg)
local
Integer res;
Exp.Exp xRange, yRange;
list<Exp.Exp> vars;
String interpolation, title, xLabel, yLabel;
Boolean legend, grid, logX, logY, points;
Expand Down Expand Up @@ -2493,7 +2504,7 @@ algorithm
Exp.CALL(path = Absyn.IDENT(name = "plotParametric2"),
expLst = { Exp.CODE(Absyn.C_TYPENAME(className),_),
Exp.ARRAY(array = vars),
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points)
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points), xRange, yRange
}),

(st as Interactive.SYMBOLTABLE(
Expand All @@ -2502,6 +2513,7 @@ algorithm
loadedFiles = lf)),msg)
local
Integer res;
Exp.Exp xRange, yRange;
list<Exp.Exp> vars;
String interpolation, title, xLabel, yLabel;
Boolean legend, grid, logX, logY, points;
Expand All @@ -2521,15 +2533,15 @@ algorithm
pd = System.pathDelimiter();
plotCmd = Util.stringAppendList({cit,omhome_1,pd,"bin",pd,"doPlot",cit});
tmpPlotFile = Util.stringAppendList({pwd,pd,"tmpPlot.plt"});
res = Values.sendPtolemyplotDataset(value, vars_1, "Plot by OpenModelica", interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points);
res = Values.sendPtolemyplotDataset(value, vars_1, "Plot by OpenModelica", interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points, Exp.printExpStr(xRange), Exp.printExpStr(yRange));
then
(cache,Values.BOOL(true),st);

//plotParametric2(x,y,interpolation)
case (cache,env,
Exp.CALL(path = Absyn.IDENT(name = "plotParametric2"),
expLst = {Exp.ARRAY(array = vars),
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points)
Exp.SCONST(string = interpolation), Exp.SCONST(string = title), Exp.BCONST(bool = legend), Exp.BCONST(bool = grid), Exp.BCONST(bool = logX), Exp.BCONST(bool = logY), Exp.SCONST(string = xLabel), Exp.SCONST(string = yLabel), Exp.BCONST(bool = points), xRange, yRange

}),
(st as Interactive.SYMBOLTABLE(
Expand All @@ -2538,6 +2550,7 @@ algorithm
loadedFiles = lf)),msg)
local
Integer res;
Exp.Exp xRange, yRange;
list<Exp.Exp> vars;
String interpolation, title, xLabel, yLabel;
Boolean legend, grid, logX, logY, points;
Expand All @@ -2550,7 +2563,7 @@ algorithm
(cache,Values.RECORD(_,{Values.STRING(filename)},_),_) = ceval(cache,env,
Exp.CREF(Exp.CREF_IDENT("currentSimulationResult",{}),Exp.OTHER()), true, SOME(st), NONE, msg);
value = System.readPtolemyplotDataset(filename, vars_1, 0);
res = Values.sendPtolemyplotDataset(value, vars_1, "Plot by OpenModelica", interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points);
res = Values.sendPtolemyplotDataset(value, vars_1, "Plot by OpenModelica", interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points, Exp.printExpStr(xRange), Exp.printExpStr(yRange));

then
(cache,Values.BOOL(true),st);
Expand Down Expand Up @@ -3042,7 +3055,7 @@ algorithm
Exp.Exp fileprefix;
Env.Cache cache;
case (cache,env,className,(st as Interactive.SYMBOLTABLE(ast = p,explodedAst = sp,instClsLst = ic,lstVarVal = iv,compiledFunctions = cf)),msg,fileprefix) /* mo file directory */
equation
equation
(cache,filenameprefix) = extractFilePrefix(cache,env, fileprefix, st, msg);
p_1 = SCode.elaborate(p);
(cache,dae_1,env) = Inst.instantiateClass(cache,p_1, className);
Expand Down Expand Up @@ -3359,6 +3372,7 @@ algorithm
makefilename = generateMakefilename(filenameprefix);
compileModel(filenameprefix, libs, file_dir);
_ = System.cd(oldDir);

// s_call = Util.stringAppendList({"make -f ",cname_str, ".makefile\n"});
then
(cache,filenameprefix,method_str,st,init_filename);
Expand Down Expand Up @@ -3441,6 +3455,7 @@ algorithm
// If compileCommand not set, use $OPENMODELICAHOME\bin\Compile
case (fileprefix,libs,file_dir)
equation
print("compileModel");
"" = Settings.getCompileCommand();
pd = System.pathDelimiter();
omhome = Settings.getInstallationDirectoryPath();
Expand Down
2 changes: 2 additions & 0 deletions Compiler/SimCodegen.mo
Expand Up @@ -153,6 +153,7 @@ public function generateMakefile "function: generateMakefile
omhome,"/lib/\""," -I. -I\"",omhome,"/include/\" "," -lsim -lc_runtime -lf2c ",
libs_1," ${MODELICAUSERLFLAGS}\n"}) "\".exe\" is needed for a class that is in a package." ;
System.writeFile(filename, str);

then
();
case (filename,cname,libs,file_dir)
Expand All @@ -167,6 +168,7 @@ public function generateMakefile "function: generateMakefile
omhome,"/lib/\""," -L\"",file_dir,"\""," -I. -I\"",omhome,"/include/\" ",
" -I\"",file_dir,"\""," -lsim -lc_runtime -lf2c ",libs_1," ${MODELICAUSERLFLAGS}\n"}) "\".exe\" is needed for a class that is in a package." ;
System.writeFile(filename, str);

then
();
end matchcontinue;
Expand Down

0 comments on commit d8f64dc

Please sign in to comment.