]> gerrit.simantics Code Review - simantics/fmil.git/blobdiff - org.simantics.fmil/src/org/simantics/fmil/FMIL.java
(refs #6290) Import initial FMI Studio codebase
[simantics/fmil.git] / org.simantics.fmil / src / org / simantics / fmil / FMIL.java
index 70d6028a2c410f5f45697bfb3e816c81da1208dd..1302634970eee16fb7e18ee55a48a7b83c509e3a 100644 (file)
@@ -106,7 +106,11 @@ public class FMIL {
     private String dirName;\r
 \r
        private String[] variableNames;\r
+       private String[] variableDescriptions;\r
        private int[] variableReferences;\r
+       private int[] variableTypes;\r
+       private int[] variableCausalities;\r
+       private int[] variableVariabilities;\r
        private TObjectIntHashMap<String> variableMap = new TObjectIntHashMap<String>();\r
        \r
        private Set<String> subscriptionSet = new HashSet<String>();\r
@@ -583,10 +587,26 @@ public class FMIL {
 \r
     private native String[] getAllVariables_(int id);\r
 \r
-    /**\r
-     * Get all variables in a loaded model\r
-     * @return all variables in a loaded model\r
-     */\r
+    public String[] getAllVariableDescriptions() throws FMILException {\r
+        synchronized(syncObject) {\r
+\r
+            try {\r
+\r
+               if(variableDescriptions == null) {\r
+                       variableDescriptions = getAllVariableDescriptions_(getModelIDNew());\r
+               }\r
+               return variableDescriptions;\r
+\r
+            } catch (UnsatisfiedLinkError err) {\r
+                throw new FMILException(UNSATISFIED_LINK);\r
+            } catch (Exception e) {\r
+                throw new FMILException(e.getMessage());\r
+            }\r
+        }\r
+    }\r
+\r
+    private native String[] getAllVariableDescriptions_(int id);\r
+    \r
     public int[] getAllVariableReferences() throws FMILException {\r
         synchronized(syncObject) {\r
 \r
@@ -606,6 +626,66 @@ public class FMIL {
     }\r
 \r
     private native int[] getAllVariableReferences_(int id, int[] array);\r
+\r
+    public int[] getAllVariableTypes() throws FMILException {\r
+        synchronized(syncObject) {\r
+\r
+            try {\r
+\r
+               if(variableTypes == null) {\r
+                       variableTypes = getAllVariableTypes_(getModelIDNew(), new int[variableNames.length]); \r
+               }\r
+               return variableTypes;\r
+\r
+            } catch (UnsatisfiedLinkError err) {\r
+                throw new FMILException(UNSATISFIED_LINK);\r
+            } catch (Exception e) {\r
+                throw new FMILException(e.getMessage());\r
+            }\r
+        }\r
+    }\r
+\r
+    private native int[] getAllVariableTypes_(int id, int[] array);\r
+\r
+    public int[] getAllVariableCausalities() throws FMILException {\r
+        synchronized(syncObject) {\r
+\r
+            try {\r
+\r
+               if(variableCausalities == null) {\r
+                       variableCausalities = getAllVariableCausalities_(getModelIDNew(), new int[variableNames.length]); \r
+               }\r
+               return variableCausalities;\r
+\r
+            } catch (UnsatisfiedLinkError err) {\r
+                throw new FMILException(UNSATISFIED_LINK);\r
+            } catch (Exception e) {\r
+                throw new FMILException(e.getMessage());\r
+            }\r
+        }\r
+    }\r
+\r
+    private native int[] getAllVariableCausalities_(int id, int[] array);\r
+\r
+    public int[] getAllVariableVariabilities() throws FMILException {\r
+        synchronized(syncObject) {\r
+\r
+            try {\r
+\r
+               if(variableVariabilities == null) {\r
+                       variableVariabilities = getAllVariableVariabilities_(getModelIDNew(), new int[variableNames.length]); \r
+               }\r
+               return variableVariabilities;\r
+\r
+            } catch (UnsatisfiedLinkError err) {\r
+                throw new FMILException(UNSATISFIED_LINK);\r
+            } catch (Exception e) {\r
+                throw new FMILException(e.getMessage());\r
+            }\r
+        }\r
+    }\r
+\r
+    private native int[] getAllVariableVariabilities_(int id, int[] array);\r
     \r
 //\r
 //    /**\r