]> gerrit.simantics Code Review - simantics/fmil.git/blobdiff - org.simantics.fmil/src/org/simantics/fmil/FMIL.java
refs #6290
[simantics/fmil.git] / org.simantics.fmil / src / org / simantics / fmil / FMIL.java
index 1302634970eee16fb7e18ee55a48a7b83c509e3a..39b90b1d0e0b474d1a57b0729deda3cf5341b529 100644 (file)
@@ -107,10 +107,17 @@ public class FMIL {
 \r
        private String[] variableNames;\r
        private String[] variableDescriptions;\r
+       private String[] variableDeclaredTypes;\r
        private int[] variableReferences;\r
        private int[] variableTypes;\r
        private int[] variableCausalities;\r
        private int[] variableVariabilities;\r
+       \r
+       private String[] declaredTypes;\r
+       private String[] declaredTypeDescriptions;\r
+       private String[] declaredTypeQuantities;\r
+       private String[] declaredTypeUnits;\r
+       \r
        private TObjectIntHashMap<String> variableMap = new TObjectIntHashMap<String>();\r
        \r
        private Set<String> subscriptionSet = new HashSet<String>();\r
@@ -212,7 +219,7 @@ public class FMIL {
 \r
                 fmuLoaded = true;\r
             } catch (UnsatisfiedLinkError err) {\r
-                throw new FMILException(UNSATISFIED_LINK);\r
+                throw new FMILException(UNSATISFIED_LINK, err);\r
             } catch (Exception e) {\r
                 throw new FMILException(e.getMessage());\r
             }\r
@@ -607,6 +614,26 @@ public class FMIL {
 \r
     private native String[] getAllVariableDescriptions_(int id);\r
     \r
+    public String[] getAllVariableDeclaredTypes() throws FMILException {\r
+        synchronized(syncObject) {\r
+\r
+            try {\r
+\r
+               if(variableDeclaredTypes == null) {\r
+                       variableDeclaredTypes = getAllVariableDeclaredTypes_(getModelIDNew());\r
+               }\r
+               return variableDeclaredTypes;\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[] getAllVariableDeclaredTypes_(int id);\r
+\r
     public int[] getAllVariableReferences() throws FMILException {\r
         synchronized(syncObject) {\r
 \r
@@ -686,6 +713,91 @@ public class FMIL {
     }\r
 \r
     private native int[] getAllVariableVariabilities_(int id, int[] array);\r
+\r
+    /**\r
+     * Get all variables in a loaded model\r
+     * @return all variables in a loaded model\r
+     */\r
+    public String[] getAllDeclaredTypes() throws FMILException {\r
+        synchronized(syncObject) {\r
+\r
+            try {\r
+\r
+               if(declaredTypes == null) {\r
+                       declaredTypes = getAllDeclaredTypes_(getModelIDNew());\r
+               }\r
+               return declaredTypes;\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[] getAllDeclaredTypes_(int id);\r
+    \r
+    public String[] getAllDeclaredTypeDescriptions() throws FMILException {\r
+        synchronized(syncObject) {\r
+\r
+            try {\r
+\r
+               if(declaredTypeDescriptions == null) {\r
+                       declaredTypeDescriptions = getAllDeclaredTypeDescriptions_(getModelIDNew());\r
+               }\r
+               return declaredTypeDescriptions;\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[] getAllDeclaredTypeDescriptions_(int id);\r
+    \r
+    public String[] getAllDeclaredTypeQuantities() throws FMILException {\r
+        synchronized(syncObject) {\r
+\r
+            try {\r
+\r
+               if(declaredTypeQuantities == null) {\r
+                       declaredTypeQuantities = getAllDeclaredTypeQuantities_(getModelIDNew());\r
+               }\r
+               return declaredTypeQuantities;\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[] getAllDeclaredTypeQuantities_(int id);\r
+\r
+    public String[] getAllDeclaredTypeUnits() throws FMILException {\r
+        synchronized(syncObject) {\r
+\r
+            try {\r
+\r
+               if(declaredTypeUnits == null) {\r
+                       declaredTypeUnits = getAllDeclaredTypeUnits_(getModelIDNew());\r
+               }\r
+               return declaredTypeUnits;\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[] getAllDeclaredTypeUnits_(int id);\r
+    \r
     \r
 //\r
 //    /**\r