]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
(fixes #5474) Changes in experiment state not applied in order because reads are...
authorjussi.koskela <jussi.koskela@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 12 Nov 2014 11:32:10 +0000 (11:32 +0000)
committerjussi.koskela <jussi.koskela@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 12 Nov 2014 11:32:10 +0000 (11:32 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30543 ac1ea38d-2e2b-0410-8846-a27921b304fc

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

index 9f1332c22d3903caa8ab25e2133666ab6f21d871..8ebfb23f8aa26aeedda8d8808e496c710e428307 100644 (file)
@@ -699,42 +699,35 @@ public class OldSysdynExperiment extends SysdynExperiment {
     }\r
 \r
     protected void setSysdynExperimentState(final ExperimentState state) {\r
-        sysdynExperimentState = state;\r
-        session.asyncRequest(new ReadRequest() {\r
-\r
-            @Override\r
-            public void run(ReadGraph graph) throws DatabaseException {\r
-                VirtualGraphSupport support = graph.getService(VirtualGraphSupport.class);\r
-                final Session session = graph.getSession();\r
-                session.asyncRequest(new WriteRequest(support.getWorkspacePersistent("experiments")) {\r
-                    @Override\r
-                    public void perform(WriteGraph graph) throws DatabaseException {\r
-                        Layer0 L0 = Layer0.getInstance(graph);\r
-                        SimulationResource SR = SimulationResource.getInstance(graph);\r
-                        graph.deny(model, SR.HasExperimentState);\r
-                        graph.deny(experiment, SR.HasExperimentState);\r
-\r
-                        Resource st = graph.newResource();\r
-                        switch(state) {\r
-                            case INITIALIZING:\r
-                                graph.claim(st, L0.InstanceOf, SR.ExperimentState_Initializing);\r
-                                break;\r
-                            case RUNNING:\r
-                                graph.claim(st, L0.InstanceOf, SR.ExperimentState_Running);\r
-                                break;\r
-                            case STOPPED:\r
-                                graph.claim(st, L0.InstanceOf, SR.ExperimentState_Stopped);\r
-                                break;\r
-                            case DISPOSED:\r
-                                graph.claim(st, L0.InstanceOf, SR.ExperimentState_Disposed);\r
-                                break;\r
-                        }\r
-\r
-                        graph.claim(model, SR.HasExperimentState, st);\r
-                        graph.claim(experiment, SR.HasExperimentState, st);\r
-                    }});\r
-            }\r
-        });\r
+       sysdynExperimentState = state;\r
+       VirtualGraphSupport support = session.getService(VirtualGraphSupport.class);\r
+       session.asyncRequest(new WriteRequest(support.getWorkspacePersistent("experiments")) {\r
+               @Override\r
+               public void perform(WriteGraph graph) throws DatabaseException {\r
+                       Layer0 L0 = Layer0.getInstance(graph);\r
+                       SimulationResource SR = SimulationResource.getInstance(graph);\r
+                       graph.deny(model, SR.HasExperimentState);\r
+                       graph.deny(experiment, SR.HasExperimentState);\r
+\r
+                       Resource st = graph.newResource();\r
+                       switch(state) {\r
+                       case INITIALIZING:\r
+                               graph.claim(st, L0.InstanceOf, SR.ExperimentState_Initializing);\r
+                               break;\r
+                       case RUNNING:\r
+                               graph.claim(st, L0.InstanceOf, SR.ExperimentState_Running);\r
+                               break;\r
+                       case STOPPED:\r
+                               graph.claim(st, L0.InstanceOf, SR.ExperimentState_Stopped);\r
+                               break;\r
+                       case DISPOSED:\r
+                               graph.claim(st, L0.InstanceOf, SR.ExperimentState_Disposed);\r
+                               break;\r
+                       }\r
+\r
+                       graph.claim(model, SR.HasExperimentState, st);\r
+                       graph.claim(experiment, SR.HasExperimentState, st);\r
+               }});\r
     }\r
 \r
     /**\r
@@ -909,13 +902,13 @@ public class OldSysdynExperiment extends SysdynExperiment {
 \r
     @Override\r
     public void simulateDuration(double duration) {\r
-        System.out.println("simulateDuartion");\r
+\r
     }\r
 \r
 \r
     @Override\r
     public void rewindTo(double time) {\r
-        System.out.println("rewindTo");\r
+\r
     }\r
 \r
 }\r