X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.fmil.core%2Fnative%2FFMUSimulator%2Fsrc%2Ffmu_control.cpp;h=28e75f74c2b3a4c7dde14119cea95a1be1885902;hb=f6f05cb36bc0b849af8090efac1d549779e2076f;hp=dba9da20edab7b03defb68584249a0e823fbdca3;hpb=4282c2e792b39be912e3db8226c342867c2dc065;p=simantics%2Ffmil.git diff --git a/org.simantics.fmil.core/native/FMUSimulator/src/fmu_control.cpp b/org.simantics.fmil.core/native/FMUSimulator/src/fmu_control.cpp index dba9da2..28e75f7 100644 --- a/org.simantics.fmil.core/native/FMUSimulator/src/fmu_control.cpp +++ b/org.simantics.fmil.core/native/FMUSimulator/src/fmu_control.cpp @@ -354,10 +354,10 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_setStringValue_1 const char *valueChars = env->GetStringUTFChars(value, 0); FMI1 fmi = fmus[id]; if (fmi.version == 1) { - FMI1_CS_SET_INTEGER(fmi.fmu, vr, value != 0, &error); + FMI1_CS_SET_STRING(fmi.fmu, vr, valueChars, &error); } else if (fmi.version == 2) { - FMI2_CS_SET_INTEGER(fmi.fmu, vr, value != 0, &error); + FMI2_CS_SET_STRING(fmi.fmu, vr, valueChars, &error); } env->ReleaseStringUTFChars(value, valueChars); if (!isEmpty(error)) { @@ -693,14 +693,14 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_simulateStep_1 } else if (fmi.version == 2) { returnValue = FMI2_CS_STEP(fmi.fmu, fmi.currentTime, fmi.timeStep, &error); } - if(returnValue != 0) { + if(returnValue == 1) { string message = "Could not simulate step: "; return throwException(env, message += error); } fmi.currentTime += fmi.timeStep; - return 0; + return returnValue; //Pass return value up. 0 is OK, 1 is error, 2 is pending /* const char *fmuId = env->GetStringUTFChars(id, 0);