Skip to content

Commit

Permalink
Partial fixes for #1365
Browse files Browse the repository at this point in the history
- link properly to get tables working.
- display the name of the model in the SimulationResult record when failing.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7212 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Nov 26, 2010
1 parent 2bdc23d commit 858bba6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Compiler/CevalScript.mo
Expand Up @@ -677,7 +677,8 @@ algorithm
equation
omhome = Settings.getInstallationDirectoryPath() "simulation fail for some other reason than OPENMODELICAHOME not being set." ;
errorStr = Error.printMessagesStr();
res = stringAppendList({"Simulation failed.\n",errorStr});
str = Absyn.pathString(className);
res = stringAppendList({"Simulation failed for model: ", str, "\n", errorStr});
simValue = createSimulationResultFailure(res);
then
(cache,simValue,st);
Expand All @@ -686,7 +687,8 @@ algorithm
expLst = DAE.CODE(Absyn.C_TYPENAME(className),_)::_),
(st as Interactive.SYMBOLTABLE(ast = p,explodedAst = sp,instClsLst = ic,lstVarVal = iv,compiledFunctions = cf)),msg)
equation
simValue = createSimulationResultFailure("Simulation Failed. Environment variable OPENMODELICAHOME not set.");
str = Absyn.pathString(className);
simValue = createSimulationResultFailure("Simulation failed for model: " +& str +& "\nEnvironment variable OPENMODELICAHOME not set.");
then
(cache,simValue,st);

Expand Down
6 changes: 5 additions & 1 deletion Compiler/susan_codegen/SimCode/SimCodeC.tpl
Expand Up @@ -2332,7 +2332,9 @@ template simulationFunctionsFile(String filePrefix, list<Function> functions)
extern "C" {
<%functionBodies(functions)%>
}

>>
/* adpro: leave a newline at the end of file to get rid of warnings! */
end simulationFunctionsFile;

template recordsFile(String filePrefix, list<RecordDeclaration> recordDecls)
Expand All @@ -2342,7 +2344,9 @@ template recordsFile(String filePrefix, list<RecordDeclaration> recordDecls)
/* Additional record code for <%filePrefix%> generated by the OpenModelica Compiler <%getVersionNr()%>. */
#include "meta_modelica.h"
<%recordDecls |> rd => recordDeclaration(rd) ;separator="\n"%>

>>
/* adpro: leave a newline at the end of file to get rid of warnings! */
end recordsFile;

template simulationFunctionsHeaderFile(String filePrefix, list<Function> functions, list<String> includes, list<RecordDeclaration> recordDecls)
Expand Down Expand Up @@ -2389,7 +2393,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__)) then

.PHONY: <%fileNamePrefix%>
<%fileNamePrefix%>: <%fileNamePrefix%>.cpp <%fileNamePrefix%>_functions.cpp <%fileNamePrefix%>_functions.h <%fileNamePrefix%>_records.c
<%\t%> $(CXX) $(CFLAGS) -I. -o <%fileNamePrefix%>$(EXEEXT) <%fileNamePrefix%>.cpp <%fileNamePrefix%>_functions.cpp <%dirExtra%> <%libsPos1%> -lsim $(LDFLAGS) -lf2c -linteractive $(SENDDATALIBS) <%libsPos2%> <%fileNamePrefix%>_records.c
<%\t%> $(CXX) $(CFLAGS) -I. -o <%fileNamePrefix%>$(EXEEXT) <%fileNamePrefix%>.cpp <%fileNamePrefix%>_functions.cpp <%dirExtra%> <%libsPos1%> <%libsPos2%> -lsim -linteractive $(SENDDATALIBS) $(LDFLAGS) -lf2c <%fileNamePrefix%>_records.c
>>
end simulationMakefile;

Expand Down

0 comments on commit 858bba6

Please sign in to comment.