]> gerrit.simantics Code Review - simantics/fmil.git/commitdiff
Fixed newly created errors in FMIL native interfaces. 37/2237/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Tue, 25 Sep 2018 14:46:23 +0000 (17:46 +0300)
committerReino Ruusu <reino.ruusu@semantum.fi>
Tue, 25 Sep 2018 14:46:23 +0000 (17:46 +0300)
gitlab #7

* Missing method declarations from header file. Resulted in methods
exposed with C++ decorations by the DLL.
* Copy-paste errors in setStringValue_().

Change-Id: I54a3957b61e9ec3a152b36596d70440cb5d2947a

org.simantics.fmil.core/native/FMUSimulator/include/org_simantics_fmil_FMILJNI.h
org.simantics.fmil.core/native/FMUSimulator/src/fmu_control.cpp
org.simantics.fmil.linux64/libraries/debug/libFMUSimulator.so
org.simantics.fmil.linux64/libraries/libFMUSimulator.so
org.simantics.fmil.win32/libraries/FMUSimulator.dll
org.simantics.fmil.win64/libraries/FMUSimulator.dll

index 67e18e3f62ec2ce86ffd884d75a447b7511cf350..cccabf7947e99a462e8b11583f97b82be613f40a 100644 (file)
@@ -1,9 +1,9 @@
 /* DO NOT EDIT THIS FILE - it is machine generated */
 #include <jni.h>
-/* Header for class org_simantics_fmu_FMUControlJNI */
+/* Header for class org_simantics_fmil_core_FMIL */
 
-#ifndef _Included_org_simantics_fmu_FMUControlJNI
-#define _Included_org_simantics_fmu_FMUControlJNI
+#ifndef _Included_org_simantics_fmil_core_FMIL
+#define _Included_org_simantics_fmil_core_FMIL
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -12,7 +12,7 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_loadFMUFile_1
   (JNIEnv *, jobject, jstring, jstring);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    setStepLength_
  * Signature: (Ljava/lang/String;D)I
  */
@@ -20,7 +20,7 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_setStepLength_1
   (JNIEnv *, jobject, jint, jdouble);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    instantiateSimulation_
  * Signature: (Ljava/lang/String;)I
  */
@@ -28,7 +28,7 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_instantiateSimulation_1
   (JNIEnv *, jobject, jint);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    initializeSimulation_
  * Signature: (Ljava/lang/String;)I
  */
