]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Fixed getting simulation playback time for diagram visualizations (refs #3701)
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 14 Sep 2012 12:54:35 +0000 (12:54 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 14 Sep 2012 12:54:35 +0000 (12:54 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25743 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/profiles/SimulationPlaybackStyle.java

index 15c9823fdcdf5dd1027eaa3f2482ea8150442c2d..35516ae868c427245aaa925864c40daa9eba6b53 100644 (file)
@@ -152,8 +152,14 @@ public class SimulationPlaybackStyle extends StyleBase<Triple<AffineTransform, D
             if(va.length == 0 || va.length == 2)\r
                 return null;\r
 \r
-            // Get playback time from the experiment\r
-            Double time = rootVariable.getPossiblePropertyValue(graph, Functions.TIME , Bindings.DOUBLE);\r
+            // Get playback time from the experiment run\r
+            Double time = null;\r
+            if(diagramVariable != null) {\r
+                Variable timeVar = diagramVariable.browsePossible(graph, "#" + Functions.TIME + "#");\r
+                if(timeVar != null)\r
+                    time = timeVar.getValue(graph, Bindings.DOUBLE);\r
+            }\r
+\r
             if(time == null)\r
                 return null;\r
 \r