]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
refs #4858
authorvillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 28 May 2014 03:24:34 +0000 (03:24 +0000)
committervillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 28 May 2014 03:24:34 +0000 (03:24 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29554 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn/scl/Sysdyn.scl
org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiments.java

index d9ea7c17ca1e71be5ed29303c24756ad2e519a33..7b48a7f45b7753970c837b54622691cb2813f403 100644 (file)
@@ -100,6 +100,7 @@ importJava "org.simantics.sysdyn.manager.SysdynExperiments" where
     run :: String -> ()\r
     saveIC :: Variable -> String -> <WriteGraph> Maybe Resource\r
     assignIC :: Variable -> String -> <WriteGraph> ()\r
+    deassignIC :: Variable -> <WriteGraph> ()\r
     applyIC :: Variable -> String -> <WriteGraph> ()\r
     deleteIC :: Variable -> String -> <WriteGraph> ()\r
 \r
index ebb8092ff75cabc721a2c4131fdc640566b786de..78d7902c86be3c7bd289a5d91347dafa52dad4c7 100644 (file)
@@ -219,6 +219,22 @@ public class SysdynExperiments {
                graph.claim(exp, SYSDYN.Experiment_ic, ic);\r
        \r
     }\r
+    \r
+    public static void deassignIC(WriteGraph graph, Variable experiment) throws DatabaseException {\r
+\r
+       System.err.println("deassignIC " + experiment.getURI(graph));\r
+\r
+               Layer0 L0 = Layer0.getInstance(graph);\r
+               SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+\r
+       Resource run = experiment.getPossibleRepresents(graph);\r
+       if(run == null) return;\r
+       Resource exp = graph.getPossibleObject(run, L0.PartOf);\r
+       if(exp == null) return;\r
+       \r
+               graph.deny(exp, SYSDYN.Experiment_ic);\r
+       \r
+    }\r
 \r
     public static void applyIC(WriteGraph graph, Variable experiment, String name) throws DatabaseException {\r
 \r