@@ -36,7 +36,7 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_initializeSimulation_1
   (JNIEnv *, jobject, jint);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    subscribe_
  * Signature: (Ljava/lang/String;[Ljava/lang/String;I)I
  */
@@ -44,31 +44,39 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_subscribe_1
   (JNIEnv *, jobject, jint, jintArray);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    setRealValue_
- * Signature: (Ljava/lang/String;Ljava/lang/String;D)I
+ * Signature: (IID)I
  */
 JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_setRealValue_1
   (JNIEnv *, jobject, jint, jint, jdouble);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    setIntegerValue_
- * Signature: (Ljava/lang/String;Ljava/lang/String;I)I
+ * Signature: (III)I
  */
 JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_setIntegerValue_1
-  (JNIEnv *, jobject, jstring, jstring, jint);
+  (JNIEnv *, jobject, jint, jint, jint);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    setBooleanValue_
- * Signature: (Ljava/lang/String;Ljava/lang/String;Z)I
+ * Signature: (IIZ)I
  */
 JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_setBooleanValue_1
-  (JNIEnv *, jobject, jstring, jstring, jboolean);
+  (JNIEnv *, jobject, jint, jint, jboolean);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
+ * Method:    setStringValue_
+ * Signature: (IILjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_setStringValue_1
+  (JNIEnv *, jobject, jint, jint, jstring);
+
+/*
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    setTime_
  * Signature: (Ljava/lang/String;D)I
  */
@@ -76,7 +84,7 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_setTime_1
   (JNIEnv *, jobject, jstring, jdouble);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    simulateStep_
  * Signature: (Ljava/lang/String;)I
  */
@@ -84,7 +92,7 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_simulateStep_1
   (JNIEnv *, jobject, jint);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    getSubscribedResults_
  * Signature: (Ljava/lang/String;[D)[D
  */
@@ -92,7 +100,7 @@ JNIEXPORT jdoubleArray JNICALL Java_org_simantics_fmil_core_FMIL_getSubscribedRe
   (JNIEnv *, jobject, jint, jdoubleArray);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    unloadFMU_
  * Signature: (Ljava/lang/String;)I
  */
@@ -100,7 +108,7 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_unloadFMU_1
   (JNIEnv *, jobject, jint);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    isInitialized_
  * Signature: (Ljava/lang/String;)Z
  */
@@ -108,7 +116,7 @@ JNIEXPORT jboolean JNICALL Java_org_simantics_fmil_core_FMIL_isInitialized_1
   (JNIEnv *, jobject, jstring);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    getTime_
  * Signature: (Ljava/lang/String;)D
  */
@@ -116,7 +124,7 @@ JNIEXPORT jdouble JNICALL Java_org_simantics_fmil_core_FMIL_getTime_1
   (JNIEnv *, jobject, jint);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    getAllVariables_
  * Signature: (Ljava/lang/String;)[Ljava/lang/String;
  */
@@ -154,7 +162,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simantics_fmil_core_FMIL_getAllDeclaredT
   (JNIEnv *, jobject, jint);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    filterVariables_
  * Signature: (Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;
  */
@@ -162,7 +170,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simantics_fmil_core_FMIL_filterVariables
   (JNIEnv *, jobject, jstring, jstring);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    getRealValue_
  * Signature: (Ljava/lang/String;Ljava/lang/String;)D
  */
@@ -170,28 +178,28 @@ JNIEXPORT jdouble JNICALL Java_org_simantics_fmil_core_FMIL_getRealValue_1
   (JNIEnv *, jobject, jint, jint);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    getStringValue_
  * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
  */
 JNIEXPORT jstring JNICALL Java_org_simantics_fmil_core_FMIL_getStringValue_1
-  (JNIEnv *, jobject, jstring, jstring);
+  (JNIEnv *, jobject, jint, jint);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    getIntegerValue_
  * Signature: (Ljava/lang/String;Ljava/lang/String;)I
  */
 JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_getIntegerValue_1
-  (JNIEnv *, jobject, jstring, jstring);
+  (JNIEnv *, jobject, jint, jint);
 
 /*
- * Class:     org_simantics_fmu_FMUControlJNI
+ * Class:     org_simantics_fmil_core_FMIL
  * Method:    getBooleanValue_
  * Signature: (Ljava/lang/String;Ljava/lang/String;)Z
  */
 JNIEXPORT jboolean JNICALL Java_org_simantics_fmil_core_FMIL_getBooleanValue_1
-  (JNIEnv *, jobject, jstring, jstring);
+  (JNIEnv *, jobject, jint, jint);
 
 #ifdef __cplusplus
 }
index dba9da20edab7b03defb68584249a0e823fbdca3..ae86d2b047c387e8698a3f6037a1cf4db42fd66c 100644 (file)
@@ -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)) {
index d3a90978ef05665e93d8da3048df7880be3d2600..acd2b5058cbd466bb55d9e2c74d770eeee4eb85c 100644 (file)
Binary files a/org.simantics.fmil.linux64/libraries/debug/libFMUSimulator.so and b/org.simantics.fmil.linux64/libraries/debug/libFMUSimulator.so differ
index 2ad0e961cbfae9b1316b8e11ce18baaab5ef842a..d244670fc010149057d77e4baaab6cb192bf9646 100644 (file)
Binary files a/org.simantics.fmil.linux64/libraries/libFMUSimulator.so and b/org.simantics.fmil.linux64/libraries/libFMUSimulator.so differ
index 6a4486e59e4136fc12221dc303743934ebf30843..23d5a23caa8a1b51d550ccd3f00acab73da61047 100644 (file)
Binary files a/org.simantics.fmil.win32/libraries/FMUSimulator.dll and b/org.simantics.fmil.win32/libraries/FMUSimulator.dll differ
index e369002111c14fba134e7b68f7a0c78848e35fe4..9e12f65c50f93b4e83c89abfd48e108ebcac6c80 100644 (file)
Binary files a/org.simantics.fmil.win64/libraries/FMUSimulator.dll and b/org.simantics.fmil.win64/libraries/FMUSimulator.dll differ