From c8eeb737bb403b463604dbc5b37075848c26ea82 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 7 Sep 2018 15:45:31 +0200 Subject: [PATCH] Automatically stop simulation when the user manually changes the layer (as opposed to the sim. itself). [CURA-5677] --- plugins/SimulationView/SimulationView.qml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/plugins/SimulationView/SimulationView.qml b/plugins/SimulationView/SimulationView.qml index be767e93ab..6de5134fc7 100644 --- a/plugins/SimulationView/SimulationView.qml +++ b/plugins/SimulationView/SimulationView.qml @@ -666,9 +666,21 @@ Item Connections { target: UM.SimulationView - onMaxLayersChanged: layerSlider.setUpperValue(UM.SimulationView.currentLayer) - onMinimumLayerChanged: layerSlider.setLowerValue(UM.SimulationView.minimumLayer) - onCurrentLayerChanged: layerSlider.setUpperValue(UM.SimulationView.currentLayer) + onMaxLayersChanged: + { + playButton.pauseSimulation() + layerSlider.setUpperValue(UM.SimulationView.currentLayer) + } + onMinimumLayerChanged: + { + playButton.pauseSimulation() + layerSlider.setLowerValue(UM.SimulationView.minimumLayer) + } + onCurrentLayerChanged: + { + playButton.pauseSimulation() + layerSlider.setUpperValue(UM.SimulationView.currentLayer) + } } // make sure the slider handlers show the correct value after switching views @@ -723,6 +735,7 @@ Item UM.SimulationView.setSimulationRunning(true) iconSource = "./resources/simulation_pause.svg" simulationTimer.start() + status = 1 } } @@ -766,6 +779,7 @@ Item { UM.SimulationView.setCurrentLayer(currentLayer+1) UM.SimulationView.setCurrentPath(0) + playButton.resumeSimulation() } } else