From: jkauttio Date: Thu, 16 Apr 2015 14:06:11 +0000 (+0000) Subject: Rename timeParam and timeStepParam to just time and timeStep and add a couple of... X-Git-Tag: v1.29.0~98 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=48c39b4b2393f336001fa0fc5e203b9adaeca4ba;p=simantics%2Fsysdyn.git Rename timeParam and timeStepParam to just time and timeStep and add a couple of XMILE functions into the function library refs #5645 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@31182 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ontology/graph.tg b/org.simantics.sysdyn.ontology/graph.tg index da8d788b..8bc87316 100644 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 index 007732e3..b5156ef4 100644 --- a/org.simantics.sysdyn.ontology/graph/XmileFunctions.pgraph +++ b/org.simantics.sysdyn.ontology/graph/XmileFunctions.pgraph @@ -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 diff --git a/org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java b/org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java index 814a253e..18c24ad9 100644 --- a/org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java +++ b/org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java @@ -327,19 +327,31 @@ public class SysdynResource { public final Resource Built$in_Functions_Xmile_Functions_MIN_x; public final Resource Built$in_Functions_Xmile_Functions_MIN_y; public final Resource Built$in_Functions_Xmile_Functions_Output; + public final Resource Built$in_Functions_Xmile_Functions_PI; + public final Resource Built$in_Functions_Xmile_Functions_PI_out; public final Resource Built$in_Functions_Xmile_Functions_PULSE; public final Resource Built$in_Functions_Xmile_Functions_PULSE_first; public final Resource Built$in_Functions_Xmile_Functions_PULSE_interval; public final Resource Built$in_Functions_Xmile_Functions_PULSE_magnitude; public final Resource Built$in_Functions_Xmile_Functions_PULSE_out; - public final Resource Built$in_Functions_Xmile_Functions_PULSE_timeParam; - public final Resource Built$in_Functions_Xmile_Functions_PULSE_timeStepParam; + public final Resource Built$in_Functions_Xmile_Functions_PULSE_time; + public final Resource Built$in_Functions_Xmile_Functions_PULSE_timeStep; + public final Resource Built$in_Functions_Xmile_Functions_RAMP; + public final Resource Built$in_Functions_Xmile_Functions_RAMP_out; + public final Resource Built$in_Functions_Xmile_Functions_RAMP_slope; + public final Resource Built$in_Functions_Xmile_Functions_RAMP_start; + public final Resource Built$in_Functions_Xmile_Functions_RAMP_time; public final Resource Built$in_Functions_Xmile_Functions_SIN; public final Resource Built$in_Functions_Xmile_Functions_SIN_out; public final Resource Built$in_Functions_Xmile_Functions_SIN_value; public final Resource Built$in_Functions_Xmile_Functions_SQRT; public final Resource Built$in_Functions_Xmile_Functions_SQRT_out; public final Resource Built$in_Functions_Xmile_Functions_SQRT_value; + public final Resource Built$in_Functions_Xmile_Functions_STEP; + public final Resource Built$in_Functions_Xmile_Functions_STEP_height; + public final Resource Built$in_Functions_Xmile_Functions_STEP_out; + public final Resource Built$in_Functions_Xmile_Functions_STEP_start; + public final Resource Built$in_Functions_Xmile_Functions_STEP_time; public final Resource Built$in_Functions_Xmile_Functions_TAN; public final Resource Built$in_Functions_Xmile_Functions_TAN_out; public final Resource Built$in_Functions_Xmile_Functions_TAN_value; @@ -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"; 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"; public static final String Built$in_Functions_Xmile_Functions_Output = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/Output"; + public static final String Built$in_Functions_Xmile_Functions_PI = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PI"; + 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"; public static final String Built$in_Functions_Xmile_Functions_PULSE = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/PULSE"; 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"; 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"; 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"; 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"; - 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"; - 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"; + 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"; + 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"; + public static final String Built$in_Functions_Xmile_Functions_RAMP = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/RAMP"; + 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"; + 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"; + 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"; + 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"; public static final String Built$in_Functions_Xmile_Functions_SIN = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/SIN"; 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"; 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"; public static final String Built$in_Functions_Xmile_Functions_SQRT = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/SQRT"; 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"; 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"; + public static final String Built$in_Functions_Xmile_Functions_STEP = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/STEP"; + 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"; + 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"; + 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"; + 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"; public static final String Built$in_Functions_Xmile_Functions_TAN = "http://www.simantics.org/Sysdyn-1.1/Built-in%20Functions/Xmile%20Functions/TAN"; 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"; 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"; @@ -2023,19 +2047,31 @@ public class SysdynResource { Built$in_Functions_Xmile_Functions_MIN_x = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_MIN_x); Built$in_Functions_Xmile_Functions_MIN_y = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_MIN_y); Built$in_Functions_Xmile_Functions_Output = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_Output); + Built$in_Functions_Xmile_Functions_PI = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PI); + Built$in_Functions_Xmile_Functions_PI_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PI_out); Built$in_Functions_Xmile_Functions_PULSE = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE); Built$in_Functions_Xmile_Functions_PULSE_first = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_first); Built$in_Functions_Xmile_Functions_PULSE_interval = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_interval); Built$in_Functions_Xmile_Functions_PULSE_magnitude = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_magnitude); Built$in_Functions_Xmile_Functions_PULSE_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_out); - Built$in_Functions_Xmile_Functions_PULSE_timeParam = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_timeParam); - Built$in_Functions_Xmile_Functions_PULSE_timeStepParam = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_timeStepParam); + Built$in_Functions_Xmile_Functions_PULSE_time = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_time); + Built$in_Functions_Xmile_Functions_PULSE_timeStep = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_PULSE_timeStep); + Built$in_Functions_Xmile_Functions_RAMP = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_RAMP); + Built$in_Functions_Xmile_Functions_RAMP_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_RAMP_out); + Built$in_Functions_Xmile_Functions_RAMP_slope = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_RAMP_slope); + Built$in_Functions_Xmile_Functions_RAMP_start = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_RAMP_start); + Built$in_Functions_Xmile_Functions_RAMP_time = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_RAMP_time); Built$in_Functions_Xmile_Functions_SIN = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SIN); Built$in_Functions_Xmile_Functions_SIN_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SIN_out); Built$in_Functions_Xmile_Functions_SIN_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SIN_value); Built$in_Functions_Xmile_Functions_SQRT = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SQRT); Built$in_Functions_Xmile_Functions_SQRT_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SQRT_out); Built$in_Functions_Xmile_Functions_SQRT_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_SQRT_value); + Built$in_Functions_Xmile_Functions_STEP = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_STEP); + Built$in_Functions_Xmile_Functions_STEP_height = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_STEP_height); + Built$in_Functions_Xmile_Functions_STEP_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_STEP_out); + Built$in_Functions_Xmile_Functions_STEP_start = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_STEP_start); + Built$in_Functions_Xmile_Functions_STEP_time = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_STEP_time); Built$in_Functions_Xmile_Functions_TAN = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_TAN); Built$in_Functions_Xmile_Functions_TAN_out = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_TAN_out); Built$in_Functions_Xmile_Functions_TAN_value = getResourceOrNull(graph, URIs.Built$in_Functions_Xmile_Functions_TAN_value);