From: villberg Date: Wed, 28 May 2014 03:24:34 +0000 (+0000) Subject: refs #4858 X-Git-Tag: 1.8.1~42 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=553e2571ce4a234747532c0d2d3c34e895b595c7;p=simantics%2Fsysdyn.git refs #4858 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29554 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn/scl/Sysdyn.scl b/org.simantics.sysdyn/scl/Sysdyn.scl index d9ea7c17..7b48a7f4 100644 --- a/org.simantics.sysdyn/scl/Sysdyn.scl +++ b/org.simantics.sysdyn/scl/Sysdyn.scl @@ -100,6 +100,7 @@ importJava "org.simantics.sysdyn.manager.SysdynExperiments" where run :: String -> () saveIC :: Variable -> String -> Maybe Resource assignIC :: Variable -> String -> () + deassignIC :: Variable -> () applyIC :: Variable -> String -> () deleteIC :: Variable -> String -> () diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiments.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiments.java index ebb8092f..78d7902c 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiments.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiments.java @@ -219,6 +219,22 @@ public class SysdynExperiments { graph.claim(exp, SYSDYN.Experiment_ic, ic); } + + public static void deassignIC(WriteGraph graph, Variable experiment) throws DatabaseException { + + System.err.println("deassignIC " + experiment.getURI(graph)); + + Layer0 L0 = Layer0.getInstance(graph); + SysdynResource SYSDYN = SysdynResource.getInstance(graph); + + Resource run = experiment.getPossibleRepresents(graph); + if(run == null) return; + Resource exp = graph.getPossibleObject(run, L0.PartOf); + if(exp == null) return; + + graph.deny(exp, SYSDYN.Experiment_ic); + + } public static void applyIC(WriteGraph graph, Variable experiment, String name) throws DatabaseException {