]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Fixed storing of array parameters into ICs
authorvillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Sat, 13 Sep 2014 19:52:39 +0000 (19:52 +0000)
committervillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Sat, 13 Sep 2014 19:52:39 +0000 (19:52 +0000)
refs #5301

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

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

index 7b918f149aab102566a6554ddd39fccb32a81382..a2d35c7dd1273cc819f10bc5d24a69613797d3c4 100644 (file)
@@ -155,7 +155,6 @@ public class SysdynExperiments {
 \r
        private static void processChild(ReadGraph graph, Variable child, PartialIC IC) throws DatabaseException {\r
                \r
-               System.err.println("processChild " + child.getURI(graph));\r
                StructuralResource2 STR = StructuralResource2.getInstance(graph);\r
                \r
                for(Variable c : child.getChildren(graph)) {\r
@@ -174,7 +173,9 @@ public class SysdynExperiments {
                SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
                \r
                Collection<Resource> exprs = graph.syncRequest(new ObjectsWithType(represents, L0.ConsistsOf, SYSDYN.ParameterExpression));\r
-               if(exprs.size() == 0) return;\r
+               if(exprs.size() == 0) {\r
+                       if(graph.hasStatement(represents, SYSDYN.Variable_isHeadOf)) return;\r
+               }\r
                        \r
                Variable v = values.getPossibleProperty(graph, "");\r
                if(v == null) return;\r
@@ -188,7 +189,7 @@ public class SysdynExperiments {
                        if(target != null && ds.length > 0) {\r
                                RVI rvi = target.getRVI(graph);\r
                                double initial = ds[0];\r
-                               System.err.println("rvi=" + rvi + " value=" + initial);\r
+//                             System.err.println("rvi=" + rvi + " value=" + initial);\r
                                IC.add(rvi, Variant.ofInstance(initial));\r
                        }\r
                }\r
@@ -301,8 +302,6 @@ public class SysdynExperiments {
 \r
     public static void applyIC(WriteGraph graph, Variable experiment, String name) throws DatabaseException {\r
 \r
-       System.err.println("applyIC " + experiment.getURI(graph));\r
-\r
                Layer0 L0 = Layer0.getInstance(graph);\r
                SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
 \r