Skip to content

Commit

Permalink
- updated C# target template
Browse files Browse the repository at this point in the history
  - implemented zero crosing hysteresis, 
  - event triggering math functions, 
  - system metadata class, 
  - nominal attributes, 
  - fixed as attribute, 
  - NLS pre-allocation and nominal attributes initialization
  - when Initial conditions
  - other minor issues
- report an error in function SimCodeUtil.cref2simvar() on failed lookup
- (!!)fixed again a bug that I fixed in rev. 15482 (5th march 2013)
  the generated library directories in makefiles should have this order:
  /Resources/Library/mingw32, /Resources/Library/win32, /Resources/Library/  
  see more comment in rev. 15482
- added ModelicaStrings_length as known external function to ceval
- nonlinearSolverHybrd.c ... a copy-paste typo fix
- CodegenC.tpl 
  - some code(style) refactorings 
  - template functionXXX_systems() fix to handle also empty cases when compiling with an ANSI prudent compiler.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16174 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
pavolpr committed May 31, 2013
1 parent 71e5071 commit 45d2e34
Show file tree
Hide file tree
Showing 5 changed files with 1,257 additions and 607 deletions.
11 changes: 7 additions & 4 deletions Compiler/BackEnd/SimCodeUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ algorithm
DAE.ComponentRef cref, badcref;
SimCode.SimVar sv;
SimCode.HashTableCrefToSimVar crefToSimVarHT;
String errstr;

case (cref, SimCode.SIMCODE(crefToSimVarHT = crefToSimVarHT) )
equation
Expand All @@ -247,8 +248,8 @@ algorithm
case (cref, _)
equation
badcref = ComponentReference.makeCrefIdent("ERROR_cref2simvar_failed", DAE.T_REAL_DEFAULT, {});
//errstr = "Template did not find the simulation variable for "+& ComponentReference.printComponentRefStr(cref) +& ". ";
//Error.addMessage(Error.INTERNAL_ERROR, {errstr});
errstr = "Template did not find the simulation variable for "+& ComponentReference.printComponentRefStr(cref) +& ". ";
Error.addMessage(Error.INTERNAL_ERROR, {errstr});
then
SimCode.SIMVAR(badcref, BackendDAE.STATE(1,NONE()), "", "", "", -1, NONE(), NONE(), NONE(), NONE(), false, DAE.T_REAL_DEFAULT, false, NONE(), SimCode.NOALIAS(), DAE.emptyElementSource, SimCode.INTERNAL(), NONE(), {});
end matchcontinue;
Expand Down Expand Up @@ -9003,9 +9004,10 @@ algorithm
platform1 = System.openModelicaPlatform();
platform2 = System.modelicaPlatform();
isLinux = stringEq("linux",System.os());
//please, take care about ordering these libraries, the most specific should go first (in reverse here)
libs = generateExtFunctionLibraryDirectoryFlags2(true, str, isLinux, libs);
libs = generateExtFunctionLibraryDirectoryFlags2(not stringEq(platform1,""), str +& "/" +& platform1, isLinux, libs);
libs = generateExtFunctionLibraryDirectoryFlags2(not stringEq(platform2,""), str +& "/" +& platform2, isLinux, libs);
libs = generateExtFunctionLibraryDirectoryFlags2(not stringEq(platform1,""), str +& "/" +& platform1, isLinux, libs);
then libs;
case (_, _, _, libs)
equation
Expand All @@ -9014,9 +9016,10 @@ algorithm
platform1 = System.openModelicaPlatform();
platform2 = System.modelicaPlatform();
isLinux = stringEq("linux",System.os());
//please, take care about ordering these libraries, the most specific should go first (in reverse here)
libs = generateExtFunctionLibraryDirectoryFlags2(true, str, isLinux, libs);
libs = generateExtFunctionLibraryDirectoryFlags2(not stringEq(platform1,""), str +& "/" +& platform1, isLinux, libs);
libs = generateExtFunctionLibraryDirectoryFlags2(not stringEq(platform2,""), str +& "/" +& platform2, isLinux, libs);
libs = generateExtFunctionLibraryDirectoryFlags2(not stringEq(platform1,""), str +& "/" +& platform1, isLinux, libs);
then libs;
else inLibs;
end matchcontinue;
Expand Down

0 comments on commit 45d2e34

Please sign in to comment.