]> gerrit.simantics Code Review - simantics/fmil.git/blobdiff - org.simantics.fmil.core/src/org/simantics/fmil/core/FMIL.java
Pending status can be returns from FMU to Native C to Java
[simantics/fmil.git] / org.simantics.fmil.core / src / org / simantics / fmil / core / FMIL.java
index 06d1fd2b2b97acf142db5532f2c547337b2f4966..4b1eeaca132386d9e1071b4e6bac3569d25d8325 100644 (file)
@@ -39,6 +39,7 @@ public class FMIL {
      */
     private static int      OK                  = 0;
     private static int      ERROR               = 1;
+    private static int      PENDING                    = 2;
     private static String   UNSATISFIED_LINK    = "Method not found. DLL might not be loaded properly.";
     public static final String TEMP_FMU_DIRECTORY_NAME = "fmil";
     public static String    TEMP_FMU_COMMON_DIRECTORY;
@@ -513,10 +514,11 @@ public class FMIL {
 
             try {
 
-                int ret = simulateStep_(getModelIDNew()); 
-                if(ret != OK)
+                int ret = simulateStep_(getModelIDNew()); //0 is ok, 1 is error, 2 is pending
+                if(ret == PENDING)
+                    LOGGER.warn("Pending status return from FMU. This is not implemented in our Simulator yet!");
+                else if(ret != OK)
                     LOGGER.warn("Function return value != OK, an exception should have been thrown from native code!");
-
             } catch (FMILException e) {
                 throw e;
             } catch (UnsatisfiedLinkError err) {