diff --git a/Compiler/susan_codegen/SimCode/CodegenC.tpl b/Compiler/susan_codegen/SimCode/CodegenC.tpl index 7c8a87aa6e5..dc7ac293547 100644 --- a/Compiler/susan_codegen/SimCode/CodegenC.tpl +++ b/Compiler/susan_codegen/SimCode/CodegenC.tpl @@ -1809,6 +1809,11 @@ case eqn as SES_ARRAY_CALL_ASSIGN(__) then <%preExp%> copy_real_array_data_mem(&<%expPart%>, &<%cref(eqn.componentRef)%>);<%inlineArray(context,expPart,eqn.componentRef)%> >> + case "string" then + << + <%preExp%> + copy_string_array_data_mem(&<%expPart%>, &<%cref(eqn.componentRef)%>);<%inlineArray(context,expPart,eqn.componentRef)%> + >> else error(sourceInfo(), 'No runtime support for this sort of array call: <%printExpStr(eqn.exp)%>') %> <%endModelicaLine()%> diff --git a/Compiler/susan_codegen/SimCode/CodegenFMU.tpl b/Compiler/susan_codegen/SimCode/CodegenFMU.tpl index 1d612ae2ab7..027fcadbec0 100644 --- a/Compiler/susan_codegen/SimCode/CodegenFMU.tpl +++ b/Compiler/susan_codegen/SimCode/CodegenFMU.tpl @@ -1020,9 +1020,10 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula let compilecmds = getPlatformString2(makefileParams.platform, fileNamePrefix, dirExtra, libsPos1, libsPos2, makefileParams.omhome) << # Makefile generated by OpenModelica - - # Simulations use -O2 by default - SIM_OR_DYNLOAD_OPT_LEVEL=-O2 + + # Simulation of the fmu with dymola does not work + # with inline-small-functions + SIM_OR_DYNLOAD_OPT_LEVEL=-O #-O2 -fno-inline-small-functions CC=<%makefileParams.ccompiler%> CXX=<%makefileParams.cxxcompiler%> LINK=<%makefileParams.linker%> diff --git a/SimulationRuntime/fmi/import/fmuWrapper.c b/SimulationRuntime/fmi/import/fmuWrapper.c index a25ce7bd2c2..7f85f40247b 100644 --- a/SimulationRuntime/fmi/import/fmuWrapper.c +++ b/SimulationRuntime/fmi/import/fmuWrapper.c @@ -8,9 +8,8 @@ /* Define for Debuging */ -/* -#define _PRINT_OUT__ -#define _DEBUG_ +/*#define _PRINT_OUT__ + #define _DEBUG_ */ #define BUFSIZE 4096 diff --git a/SimulationRuntime/fmi/import/moGenerator.c b/SimulationRuntime/fmi/import/moGenerator.c index 3cf0aa3bc6a..34508e14503 100644 --- a/SimulationRuntime/fmi/import/moGenerator.c +++ b/SimulationRuntime/fmi/import/moGenerator.c @@ -637,6 +637,7 @@ fmiAlias getFMIAlias(ScalarVariable* sv) { void instScalarVariable(ModelDescription* md, fmiScalarVariable* list) { int i; unsigned int len; + char* tempDesc; if (md->modelVariables) { for (i = 0; md->modelVariables[i]; i++) { list[i].name = getName(md->modelVariables[i]); @@ -644,8 +645,19 @@ void instScalarVariable(ModelDescription* md, fmiScalarVariable* list) { list[i].flatName = (char*) calloc(len + 1, sizeof(char)); strcpy(list[i].flatName, list[i].name); charReplace(list[i].flatName, len, '.', '_'); + charReplace(list[i].flatName, len, '[', '_'); + charReplace(list[i].flatName, len, ']', '_'); + charReplace(list[i].flatName, len, ',', '_'); list[i].vr = getValueReference(md->modelVariables[i]); list[i].description = getDescription(md, md->modelVariables[i]); + if (list[i].description != NULL){ + len = strlen(list[i].description); + tempDesc = (char*) calloc(len + 1, sizeof(char)); + memcpy(tempDesc, list[i].description, len); + charReplace(tempDesc, len, 0x22, 0x27); + list[i].description = (const char *) tempDesc; + } + //tempDesc = (char*) calloc(len + 1, sizeof(char)); #ifdef _DEBUG_ printf("#### Description of sv %s, %s, value reference: %d\n",list[i].name, list[i].description,list[i].vr ); @@ -1359,6 +1371,7 @@ void blockcodegen(fmuModelDescription* fmuMD, const char* decompPath, fprintf(pfile, "%d};\n", tmpReal->vr); } } + if (noRealParam > 0) { tmpRealParam = pntRealParam; fprintf(pfile, "\tparameter Real realVParam[%d];\n", noRealParam); diff --git a/SimulationRuntime/fmi/import/xmlparser.c b/SimulationRuntime/fmi/import/xmlparser.c index bf5394aa511..13c88569b2b 100644 --- a/SimulationRuntime/fmi/import/xmlparser.c +++ b/SimulationRuntime/fmi/import/xmlparser.c @@ -587,6 +587,7 @@ static void XMLCALL endElement(void *context, const char *elm) { case elm_RealType: case elm_IntegerType: case elm_BooleanType: + case elm_StringType: case elm_EnumerationType: break; default: @@ -637,6 +638,7 @@ static void XMLCALL endElement(void *context, const char *elm) { case elm_Real: case elm_Integer: case elm_Boolean: + case elm_String: case elm_Enumeration: break; default: