]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Rename timeParam and timeStepParam to just time and timeStep and add a couple of...
authorjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 16 Apr 2015 14:06:11 +0000 (14:06 +0000)
committerjkauttio <jkauttio@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 16 Apr 2015 14:06:11 +0000 (14:06 +0000)
refs #5645

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

org.simantics.sysdyn.ontology/graph.tg
org.simantics.sysdyn.ontology/graph/XmileFunctions.pgraph
org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java

index da8d788bd27a1f5283121c9b3eb67878f7aa92b6..8bc873161b3a631e7f1a29d0e0ef18706b7a7ebb 100644 (file)
Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ
index 007732e370c491d9bf360d2c022307597d41d77a..b5156ef49f874ee326445ba90429931ef76839dd 100644 (file)
@@ -196,7 +196,15 @@ XF.MIN : SYSDYN.SysdynModelicaFunction
   algorithm
     out := if x < y then x else y;"""
 
-/*XF.PI : SYSDYN.SysdynModelicaFunction*/
+XF.PI : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.PI.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  output Real out;
+  algorithm
+    out := 2*asin(1.0);"""
 
 XF.SIN : SYSDYN.SysdynModelicaFunction
     SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
@@ -249,9 +257,9 @@ XF.TAN : SYSDYN.SysdynModelicaFunction
 XF.LOGNORMAL : SYSDYN.SysdynModelicaFunction
 XF.NORMAL : SYSDYN.SysdynModelicaFunction
 XF.POISSON : SYSDYN.SysdynModelicaFunction
-XF.RANDOM : SYSDYN.SysdynModelicaFunction
+XF.RANDOM : SYSDYN.SysdynModelicaFunction*/
 
-XF.DELAY : SYSDYN.SysdynModelicaFunction
+/*XF.DELAY : SYSDYN.SysdynModelicaFunction
 XF.DELAY1 : SYSDYN.SysdynModelicaFunction
 XF.DELAY3 : SYSDYN.SysdynModelicaFunction
 XF.DELAYN : SYSDYN.SysdynModelicaFunction
@@ -261,6 +269,7 @@ XF.SMTH3 : SYSDYN.SysdynModelicaFunction
 XF.SMTHN : SYSDYN.SysdynModelicaFunction
 XF.TREND : SYSDYN.SysdynModelicaFunction*/
 
+/* TODO: probably not quite clean */
 XF.PULSE : SYSDYN.SysdynModelicaFunction
     SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
         @L0.list
@@ -270,9 +279,9 @@ XF.PULSE : SYSDYN.SysdynModelicaFunction
                 @XF.Input
             XF.PULSE.interval : SYSDYN.SysdynModelicaFunction.Input
                 @XF.InputOpt
-            XF.PULSE.timeParam : SYSDYN.SysdynModelicaFunction.Input
+            XF.PULSE.time : SYSDYN.SysdynModelicaFunction.Input
                 @XF.Input
-            XF.PULSE.timeStepParam : SYSDYN.SysdynModelicaFunction.Input
+            XF.PULSE.timeStep : SYSDYN.SysdynModelicaFunction.Input
                 @XF.Input
     SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
         @L0.list
@@ -282,22 +291,59 @@ XF.PULSE : SYSDYN.SysdynModelicaFunction
   input Real magnitude;
   input Real first;
   input Real interval = 0;
-  input Real timeParam;
-  input Real timeStepParam;
+  input Real time;
+  input Real timeStep;
   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? */
+    out := if (time > first - timeStep and time < first + timeStep) then magnitude / timeStep else 0;""" 
 
-/*XF.RAMP : SYSDYN.SysdynModelicaFunction
+XF.RAMP : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.RAMP.slope : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+            XF.RAMP.start : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+            XF.RAMP.time : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.RAMP.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real slope;
+  input Real start;
+  input Real time;
+  output Real out;
+  algorithm
+    out := if (time > start) then slope*(time-start) else 0;"""
+    
 XF.STEP : SYSDYN.SysdynModelicaFunction
+    SYSDYN.SysdynModelicaFunction.inputs _ : L0.List
+        @L0.list
+            XF.STEP.height : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+            XF.STEP.start : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+            XF.STEP.time : SYSDYN.SysdynModelicaFunction.Input
+                @XF.Input
+    SYSDYN.SysdynModelicaFunction.outputs _ : L0.List
+        @L0.list
+            XF.STEP.out : SYSDYN.SysdynModelicaFunction.Output
+                @XF.Output
+    SYSDYN.SysdynModelicaFunction.modelicaFunctionCode """
+  input Real height;
+  input Real start;
+  input Real time;
+  output Real out;
+  algorithm
+    out := if (time > start) then height else 0;"""
 
-XF.DT : SYSDYN.SysdynModelicaFunction
+/*XF.DT : SYSDYN.SysdynModelicaFunction
 XF.STARTTIME : SYSDYN.SysdynModelicaFunction
 XF.STOPTIME : SYSDYN.SysdynModelicaFunction
-XF.TIME : SYSDYN.SysdynModelicaFunction
+XF.TIME : SYSDYN.SysdynModelicaFunction*/
 
-XF.IFTHENELSE : SYSDYN.SysdynModelicaFunction
-XF.INIT : SYSDYN.SysdynModelicaFunction
+/*XF.INIT : SYSDYN.SysdynModelicaFunction
 XF.PREVIOUS : SYSDYN.SysdynModelicaFunction
 XF.SELF : SYSDYN.SysdynModelicaFunction*/
\ No newline at end of file
index 814a253ecc03f950b364376f210069040a086288..18c24ad98366c69ce520db9ac4565906978f590d 100644 (file)
@@ -327,19 +327,31 @@ public class SysdynResource {
     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_PI;\r
+    public final Resource Built$in_Functions_Xmile_Functions_PI_out;\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_PULSE_time;\r
+    public final Resource Built$in_Functions_Xmile_Functions_PULSE_timeStep;\r
+    public final Resource Built$in_Functions_Xmile_Functions_RAMP;\r
+    public final Resource Built$in_Functions_Xmile_Functions_RAMP_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_RAMP_slope;\r
+    public final Resource Built$in_Functions_Xmile_Functions_RAMP_start;\r
+    public final Resource Built$in_Functions_Xmile_Functions_RAMP_time;\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_STEP;\r
+    public final Resource Built$in_Functions_Xmile_Functions_STEP_height;\r
+    public final Resource Built$in_Functions_Xmile_Functions_STEP_out;\r
+    public final Resource Built$in_Functions_Xmile_Functions_STEP_start;\r
+    public final Resource Built$in_Functions_Xmile_Functions_STEP_time;\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
@@ -1170,19 +1182,31 @@ public class SysdynResource {
         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_PI = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PI";\r
+        public static final String Built$in_Functions_Xmile_Functions_PI_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PI/out";\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_PULSE_time = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PULSE/time";\r
+        public static final String Built$in_Functions_Xmile_Functions_PULSE_timeStep = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PULSE/timeStep";\r
+        public static final String Built$in_Functions_Xmile_Functions_RAMP = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/RAMP";\r
+        public static final String Built$in_Functions_Xmile_Functions_RAMP_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/RAMP/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_RAMP_slope = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/RAMP/slope";\r
+        public static final String Built$in_Functions_Xmile_Functions_RAMP_start = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/RAMP/start";\r
+        public static final String Built$in_Functions_Xmile_Functions_RAMP_time = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/RAMP/time";\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_STEP = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/STEP";\r
+        public static final String Built$in_Functions_Xmile_Functions_STEP_height = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/STEP/height";\r
+        public static final String Built$in_Functions_Xmile_Functions_STEP_out = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/STEP/out";\r
+        public static final String Built$in_Functions_Xmile_Functions_STEP_start = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/STEP/start";\r
+        public static final String Built$in_Functions_Xmile_Functions_STEP_time = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/STEP/time";\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
@@ -2023,19 +2047,31 @@ public class SysdynResource {
         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_PI = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PI);\r
+        Built$in_Functions_Xmile_Functions_PI_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PI_out);\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_PULSE_time = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_time);\r
+        Built$in_Functions_Xmile_Functions_PULSE_timeStep = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_timeStep);\r
+        Built$in_Functions_Xmile_Functions_RAMP = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_RAMP);\r
+        Built$in_Functions_Xmile_Functions_RAMP_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_RAMP_out);\r
+        Built$in_Functions_Xmile_Functions_RAMP_slope = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_RAMP_slope);\r
+        Built$in_Functions_Xmile_Functions_RAMP_start = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_RAMP_start);\r
+        Built$in_Functions_Xmile_Functions_RAMP_time = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_RAMP_time);\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_STEP = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_STEP);\r
+        Built$in_Functions_Xmile_Functions_STEP_height = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_STEP_height);\r
+        Built$in_Functions_Xmile_Functions_STEP_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_STEP_out);\r
+        Built$in_Functions_Xmile_Functions_STEP_start = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_STEP_start);\r
+        Built$in_Functions_Xmile_Functions_STEP_time = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_STEP_time);\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