]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Xmile export update and general cleanup
authorjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 27 Feb 2015 15:32:48 +0000 (15:32 +0000)
committerjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 27 Feb 2015 15:32:48 +0000 (15:32 +0000)
THIS IS VERY WORK IN PROGRESS AND NOT FUNCTIONAL AT THE MOMENT.

refs #5645

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@31004 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ontology/graph.tg
org.simantics.sysdyn.ontology/graph/XmileFunctions.pgraph [new file with mode: 0644]
org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java
org.simantics.sysdyn/META-INF/MANIFEST.MF
org.simantics.sysdyn/src/org/simantics/sysdyn/manager/FunctionUtils.java
org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/StockExpression.java
org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/WithLookupExpression.java
org.simantics.sysdyn/src/org/simantics/sysdyn/utils/Function.java

index fa218087b2d4136b6810b875973ba0baade063d2..12df6c9291e3d17cbb0d9cbd4c19c3776b7cc7d6 100644 (file)
Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ
diff --git a/org.simantics.sysdyn.ontology/graph/XmileFunctions.pgraph b/org.simantics.sysdyn.ontology/graph/XmileFunctions.pgraph
new file mode 100644 (file)
index 0000000..007732e
--- /dev/null
@@ -0,0 +1,303 @@
+L0 = <http://www.simantics.org/Layer0-1.1>
+SYSDYN = <http://www.simantics.org/Sysdyn-1.1>
+
+XF = <http://www.simantics.org/Sysdyn-1.1/Built-in Functions/Xmile Functions> : SYSDYN.SysdynModelicaFunctionLibrary
+
+XF.Input : L0.Template
+    @template %name
+        %name
+            SYSDYN.Variable.type "Real"
+            SYSDYN.SysdynModelicaFunction.optional false
+            SYSDYN.SysdynModelicaFunction.unit "1"
+            
+XF.InputOpt : L0.Template
+    @template %name
+        %name
+            SYSDYN.Variable.type "Real"
+            SYSDYN.SysdynModelicaFunction.optional true
+            SYSDYN.SysdynModelicaFunction.unit "1"
+
+XF.Output : L0.Template
+    @template %name
+        %name
+            SYSDYN.Variable.type "Real"
+            SYSDYN.SysdynModelicaFunction.unit "1"
+
+XF.ABS : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.ABS.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.ABS.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := abs(value);"""
+    
+XF.ARCCOS : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.ARCCOS.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.ARCCOS.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := acos(value);"""
+
+XF.ARCSIN : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.ARCSIN.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.ARCSIN.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := asin(value);"""
+
+XF.ARCTAN : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.ARCTAN.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.ARCTAN.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := atan(value);"""
+
+XF.COS : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.COS.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.COS.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := cos(value);"""
+
+XF.EXP : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.EXP.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.EXP.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := exp(value);"""
+
+/*XF.INF : SYSDYN.SysdynModelicaFunction*/
+
+XF.INT : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.INT.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.INT.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := integer(value);"""
+
+XF.LN : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.LN.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.LN.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := log(value);"""
+    
+XF.LOG10 : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.LOG10.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.LOG10.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := log10(value);"""
+    
+XF.MAX : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.MAX.x : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+            XF.MAX.y : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.MAX.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real x;
+  input Real y;
+  output Real out;
+  algorithm
+    out := if x > y then x else y;"""
+
+XF.MIN : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.MIN.x : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+            XF.MIN.y : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.MIN.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real x;
+  input Real y;
+  output Real out;
+  algorithm
+    out := if x < y then x else y;"""
+
+/*XF.PI : SYSDYN.SysdynModelicaFunction*/
+
+XF.SIN : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.SIN.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.SIN.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := sin(value);"""
+
+XF.SQRT : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.SQRT.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.SQRT.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := sqrt(value);"""
+
+XF.TAN : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.TAN.value : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.TAN.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real value;
+  output Real out;
+  algorithm
+    out := tan(value);"""
+
+
+
+/*XF.EXPRND : SYSDYN.SysdynModelicaFunction
+XF.LOGNORMAL : SYSDYN.SysdynModelicaFunction
+XF.NORMAL : SYSDYN.SysdynModelicaFunction
+XF.POISSON : SYSDYN.SysdynModelicaFunction
+XF.RANDOM : SYSDYN.SysdynModelicaFunction
+
+XF.DELAY : SYSDYN.SysdynModelicaFunction
+XF.DELAY1 : SYSDYN.SysdynModelicaFunction
+XF.DELAY3 : SYSDYN.SysdynModelicaFunction
+XF.DELAYN : SYSDYN.SysdynModelicaFunction
+XF.FORCST : SYSDYN.SysdynModelicaFunction
+XF.SMTH1 : SYSDYN.SysdynModelicaFunction
+XF.SMTH3 : SYSDYN.SysdynModelicaFunction
+XF.SMTHN : SYSDYN.SysdynModelicaFunction
+XF.TREND : SYSDYN.SysdynModelicaFunction*/
+
+XF.PULSE : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.PULSE.magnitude : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+            XF.PULSE.first : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+            XF.PULSE.interval : SYSDYN.SysdynModelicaFunction.Input
+                @XF.InputOpt
+            XF.PULSE.timeParam : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+            XF.PULSE.timeStepParam : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.PULSE.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real magnitude;
+  input Real first;
+  input Real interval = 0;
+  input Real timeParam;
+  input Real timeStepParam;
+  output Real out;
+  algorithm
+    out := if (timeParam > first - timeStepParam and timeParam < first + timeStepParam) then magnitude / timeStepParam else 0;""" 
+    /* TODO: how to handle time step here? */
+
+/*XF.RAMP : SYSDYN.SysdynModelicaFunction
+XF.STEP : SYSDYN.SysdynModelicaFunction
+
+XF.DT : SYSDYN.SysdynModelicaFunction
+XF.STARTTIME : SYSDYN.SysdynModelicaFunction
+XF.STOPTIME : SYSDYN.SysdynModelicaFunction
+XF.TIME : SYSDYN.SysdynModelicaFunction
+
+XF.IFTHENELSE : SYSDYN.SysdynModelicaFunction
+XF.INIT : SYSDYN.SysdynModelicaFunction
+XF.PREVIOUS : SYSDYN.SysdynModelicaFunction
+XF.SELF : SYSDYN.SysdynModelicaFunction*/
\ No newline at end of file
index 3a3cc77e1d3c884a81848b468dbcb113bf653be5..5d1ea5705ac7c1af9d0e683be67ad36846ca42df 100644 (file)
@@ -288,6 +288,61 @@ public class SysdynResource {
     public final Resource Built$in_Functions_Vensim_Functions_ZIDZ_a;\r
     public final Resource Built$in_Functions_Vensim_Functions_ZIDZ_b;\r
     public final Resource Built$in_Functions_Vensim_Functions_ZIDZ_z;\r
+    public final Resource Built$in_Functions_Xmile_Functions;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ABS;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ABS_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ABS_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ARCCOS;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ARCCOS_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ARCCOS_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ARCSIN;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ARCSIN_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ARCSIN_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ARCTAN;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ARCTAN_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_ARCTAN_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_COS;\r
+    public final Resource Built$in_Functions_Xmile_Functions_COS_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_COS_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_EXP;\r
+    public final Resource Built$in_Functions_Xmile_Functions_EXP_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_EXP_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_INT;\r
+    public final Resource Built$in_Functions_Xmile_Functions_INT_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_INT_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_Input;\r
+    public final Resource Built$in_Functions_Xmile_Functions_InputOpt;\r
+    public final Resource Built$in_Functions_Xmile_Functions_LN;\r
+    public final Resource Built$in_Functions_Xmile_Functions_LN_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_LN_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_LOG10;\r
+    public final Resource Built$in_Functions_Xmile_Functions_LOG10_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_LOG10_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_MAX;\r
+    public final Resource Built$in_Functions_Xmile_Functions_MAX_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_MAX_x;\r
+    public final Resource Built$in_Functions_Xmile_Functions_MAX_y;\r
+    public final Resource Built$in_Functions_Xmile_Functions_MIN;\r
+    public final Resource Built$in_Functions_Xmile_Functions_MIN_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_MIN_x;\r
+    public final Resource Built$in_Functions_Xmile_Functions_MIN_y;\r
+    public final Resource Built$in_Functions_Xmile_Functions_Output;\r
+    public final Resource Built$in_Functions_Xmile_Functions_PULSE;\r
+    public final Resource Built$in_Functions_Xmile_Functions_PULSE_first;\r
+    public final Resource Built$in_Functions_Xmile_Functions_PULSE_interval;\r
+    public final Resource Built$in_Functions_Xmile_Functions_PULSE_magnitude;\r
+    public final Resource Built$in_Functions_Xmile_Functions_PULSE_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_PULSE_timeParam;\r
+    public final Resource Built$in_Functions_Xmile_Functions_PULSE_timeStepParam;\r
+    public final Resource Built$in_Functions_Xmile_Functions_SIN;\r
+    public final Resource Built$in_Functions_Xmile_Functions_SIN_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_SIN_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_SQRT;\r
+    public final Resource Built$in_Functions_Xmile_Functions_SQRT_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_SQRT_value;\r
+    public final Resource Built$in_Functions_Xmile_Functions_TAN;\r
+    public final Resource Built$in_Functions_Xmile_Functions_TAN_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_TAN_value;\r
     public final Resource Built$in_Functions_interpolate;\r
     public final Resource Built$in_Functions_interpolateFull;\r
     public final Resource Built$in_Functions_interpolateFull_icol;\r
@@ -1073,6 +1128,61 @@ public class SysdynResource {
         public static final String Built$in_Functions_Vensim_Functions_ZIDZ_a = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Vensim%20Functions/ZIDZ/a";\r
         public static final String Built$in_Functions_Vensim_Functions_ZIDZ_b = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Vensim%20Functions/ZIDZ/b";\r
         public static final String Built$in_Functions_Vensim_Functions_ZIDZ_z = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Vensim%20Functions/ZIDZ/z";\r
+        public static final String Built$in_Functions_Xmile_Functions = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions";\r
+        public static final String Built$in_Functions_Xmile_Functions_ABS = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ABS";\r
+        public static final String Built$in_Functions_Xmile_Functions_ABS_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ABS/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_ABS_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ABS/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_ARCCOS = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ARCCOS";\r
+        public static final String Built$in_Functions_Xmile_Functions_ARCCOS_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ARCCOS/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_ARCCOS_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ARCCOS/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_ARCSIN = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ARCSIN";\r
+        public static final String Built$in_Functions_Xmile_Functions_ARCSIN_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ARCSIN/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_ARCSIN_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ARCSIN/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_ARCTAN = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ARCTAN";\r
+        public static final String Built$in_Functions_Xmile_Functions_ARCTAN_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ARCTAN/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_ARCTAN_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/ARCTAN/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_COS = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/COS";\r
+        public static final String Built$in_Functions_Xmile_Functions_COS_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/COS/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_COS_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/COS/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_EXP = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/EXP";\r
+        public static final String Built$in_Functions_Xmile_Functions_EXP_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/EXP/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_EXP_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/EXP/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_INT = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/INT";\r
+        public static final String Built$in_Functions_Xmile_Functions_INT_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/INT/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_INT_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/INT/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_Input = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/Input";\r
+        public static final String Built$in_Functions_Xmile_Functions_InputOpt = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/InputOpt";\r
+        public static final String Built$in_Functions_Xmile_Functions_LN = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/LN";\r
+        public static final String Built$in_Functions_Xmile_Functions_LN_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/LN/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_LN_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/LN/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_LOG10 = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/LOG10";\r
+        public static final String Built$in_Functions_Xmile_Functions_LOG10_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/LOG10/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_LOG10_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/LOG10/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_MAX = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/MAX";\r
+        public static final String Built$in_Functions_Xmile_Functions_MAX_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/MAX/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_MAX_x = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/MAX/x";\r
+        public static final String Built$in_Functions_Xmile_Functions_MAX_y = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/MAX/y";\r
+        public static final String Built$in_Functions_Xmile_Functions_MIN = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/MIN";\r
+        public static final String Built$in_Functions_Xmile_Functions_MIN_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/MIN/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_MIN_x = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/MIN/x";\r
+        public static final String Built$in_Functions_Xmile_Functions_MIN_y = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/MIN/y";\r
+        public static final String Built$in_Functions_Xmile_Functions_Output = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/Output";\r
+        public static final String Built$in_Functions_Xmile_Functions_PULSE = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PULSE";\r
+        public static final String Built$in_Functions_Xmile_Functions_PULSE_first = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PULSE/first";\r
+        public static final String Built$in_Functions_Xmile_Functions_PULSE_interval = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PULSE/interval";\r
+        public static final String Built$in_Functions_Xmile_Functions_PULSE_magnitude = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PULSE/magnitude";\r
+        public static final String Built$in_Functions_Xmile_Functions_PULSE_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PULSE/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_PULSE_timeParam = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PULSE/timeParam";\r
+        public static final String Built$in_Functions_Xmile_Functions_PULSE_timeStepParam = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PULSE/timeStepParam";\r
+        public static final String Built$in_Functions_Xmile_Functions_SIN = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/SIN";\r
+        public static final String Built$in_Functions_Xmile_Functions_SIN_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/SIN/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_SIN_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/SIN/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_SQRT = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/SQRT";\r
+        public static final String Built$in_Functions_Xmile_Functions_SQRT_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/SQRT/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_SQRT_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/SQRT/value";\r
+        public static final String Built$in_Functions_Xmile_Functions_TAN = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/TAN";\r
+        public static final String Built$in_Functions_Xmile_Functions_TAN_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/TAN/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_TAN_value = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/TAN/value";\r
         public static final String Built$in_Functions_interpolate = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/interpolate";\r
         public static final String Built$in_Functions_interpolateFull = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/interpolateFull";\r
         public static final String Built$in_Functions_interpolateFull_icol = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/interpolateFull/icol";\r
@@ -1868,6 +1978,61 @@ public class SysdynResource {
         Built$in_Functions_Vensim_Functions_ZIDZ_a = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_ZIDZ_a);\r
         Built$in_Functions_Vensim_Functions_ZIDZ_b = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_ZIDZ_b);\r
         Built$in_Functions_Vensim_Functions_ZIDZ_z = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_ZIDZ_z);\r
+        Built$in_Functions_Xmile_Functions = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions);\r
+        Built$in_Functions_Xmile_Functions_ABS = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ABS);\r
+        Built$in_Functions_Xmile_Functions_ABS_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ABS_out);\r
+        Built$in_Functions_Xmile_Functions_ABS_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ABS_value);\r
+        Built$in_Functions_Xmile_Functions_ARCCOS = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ARCCOS);\r
+        Built$in_Functions_Xmile_Functions_ARCCOS_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ARCCOS_out);\r
+        Built$in_Functions_Xmile_Functions_ARCCOS_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ARCCOS_value);\r
+        Built$in_Functions_Xmile_Functions_ARCSIN = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ARCSIN);\r
+        Built$in_Functions_Xmile_Functions_ARCSIN_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ARCSIN_out);\r
+        Built$in_Functions_Xmile_Functions_ARCSIN_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ARCSIN_value);\r
+        Built$in_Functions_Xmile_Functions_ARCTAN = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ARCTAN);\r
+        Built$in_Functions_Xmile_Functions_ARCTAN_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ARCTAN_out);\r
+        Built$in_Functions_Xmile_Functions_ARCTAN_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_ARCTAN_value);\r
+        Built$in_Functions_Xmile_Functions_COS = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_COS);\r
+        Built$in_Functions_Xmile_Functions_COS_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_COS_out);\r
+        Built$in_Functions_Xmile_Functions_COS_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_COS_value);\r
+        Built$in_Functions_Xmile_Functions_EXP = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_EXP);\r
+        Built$in_Functions_Xmile_Functions_EXP_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_EXP_out);\r
+        Built$in_Functions_Xmile_Functions_EXP_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_EXP_value);\r
+        Built$in_Functions_Xmile_Functions_INT = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_INT);\r
+        Built$in_Functions_Xmile_Functions_INT_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_INT_out);\r
+        Built$in_Functions_Xmile_Functions_INT_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_INT_value);\r
+        Built$in_Functions_Xmile_Functions_Input = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_Input);\r
+        Built$in_Functions_Xmile_Functions_InputOpt = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_InputOpt);\r
+        Built$in_Functions_Xmile_Functions_LN = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_LN);\r
+        Built$in_Functions_Xmile_Functions_LN_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_LN_out);\r
+        Built$in_Functions_Xmile_Functions_LN_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_LN_value);\r
+        Built$in_Functions_Xmile_Functions_LOG10 = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_LOG10);\r
+        Built$in_Functions_Xmile_Functions_LOG10_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_LOG10_out);\r
+        Built$in_Functions_Xmile_Functions_LOG10_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_LOG10_value);\r
+        Built$in_Functions_Xmile_Functions_MAX = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_MAX);\r
+        Built$in_Functions_Xmile_Functions_MAX_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_MAX_out);\r
+        Built$in_Functions_Xmile_Functions_MAX_x = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_MAX_x);\r
+        Built$in_Functions_Xmile_Functions_MAX_y = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_MAX_y);\r
+        Built$in_Functions_Xmile_Functions_MIN = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_MIN);\r
+        Built$in_Functions_Xmile_Functions_MIN_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_MIN_out);\r
+        Built$in_Functions_Xmile_Functions_MIN_x = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_MIN_x);\r
+        Built$in_Functions_Xmile_Functions_MIN_y = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_MIN_y);\r
+        Built$in_Functions_Xmile_Functions_Output = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_Output);\r
+        Built$in_Functions_Xmile_Functions_PULSE = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE);\r
+        Built$in_Functions_Xmile_Functions_PULSE_first = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_first);\r
+        Built$in_Functions_Xmile_Functions_PULSE_interval = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_interval);\r
+        Built$in_Functions_Xmile_Functions_PULSE_magnitude = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_magnitude);\r
+        Built$in_Functions_Xmile_Functions_PULSE_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_out);\r
+        Built$in_Functions_Xmile_Functions_PULSE_timeParam = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_timeParam);\r
+        Built$in_Functions_Xmile_Functions_PULSE_timeStepParam = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_timeStepParam);\r
+        Built$in_Functions_Xmile_Functions_SIN = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SIN);\r
+        Built$in_Functions_Xmile_Functions_SIN_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SIN_out);\r
+        Built$in_Functions_Xmile_Functions_SIN_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SIN_value);\r
+        Built$in_Functions_Xmile_Functions_SQRT = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SQRT);\r
+        Built$in_Functions_Xmile_Functions_SQRT_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SQRT_out);\r
+        Built$in_Functions_Xmile_Functions_SQRT_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SQRT_value);\r
+        Built$in_Functions_Xmile_Functions_TAN = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_TAN);\r
+        Built$in_Functions_Xmile_Functions_TAN_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_TAN_out);\r
+        Built$in_Functions_Xmile_Functions_TAN_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_TAN_value);\r
         Built$in_Functions_interpolate = getResourceOrNull(graph, URIs.Built$in_Functions_interpolate);\r
         Built$in_Functions_interpolateFull = getResourceOrNull(graph, URIs.Built$in_Functions_interpolateFull);\r
         Built$in_Functions_interpolateFull_icol = getResourceOrNull(graph, URIs.Built$in_Functions_interpolateFull_icol);\r
index 218edabe3677307e493b544e0429ecc5954a4c57..9c5a86f754bc29a2e8c5d69f7ef25087c283938d 100644 (file)
@@ -43,6 +43,7 @@ Export-Package: org.simantics.sysdyn,
  org.simantics.sysdyn.modelImport,
  org.simantics.sysdyn.modelImport.model,
  org.simantics.sysdyn.modelImport.model.expression,
+ org.simantics.sysdyn.modelImport.model.support,
  org.simantics.sysdyn.modelParser,
  org.simantics.sysdyn.modelica,
  org.simantics.sysdyn.representation,
index 2d86001100eed243f8b1827339c3dcebb6644a8c..5b0c158a5fe8d24a3a9472d6c77f79e0df23c99a 100644 (file)
@@ -36,8 +36,6 @@ import org.simantics.sysdyn.SysdynResource;
 \r
 public class FunctionUtils {\r
        \r
-       // SOMETHING WRONG HERE\r
-       \r
        public static List<String> getLibraryPathsForModelica(final SysdynExperiment experiment) {\r
                try {\r
                        return Simantics.getSession().syncRequest(new Read<List<String>>() {\r
@@ -205,11 +203,18 @@ public class FunctionUtils {
                writeLibraryFunctions(graph, library, scriptFile, stream);\r
                for(Resource sublibrary : graph.syncRequest(new ObjectsWithType(library, l0.ConsistsOf, sr.SysdynModelicaFunctionLibrary))) {\r
                        String name = NameUtils.getSafeName(graph, sublibrary);\r
+                       // TODO: this is an extreme hack and should be fixed at earlies conveniece\r
+                       boolean xmile = false;\r
+                       if (sublibrary.equals(graph.getResource(SysdynResource.URIs.Built$in_Functions_Xmile_Functions))) {\r
+                               xmile = true;\r
+                       }\r
+                       if (xmile) stream.println("encapsulated package XMILE");\r
                        if(!builtIn)\r
                                stream.println("encapsulated package " + name);\r
                        writeLibrary(graph, sublibrary, scriptFile, stream, builtIn);\r
                        if(!builtIn)\r
                                stream.println("end " + name + ";\n");\r
+                       if (xmile) stream.println("end XMILE;\n");\r
                }\r
        }\r
        \r
index 3fb5f59fd6edfdca3c331090d5c2d44f817fdc31..7ed29d3ea11aaf22a22552d652a6900d43a8ed6a 100644 (file)
@@ -154,4 +154,12 @@ public class StockExpression extends Expression {
         \r
         return result;\r
     }\r
+    \r
+    public String getPlainInitialEquation() {\r
+       return initialEquation;\r
+    }\r
+    \r
+    public String getPlainIntegralEquation() {\r
+       return integralEquation;\r
+    }\r
 }\r
index 82acd9912662aaf6dd87bce4a973eb6faf86d461..12d6dfe3995316c63ce7f94d7ff4d120342e94fd 100644 (file)
@@ -50,7 +50,7 @@ import org.simantics.sysdyn.representation.utils.UnitUtils;
  */\r
 @GraphType(SysdynResource.URIs.WithLookupExpression)\r
 public class WithLookupExpression extends Expression {\r
-\r
+       \r
     @RelatedValue(SysdynResource.URIs.WithLookupExpression_lookup)\r
     private String lookupTable;\r
     @RelatedValue(SysdynResource.URIs.WithLookupExpression_expression)\r
@@ -62,8 +62,7 @@ public class WithLookupExpression extends Expression {
        equation = FormatUtils.formatExpressionForModelica(parent, equation);\r
         String range = IndexUtils.rangeToIndexes(parent, this.getArrayRange());\r
 \r
-        return \r
-                "    " + parent.getModelicaName() + (range.equals("[:]") ? "" : range) + " = interpolate(" + equation + ", " + SheetFormatUtils.reformatSheetReferences(parent, lookupTable) + ");\n";\r
+        return "    " + parent.getModelicaName() + (range.equals("[:]") ? "" : range) + " = interpolate(" + equation + ", " + SheetFormatUtils.reformatSheetReferences(parent, lookupTable) + ");\n";\r
     }\r
 \r
     @Override\r
@@ -183,10 +182,46 @@ public class WithLookupExpression extends Expression {
             svg = svg.replaceAll("[\r\n]+", "");\r
             expression = expression + "<div>" + svg + "</div>";\r
         } catch (NumberFormatException e) {\r
-\r
         } catch (IOException e) {\r
         }\r
 \r
         return expression;\r
     }\r
+    \r
+    public String getLookupEquation() {\r
+       return equation;\r
+    }\r
+    \r
+    public double[] getPoints() {\r
+       // the lookup table is stored in format {{0,0},{1,2}}\r
+       String[] table = lookupTable.replaceAll("\\{|\\}", "").split(",");\r
+       double[] points = new double[table.length];\r
+       for (int i = 0; i < table.length; i++) {\r
+               try {\r
+                       points[i] = Double.parseDouble(table[i]);\r
+               }\r
+               catch (NumberFormatException e) {\r
+                       // could not convert to double, do something\r
+               }\r
+       }\r
+       return points;\r
+    }\r
+    \r
+    public double[] getXPoints() {\r
+       double[] points = getPoints();\r
+       double[] xPoints = new double[points.length/2];\r
+       for (int i = 0; i < points.length; i++) {\r
+               xPoints[i] = points[2*i];\r
+       }\r
+       return xPoints;\r
+    }\r
+    \r
+    public double[] getYPoints() {\r
+       double[] points = getPoints();\r
+       double[] yPoints = new double[points.length/2];\r
+       for (int i = 0; i < points.length; i++) {\r
+               yPoints[i] = points[2*i + 1];\r
+       }\r
+       return yPoints;\r
+    }\r
 }\r
index 21fce962f991ab0d4a7f7eb5a3889567efb4de6a..ec9ff7512d012f28526a19f4b970287f70bbc939 100644 (file)
@@ -115,7 +115,8 @@ public class Function implements Comparable<Function>{
         SYSDYN,\r
         MODELICA, \r
         MODELICA_ARRAY,\r
-        VENSIM\r
+        VENSIM,\r
+        XMILE\r
     }\r
     \r
     public Function(\r
@@ -290,6 +291,14 @@ public class Function implements Comparable<Function>{
         Resource functionLibrary = graph.getPossibleResource(functionTypeUri);\r
         for(Resource r : graph.syncRequest(new ObjectsWithType(functionLibrary, l0.ConsistsOf, sr.SysdynModelicaFunction))) {\r
             String name = NameUtils.getSafeName(graph, r);\r
+            // add a XMILE prefix to xmile functions. this should probably be\r
+            // done to VENSIM functions too, but a better solutions would be\r
+            // to segregate the non-sysdyn non-modelica function libraries\r
+            // to a separate place, be it an external function library or\r
+            // something else, instead of including them everywhere by default\r
+            if (functionType.equals(Type.XMILE)) {\r
+               name = "XMILE." + name;\r
+            }\r
             ArrayList<Input> inputs = getFunctionInputs(graph, sr, r);\r
             ArrayList<Output> outputs = getFunctionOutputs(graph, sr, r);\r
             String description = getFunctionDescription(graph, r);\r
@@ -311,6 +320,7 @@ public class Function implements Comparable<Function>{
         functions.addAll(getFunctionsOfType(graph, SysdynResource.URIs.Built$in_Functions_Vensim_Functions, Type.VENSIM));\r
         functions.addAll(getFunctionsOfType(graph, SysdynResource.URIs.Built$in_Functions_Modelica_Functions, Type.MODELICA));\r
         functions.addAll(getFunctionsOfType(graph, SysdynResource.URIs.Built$in_Functions_Modelica_Array_Functions, Type.MODELICA_ARRAY));\r
+        functions.addAll(getFunctionsOfType(graph, SysdynResource.URIs.Built$in_Functions_Xmile_Functions, Type.XMILE));\r
         \r
         return functions;\r
     }\r