From a9fe2b5e2f385cb0556ed6fbb0f3758e8f685ac4 Mon Sep 17 00:00:00 2001 From: lempinen Date: Wed, 27 Apr 2011 09:47:03 +0000 Subject: [PATCH] Support some basic Vensim functions git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@20586 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.sysdyn.ontology/graph.tg | Bin 53694 -> 58975 bytes .../graph/VensimFunctions.pgraph | 199 ++++++++++++++++++ .../org/simantics/sysdyn/SysdynResource.java | 60 ++++++ .../contributions/FunctionLibraries.java | 33 +-- .../sysdyn/ui/project/SysdynProject.java | 47 ----- .../sysdyn/manager/FunctionUtils.java | 47 ++++- .../simantics/sysdyn/mdlImport/MdlParser.java | 3 +- .../mdlImport/mdlElements/Connection.java | 10 +- .../mdlImport/mdlElements/Function.java | 61 ++++++ .../sysdyn/mdlImport/mdlElements/Model.java | 20 +- .../sysdyn/mdlImport/mdlElements/View.java | 4 + 11 files changed, 400 insertions(+), 84 deletions(-) create mode 100644 org.simantics.sysdyn.ontology/graph/VensimFunctions.pgraph create mode 100644 org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Function.java diff --git a/org.simantics.sysdyn.ontology/graph.tg b/org.simantics.sysdyn.ontology/graph.tg index 8f0c57d871e5ab8e8b6a338b2f2fa075a137ea7b..2456f494df1875f56f76afb46b2501ea1e8a9cbc 100644 GIT binary patch literal 58975 zcmd6w378yJ_4d1aW|B2V78KLKYYx3z=bGJ2O2=Lr?e6-9r*Ui3*B> zh~kb5A}S*8JBpxyfC{d-qN3u4;=XTu?|be&r%&CCIRB65TkTRuZqgJZ6MH5C!4Wxpj$tSHJp>0rgP3o<+`*h_d zH(RAvc^F-qlh7$Q;lfgN^gmYFCDBQFRyetgHpgg|$(Y4Pr{X|##~tqoN+k2Xp? zBE-H;!Cf<>$;NVNaC@!XWTyKhGKF1F94%EVt?jv7VU9F*3?BL{z%B~U1k6@=24I%L z(*ZLT4g<_kI215l;Sj(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X6*B=E$So5siEa513P@*%J(>>)|wa&ic!y lxo%|o-D4rY^Yf`nmc-SF9G0Cub1$e|F8$s3`^8l1e*rId^T+@I diff --git a/org.simantics.sysdyn.ontology/graph/VensimFunctions.pgraph b/org.simantics.sysdyn.ontology/graph/VensimFunctions.pgraph new file mode 100644 index 00000000..18c19556 --- /dev/null +++ b/org.simantics.sysdyn.ontology/graph/VensimFunctions.pgraph @@ -0,0 +1,199 @@ + +L0 = +SYSDYN = + +VF = : SYSDYN.SysdynModelicaFunctionLibrary + +/* +VF.DELAYFIXED : SYSDYN.SysdynModelicaFunction + L0.HasDescription """DELAY FIXED( inputVar , dtime , init ) + -> delay(inputVar, dtime) + init -value is ignored.""" + SYSDYN.HasModelicaFunctionCode """ input Real inputVar; + input Real dtime; + input Real init; + input Real t = time; + output Real z; +protected + parameter Real parameterDTime = dtime; +algorithm + z := if time < parameterDTime then init else delay(inputVar, parameterDTime);""" +*/ + +VF.IFTHENELSE : SYSDYN.SysdynModelicaFunction + L0.HasDescription """IF THEN ELSE( cond , ontrue , onfalse ) + -> if cond then ontrue else onfalse""" + SYSDYN.HasModelicaFunctionCode """ input Boolean cond; + input Real ontrue; + input Real onfalse; + output Real z; +algorithm + z := if cond then ontrue else onfalse;""" + +VF.MAX : SYSDYN.SysdynModelicaFunction + L0.HasDescription """MAX(a, b) + Returns the larger of a and b.""" + SYSDYN.HasModelicaFunctionCode """ input Real a; + input Real b; + output Real z; +algorithm + z := if a > b then a else b;""" + +VF.MIN : SYSDYN.SysdynModelicaFunction + L0.HasDescription """MIN(a, b) + Returns the smaller of a and b.""" + SYSDYN.HasModelicaFunctionCode """ input Real a; + input Real b; + output Real z; +algorithm + z := if a < b then a else b;""" + +VF.XIDZ : SYSDYN.SysdynModelicaFunction + L0.HasDescription """XIDZ(a, b, x) + x if divided by zero, a/b otherwise.""" + SYSDYN.HasModelicaFunctionCode """ input Real a; + input Real b; + input Real x; + output Real z; +algorithm + z := xidz(a, b, x);""" + +VF.ZIDZ : SYSDYN.SysdynModelicaFunction + L0.HasDescription """XIDZ(a, b) + Zero if divided by zero, a/b otherwise.""" + SYSDYN.HasModelicaFunctionCode """ input Real a; + input Real b; + output Real z; +algorithm + z := zidz(a, b);""" + +VF.ABS : SYSDYN.SysdynModelicaFunction + L0.HasDescription """ABS(x) + Returns the absolute value of x.""" + SYSDYN.HasModelicaFunctionCode """ input Real x; + output Real z; +algorithm + z := abs(x);""" + +VF.SQRT : SYSDYN.SysdynModelicaFunction + L0.HasDescription """SQRT(x) + Returns the square root of x.""" + SYSDYN.HasModelicaFunctionCode """ input Real x; + output Real z; +algorithm + z := sqrt(x);""" + +VF.MODULO : SYSDYN.SysdynModelicaFunction + L0.HasDescription """MODULO(a, b) + Returns the remainder when a is divided by b. """ + SYSDYN.HasModelicaFunctionCode """ input Real a; + input Real b; + output Real z; +algorithm + z := mod(a, b);""" + +VF.PULSE : SYSDYN.SysdynModelicaFunction + L0.HasDescription """PULSE(start, width) + Returns 1.0 starting at time start and lasting for interval width. 0.0 is returned at other times.""" + SYSDYN.HasModelicaFunctionCode """ input Real start; + input Real width; + input Real t = time; + output Real z; +algorithm + z := if t >= start and (t - start) <= width then 1.0 else 0.0;""" + +VF.RAMP : SYSDYN.SysdynModelicaFunction + L0.HasDescription """RAMP(slope, startTime, endTime) + Returns 0 until the start time and then slopes upward until end time and then holds constant.""" + SYSDYN.HasModelicaFunctionCode """ input Real slope; + input Real startTime; + input Real endTime; + input Real t = time; + output Real z; +algorithm + z := + if t > startTime then + if t < endTime then + slope * (t - startTime) + else + slope * (endTime - startTime) + else + 0;""" + +VF.STEP : SYSDYN.SysdynModelicaFunction + L0.HasDescription """STEP(height, stepTime) + Returns 0.0 until the step time and then returns height.""" + SYSDYN.HasModelicaFunctionCode """ input Real height; + input Real stepTime; + input Real t = time; + output Real z; +algorithm + z := if t >= stepTime then height else 0.0;""" + +/* Continuous built-in common mathematical functions */ + +VF.EXP : SYSDYN.SysdynModelicaFunction + L0.HasDescription """ + """ + SYSDYN.HasModelicaFunctionCode """ input Real x; + output Real z; +algorithm + z := exp(x);""" + +VF.SIN : SYSDYN.SysdynModelicaFunction + L0.HasDescription """SIN(x) + Returns the sine of x.""" + SYSDYN.HasModelicaFunctionCode """ input Real x; + output Real z; +algorithm + z := sin(x);""" + +VF.SINH : SYSDYN.SysdynModelicaFunction + L0.HasDescription """SINH(x) + Returns the hyperbolic sine of x.""" + SYSDYN.HasModelicaFunctionCode """ input Real x; + output Real z; +algorithm + z := sinh(x);""" + +VF.COS : SYSDYN.SysdynModelicaFunction + L0.HasDescription """COS(x) + Returns the cosine of x.""" + SYSDYN.HasModelicaFunctionCode """ input Real x; + output Real z; +algorithm + z := cos(x);""" + +VF.COSH : SYSDYN.SysdynModelicaFunction + L0.HasDescription """COSH(x) + Returns the hyperbolic cosine of x.""" + SYSDYN.HasModelicaFunctionCode """ input Real x; + output Real z; +algorithm + z := cosh(x);""" + +VF.TAN : SYSDYN.SysdynModelicaFunction + L0.HasDescription """TAN(x) + Returns the tangent of x.""" + SYSDYN.HasModelicaFunctionCode """ input Real x; + output Real z; +algorithm + z := tan(x);""" + +VF.TANH : SYSDYN.SysdynModelicaFunction + L0.HasDescription """TANH(x) + Returns the hyperbolic tangent of x.""" + SYSDYN.HasModelicaFunctionCode """ input Real x; + output Real z; +algorithm + z := tanh(x);""" + +VF.LN : SYSDYN.SysdynModelicaFunction + L0.HasDescription """LN(x) + Returns the natural logarithm of x. + In modelica log(x) is the natural logarighm and log10(x) is base 10 logarighm.""" + SYSDYN.HasModelicaFunctionCode """ input Real x; + output Real z; +algorithm + z := log(x);""" + \ 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 5a2dfc43..5c3e87a7 100644 --- a/org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java +++ b/org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java @@ -14,6 +14,26 @@ public class SysdynResource { public final Resource AuxiliarySymbol; public final Resource BasicExperiment; public final Resource Built$in_Functions; + public final Resource Built$in_Functions_Vensim_Functions; + public final Resource Built$in_Functions_Vensim_Functions_ABS; + public final Resource Built$in_Functions_Vensim_Functions_COS; + public final Resource Built$in_Functions_Vensim_Functions_COSH; + public final Resource Built$in_Functions_Vensim_Functions_EXP; + public final Resource Built$in_Functions_Vensim_Functions_IFTHENELSE; + public final Resource Built$in_Functions_Vensim_Functions_LN; + public final Resource Built$in_Functions_Vensim_Functions_MAX; + public final Resource Built$in_Functions_Vensim_Functions_MIN; + public final Resource Built$in_Functions_Vensim_Functions_MODULO; + public final Resource Built$in_Functions_Vensim_Functions_PULSE; + public final Resource Built$in_Functions_Vensim_Functions_RAMP; + public final Resource Built$in_Functions_Vensim_Functions_SIN; + public final Resource Built$in_Functions_Vensim_Functions_SINH; + public final Resource Built$in_Functions_Vensim_Functions_SQRT; + public final Resource Built$in_Functions_Vensim_Functions_STEP; + public final Resource Built$in_Functions_Vensim_Functions_TAN; + public final Resource Built$in_Functions_Vensim_Functions_TANH; + public final Resource Built$in_Functions_Vensim_Functions_XIDZ; + public final Resource Built$in_Functions_Vensim_Functions_ZIDZ; public final Resource Built$in_Functions_interpolate; public final Resource Built$in_Functions_interpolateFull; public final Resource Built$in_Functions_xidz; @@ -156,6 +176,26 @@ public class SysdynResource { public static final String AuxiliarySymbol = "http://www.simantics.org/Sysdyn-1.0/AuxiliarySymbol"; public static final String BasicExperiment = "http://www.simantics.org/Sysdyn-1.0/BasicExperiment"; public static final String Built$in_Functions = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions"; + public static final String Built$in_Functions_Vensim_Functions = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions"; + public static final String Built$in_Functions_Vensim_Functions_ABS = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/ABS"; + public static final String Built$in_Functions_Vensim_Functions_COS = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/COS"; + public static final String Built$in_Functions_Vensim_Functions_COSH = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/COSH"; + public static final String Built$in_Functions_Vensim_Functions_EXP = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/EXP"; + public static final String Built$in_Functions_Vensim_Functions_IFTHENELSE = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/IFTHENELSE"; + public static final String Built$in_Functions_Vensim_Functions_LN = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/LN"; + public static final String Built$in_Functions_Vensim_Functions_MAX = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/MAX"; + public static final String Built$in_Functions_Vensim_Functions_MIN = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/MIN"; + public static final String Built$in_Functions_Vensim_Functions_MODULO = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/MODULO"; + public static final String Built$in_Functions_Vensim_Functions_PULSE = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/PULSE"; + public static final String Built$in_Functions_Vensim_Functions_RAMP = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/RAMP"; + public static final String Built$in_Functions_Vensim_Functions_SIN = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/SIN"; + public static final String Built$in_Functions_Vensim_Functions_SINH = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/SINH"; + public static final String Built$in_Functions_Vensim_Functions_SQRT = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/SQRT"; + public static final String Built$in_Functions_Vensim_Functions_STEP = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/STEP"; + public static final String Built$in_Functions_Vensim_Functions_TAN = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/TAN"; + public static final String Built$in_Functions_Vensim_Functions_TANH = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/TANH"; + public static final String Built$in_Functions_Vensim_Functions_XIDZ = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/XIDZ"; + public static final String Built$in_Functions_Vensim_Functions_ZIDZ = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/Vensim+Functions/ZIDZ"; public static final String Built$in_Functions_interpolate = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/interpolate"; public static final String Built$in_Functions_interpolateFull = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/interpolateFull"; public static final String Built$in_Functions_xidz = "http://www.simantics.org/Sysdyn-1.0/Built-in+Functions/xidz"; @@ -308,6 +348,26 @@ public class SysdynResource { AuxiliarySymbol = getResourceOrNull(graph, URIs.AuxiliarySymbol); BasicExperiment = getResourceOrNull(graph, URIs.BasicExperiment); Built$in_Functions = getResourceOrNull(graph, URIs.Built$in_Functions); + Built$in_Functions_Vensim_Functions = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions); + Built$in_Functions_Vensim_Functions_ABS = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_ABS); + Built$in_Functions_Vensim_Functions_COS = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_COS); + Built$in_Functions_Vensim_Functions_COSH = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_COSH); + Built$in_Functions_Vensim_Functions_EXP = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_EXP); + Built$in_Functions_Vensim_Functions_IFTHENELSE = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_IFTHENELSE); + Built$in_Functions_Vensim_Functions_LN = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_LN); + Built$in_Functions_Vensim_Functions_MAX = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_MAX); + Built$in_Functions_Vensim_Functions_MIN = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_MIN); + Built$in_Functions_Vensim_Functions_MODULO = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_MODULO); + Built$in_Functions_Vensim_Functions_PULSE = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_PULSE); + Built$in_Functions_Vensim_Functions_RAMP = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_RAMP); + Built$in_Functions_Vensim_Functions_SIN = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_SIN); + Built$in_Functions_Vensim_Functions_SINH = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_SINH); + Built$in_Functions_Vensim_Functions_SQRT = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_SQRT); + Built$in_Functions_Vensim_Functions_STEP = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_STEP); + Built$in_Functions_Vensim_Functions_TAN = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_TAN); + Built$in_Functions_Vensim_Functions_TANH = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_TANH); + Built$in_Functions_Vensim_Functions_XIDZ = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_XIDZ); + Built$in_Functions_Vensim_Functions_ZIDZ = getResourceOrNull(graph, URIs.Built$in_Functions_Vensim_Functions_ZIDZ); Built$in_Functions_interpolate = getResourceOrNull(graph, URIs.Built$in_Functions_interpolate); Built$in_Functions_interpolateFull = getResourceOrNull(graph, URIs.Built$in_Functions_interpolateFull); Built$in_Functions_xidz = getResourceOrNull(graph, URIs.Built$in_Functions_xidz); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/FunctionLibraries.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/FunctionLibraries.java index 6bebe335..cf4b0ce8 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/FunctionLibraries.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/FunctionLibraries.java @@ -13,8 +13,6 @@ package org.simantics.sysdyn.ui.browser.contributions; import java.util.ArrayList; import java.util.Collection; -import java.util.HashSet; -import java.util.Map; import org.simantics.browsing.ui.common.node.AbstractNode; import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor; @@ -23,7 +21,6 @@ import org.simantics.db.Resource; import org.simantics.db.common.request.ObjectsWithType; import org.simantics.db.exception.DatabaseException; import org.simantics.layer0.Layer0; -import org.simantics.scl.runtime.function.Function; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.ui.browser.nodes.FunctionLibraryNode; import org.simantics.sysdyn.ui.browser.nodes.FunctionNode; @@ -32,7 +29,6 @@ import org.simantics.sysdyn.ui.browser.nodes.SharedFunctionsFolder; public class FunctionLibraries extends ViewpointContributor { - @SuppressWarnings("unchecked") @Override public Collection getContribution(ReadGraph graph, FunctionsFolder functionsFolder) throws DatabaseException { @@ -47,30 +43,19 @@ public class FunctionLibraries extends ViewpointContributor { result.add(new FunctionNode(function)); } - // Find function libraries in model and sysdyn ontology - Function index = graph.adapt(L0.Dependencies, Function.class); - Collection> results = (Collection>)index.apply(graph, functionsFolder.data, "Types:SysdynModelicaFunctionLibrary"); - HashSet modelLibraries = new HashSet(); - for(Map r : results) { - Resource library = (Resource)r.get("Resource"); - if(library == null) - continue; - Resource root = graph.getPossibleObject(library, l0.PartOf); - while(!graph.isInstanceOf(root, sr.SysdynModel) && !graph.isInstanceOf(root, l0.Ontology)) { - library = root; - root = graph.getPossibleObject(library, l0.PartOf); + // Find model function libraries + for(Resource modelLibrary : graph.syncRequest(new ObjectsWithType(functionsFolder.data, l0.ConsistsOf, sr.SysdynModelicaFunctionLibrary))) { + new FunctionLibraryNode(modelLibrary); + } + + Resource sysdyn = graph.getPossibleResource("http://www.simantics.org/Sysdyn-1.0"); + if(sysdyn != null) { + for(Resource library : graph.syncRequest(new ObjectsWithType(sysdyn, l0.ConsistsOf, sr.SysdynModelicaFunctionLibrary))) { + result.add(new FunctionLibraryNode(library)); } - - // If the root is not a shared library (it is the model or sysdyn ontology) - if(graph.isInstanceOf(root, sr.SysdynModel)) - modelLibraries.add(library); } - for(Resource modelLibrary : modelLibraries) { - result.add(new FunctionLibraryNode(modelLibrary)); - } - result.add(new SharedFunctionsFolder(functionsFolder.data)); return result; diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java index fd21b27a..72c9ba73 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java @@ -26,20 +26,15 @@ import org.simantics.db.Builtins; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.Session; -import org.simantics.db.VirtualGraph; import org.simantics.db.WriteGraph; -import org.simantics.db.common.procedure.single.SingleSetSyncListener; -import org.simantics.db.common.request.ObjectsWithType; import org.simantics.db.common.request.Queries; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.common.utils.NameUtils; import org.simantics.db.common.utils.OrderedSetUtils; import org.simantics.db.exception.DatabaseException; -import org.simantics.db.layer0.adapter.GenericRelationIndex; import org.simantics.db.layer0.adapter.RuntimeValuations; import org.simantics.db.layer0.adapter.TrendVariable; import org.simantics.db.layer0.service.ActivationManager; -import org.simantics.db.layer0.util.Simantics; import org.simantics.db.request.Read; import org.simantics.db.service.GraphChangeListenerSupport; import org.simantics.db.service.LifecycleSupport; @@ -161,7 +156,6 @@ public class SysdynProject extends AbstractProjectFeature { if(g.isInstanceOf(dep, PROJ.NamespaceRequirement)) { for(Resource req : g.getObjects(dep, PROJ.RequiresNamespace)) { String uri = g.getPossibleValue(req, Bindings.STRING); - System.err.println("dep uri=" + uri); if(uri != null) { Resource target = g.getResource(uri); if(target != null) { @@ -232,7 +226,6 @@ public class SysdynProject extends AbstractProjectFeature { - final Layer0 l0 = Layer0.getInstance(session); ActivationManager activationManager = session.getService(ActivationManager.class); if (activationManager != null) { activationManager.activate(session, projectResource); @@ -240,46 +233,6 @@ public class SysdynProject extends AbstractProjectFeature { VirtualGraphSupport support = session.getService(VirtualGraphSupport.class); -// final VirtualGraph graph = session.getService(VirtualGraph.class); - -// SysdynResource SYSDYN = SysdynResource.getInstance(session); -// session.asyncRequest(new ObjectsWithType(projectResource, l0.ConsistsOf, SYSDYN.SysdynModel), new SingleSetSyncListener() { -// -// @Override -// public void add(ReadGraph g, final Resource model) throws DatabaseException { -// -// GenericRelationIndex index = g.adapt(l0.DependenciesRelation, GenericRelationIndex.class); -// index.trackAndIndex(g.getSession(), model); -// -// // FIXME: -// Simantics.async(new Runnable() { -// -// @Override -// public void run() { -// try { -// // This creates experiment realizations -// graph.register(new HistoryRealizationVirtualGraph(session, model)); -// // This creates the BaseRealization -// graph.register(new DefaultRealizationVirtualGraph(session, model)); -// } catch (DatabaseException e) { -// e.printStackTrace(); -// } -// } -// -// }); -// } -// -// @Override -// public void exception(ReadGraph graph, Throwable t) { -// t.printStackTrace(); -// } -// -// @Override -// public boolean isDisposed() { -// return false; -// } -// -// }); support.getWorkspacePersistent("experiments"); diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/FunctionUtils.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/FunctionUtils.java index 585601dd..ee40f1e8 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/FunctionUtils.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/FunctionUtils.java @@ -37,7 +37,7 @@ public class FunctionUtils { SysdynResource sr = SysdynResource.getInstance(graph); SimulationResource simu = SimulationResource.getInstance(graph); - Set parents = getParents(graph, model); + Set parents = getParents(graph, model, true); for(Resource parent : parents) { if(graph.isInstanceOf(parent, sr.SysdynModel)) { Resource configuration = graph.getPossibleObject(parent, simu.HasConfiguration); @@ -59,7 +59,7 @@ public class FunctionUtils { return paths; } - private static Set getParents(ReadGraph graph, SysdynModel model) throws DatabaseException{ + private static Set getParents(ReadGraph graph, SysdynModel model, boolean onlyWithContent) throws DatabaseException{ HashSet parents = new HashSet(); Layer0 l0 = Layer0.getInstance(graph); @@ -69,18 +69,53 @@ public class FunctionUtils { parents.add(modelResource); - Collection sharedOntologies = graph.syncRequest(new ObjectsWithType( - modelResource, l0.IsLinkedTo, sr.SharedFunctionOntology)); - parents.addAll(sharedOntologies); + for(Resource r : graph.getObjects(modelResource, l0.IsLinkedTo)) { + if(graph.isInstanceOf(r, sr.SharedFunctionOntology)) { + parents.add(r); + } else { + Collection libraries = graph.syncRequest(new ObjectsWithType( + r, l0.ConsistsOf, sr.SysdynModelicaFunctionLibrary)); + if(!libraries.isEmpty()) + parents.add(r); + } + } + + if(onlyWithContent) { + HashSet contentParents = new HashSet(); + for(Resource parent : parents) { + if(hasContent(graph, parent)) + contentParents.add(parent); + } + parents = contentParents; + } return parents; } + private static boolean hasContent(ReadGraph graph, Resource library) { + Layer0 l0 = Layer0.getInstance(graph); + SysdynResource sr = SysdynResource.getInstance(graph); + try { + if(!graph.syncRequest(new ObjectsWithType(library, l0.ConsistsOf, sr.SysdynModelicaFunction)).isEmpty()) + return true; + else { + for(Resource l : graph.syncRequest(new ObjectsWithType(library, l0.ConsistsOf, sr.SysdynModelicaFunctionLibrary))) { + boolean hasContent = hasContent(graph, l); + if(hasContent) + return true; + } + } + } catch (DatabaseException e) { + e.printStackTrace(); + } + return false; + } + public static void updateFunctionFilesForModel(ReadGraph graph, SysdynModel model) throws DatabaseException { SysdynResource sr = SysdynResource.getInstance(graph); - Set parents = getParents(graph, model); + Set parents = getParents(graph, model, false); for(Resource parent : parents) { if(graph.isInstanceOf(parent, sr.SysdynModel)) { diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/MdlParser.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/MdlParser.java index 66f44e26..2f68f086 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/MdlParser.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/MdlParser.java @@ -30,6 +30,7 @@ import org.simantics.sysdyn.mdlImport.mdlElements.Element; import org.simantics.sysdyn.mdlImport.mdlElements.EquivalenceSubscript; import org.simantics.sysdyn.mdlImport.mdlElements.Expression; import org.simantics.sysdyn.mdlImport.mdlElements.Flow; +import org.simantics.sysdyn.mdlImport.mdlElements.Function; import org.simantics.sysdyn.mdlImport.mdlElements.Model; import org.simantics.sysdyn.mdlImport.mdlElements.Stock; import org.simantics.sysdyn.mdlImport.mdlElements.Subscript; @@ -299,7 +300,7 @@ public class MdlParser { name =(nameAndData[0].replace("\"", "")); variable = getVariable(model, name); if(variable == null) { - variable = new Auxiliary(); + variable = new Function(); variable.setName(name); model.addElement(variable); } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Connection.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Connection.java index 06bde8e5..d6c64469 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Connection.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Connection.java @@ -36,11 +36,13 @@ public abstract class Connection implements IWriteableMDLObject { DiagramResource dr = DiagramResource.getInstance(graph); StructuralResource2 sr2 = StructuralResource2.getInstance(graph); - Resource diagram = graph.getSingleObject(configuration, mr.CompositeToDiagram); - - if(diagram == null) + Resource diagram = graph.getPossibleObject(configuration, mr.CompositeToDiagram); + Resource startElement = graph.getPossibleObject(start.getResource(), mr.ComponentToElement); + Resource endElement = graph.getPossibleObject(end.getResource(), mr.ComponentToElement); + if(diagram == null || startElement == null || endElement == null) return null; + if(connectionType == null) connectionType = sr.Dependency; @@ -57,12 +59,10 @@ public abstract class Connection implements IWriteableMDLObject { // Build diagram connectors and connection - Resource startElement = graph.getSingleObject(start.getResource(), mr.ComponentToElement); Resource tailConnector = GraphUtils.create2(graph, dr.Connector, sr.HasTailTerminal, startElement); - Resource endElement = graph.getSingleObject(end.getResource(), mr.ComponentToElement); Resource headConnector = GraphUtils.create2(graph, dr.Connector, sr.HasHeadTerminal, endElement, diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Function.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Function.java new file mode 100644 index 00000000..faadc02f --- /dev/null +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Function.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.mdlImport.mdlElements; + +import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.layer0.Layer0; +import org.simantics.layer0.utils.direct.GraphUtils; +import org.simantics.sysdyn.SysdynResource; +import org.simantics.sysdyn.mdlImport.ImportUtils; + +public class Function extends Variable { + + @Override + public void write(WriteGraph graph, Resource parent, double xOffset, + double yOffset) { + if(parent == null || graph == null) + return; + + try { + SysdynResource sr = SysdynResource.getInstance(graph); + if(!graph.isInstanceOf(parent, sr.SysdynModel)) + return; + Layer0 l0 = Layer0.getInstance(graph); + + Resource function = GraphUtils.create2(graph, + sr.SysdynModelicaFunction, + l0.HasName, ImportUtils.escapeName(this.getName())); + + if(comments != null && comments.length() > 0) + graph.claimLiteral(function, l0.HasDescription, comments); + + if(expressions != null && expressions.get(0) != null) { + StringBuilder sb = new StringBuilder(); + sb.append(" input Real a;\n"); + sb.append(" output Real result;\n"); + sb.append("algorithm\n"); + sb.append(" result := interpolate(a, " + expressions.get(0).getExpression() + ");"); + graph.claimLiteral(function, sr.HasModelicaFunctionCode, sb.toString()); + } + + graph.claim(parent, l0.ConsistsOf, function); + resource = function; + } catch (DatabaseException e) { + e.printStackTrace(); + } + + } + + +} diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Model.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Model.java index 011cb30b..98e00c95 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Model.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/Model.java @@ -36,6 +36,7 @@ public class Model implements IWriteableMDLObject { private HashMap elementMap = new HashMap(); private ArrayList subscripts = new ArrayList(); + private ArrayList functions = new ArrayList(); private ArrayList connections = new ArrayList(); private ArrayList views = new ArrayList(); private ArrayList unlocatedElements = new ArrayList(); @@ -43,6 +44,8 @@ public class Model implements IWriteableMDLObject { public void addElement(Element element) { if(element instanceof Subscript) addSubscript((Subscript)element); + else if(element instanceof Function) + addFunction((Function)element); else unlocatedElements.add(element); if(element.getName() != null) @@ -53,6 +56,10 @@ public class Model implements IWriteableMDLObject { subscripts.add(subscript); } + public void addFunction(Function function) { + functions.add(function); + } + public void addElement(View view, Element element) { if(element instanceof Subscript) addSubscript((Subscript)element); @@ -218,6 +225,10 @@ public class Model implements IWriteableMDLObject { // Diagram creation copied from SysdynProject. // Could the same code be reused? + + Resource sysdyn = graph.getResource("http://www.simantics.org/Sysdyn-1.0"); + Resource layer0 = graph.getResource("http://www.simantics.org/Layer0-1.0"); + Resource model = GraphUtils.create2( graph, sr.SysdynModel, @@ -225,7 +236,9 @@ public class Model implements IWriteableMDLObject { l0.HasName, getName(), l0.HasLabel, getName(), sr.HasStartTime, startTime, - sr.HasStopTime, endTime + sr.HasStopTime, endTime, + l0.IsLinkedTo, sysdyn, + l0.IsLinkedTo, layer0 ); Resource diagram = OrderedSetUtils.create(graph, sr.ConfigurationDiagram); @@ -241,6 +254,7 @@ public class Model implements IWriteableMDLObject { graph.claim(conf, mr.CompositeToDiagram, diagram); graph.claim(model, simu.HasConfiguration, conf); + graph.claim(model, l0.HasBaseRealization, conf); Resource mapping = graph.newResource(); graph.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping); @@ -290,6 +304,10 @@ public class Model implements IWriteableMDLObject { for(Connection c : connections) { c.write(graph, conf); } + + for(Function f : functions) { + f.write(graph, model, 0, 0); + } } catch (DatabaseException e) { diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/View.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/View.java index abf26b21..88fe41e6 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/View.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/mdlImport/mdlElements/View.java @@ -35,6 +35,10 @@ public class View implements IWriteableMDLObject { } public void addElement(Element e) { + if(e instanceof Subscript || + e instanceof Function) + return; + if(e.getX()maxX) -- 2.47.1