mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Update colour scheme limits if visibility changed the limits
If the user makes certain structures visible or invisible, and this then causes the limits of the colour scheme to change, this now triggers the layer view to be re-rendered and updates the legend in the simulation view menu component.
This commit is contained in:
parent
424f037dca
commit
9f902f7a7a
3 changed files with 39 additions and 19 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Copyright (c) 2021 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
|
@ -28,6 +28,7 @@ class SimulationViewProxy(QObject):
|
|||
globalStackChanged = pyqtSignal()
|
||||
preferencesChanged = pyqtSignal()
|
||||
busyChanged = pyqtSignal()
|
||||
colorSchemeLimitsChanged = pyqtSignal()
|
||||
|
||||
@pyqtProperty(bool, notify=activityChanged)
|
||||
def layerActivity(self):
|
||||
|
@ -101,28 +102,28 @@ class SimulationViewProxy(QObject):
|
|||
def getSimulationRunning(self):
|
||||
return self._simulation_view.isSimulationRunning()
|
||||
|
||||
@pyqtSlot(result=float)
|
||||
def getMinFeedrate(self):
|
||||
@pyqtProperty(float, notify = colorSchemeLimitsChanged)
|
||||
def minFeedrate(self):
|
||||
return self._simulation_view.getMinFeedrate()
|
||||
|
||||
@pyqtSlot(result=float)
|
||||
def getMaxFeedrate(self):
|
||||
@pyqtProperty(float, notify = colorSchemeLimitsChanged)
|
||||
def maxFeedrate(self):
|
||||
return self._simulation_view.getMaxFeedrate()
|
||||
|
||||
@pyqtSlot(result=float)
|
||||
def getMinThickness(self):
|
||||
@pyqtProperty(float, notify = colorSchemeLimitsChanged)
|
||||
def minThickness(self):
|
||||
return self._simulation_view.getMinThickness()
|
||||
|
||||
@pyqtSlot(result=float)
|
||||
def getMaxThickness(self):
|
||||
@pyqtProperty(float, notify = colorSchemeLimitsChanged)
|
||||
def maxThickness(self):
|
||||
return self._simulation_view.getMaxThickness()
|
||||
|
||||
@pyqtSlot(result=float)
|
||||
def getMaxLineWidth(self):
|
||||
@pyqtProperty(float, notify = colorSchemeLimitsChanged)
|
||||
def maxLineWidth(self):
|
||||
return self._simulation_view.getMaxLineWidth()
|
||||
|
||||
@pyqtSlot(result=float)
|
||||
def getMinLineWidth(self):
|
||||
@pyqtProperty(float, notify = colorSchemeLimitsChanged)
|
||||
def minLineWidth(self):
|
||||
return self._simulation_view.getMinLineWidth()
|
||||
|
||||
# Opacity 0..1
|
||||
|
@ -153,6 +154,9 @@ class SimulationViewProxy(QObject):
|
|||
self.currentLayerChanged.emit()
|
||||
self._layerActivityChanged()
|
||||
|
||||
def _onColorSchemeLimitsChanged(self):
|
||||
self.colorSchemeLimitsChanged.emit()
|
||||
|
||||
def _onPathChanged(self):
|
||||
self.currentPathChanged.emit()
|
||||
self._layerActivityChanged()
|
||||
|
@ -182,6 +186,7 @@ class SimulationViewProxy(QObject):
|
|||
active_view = self._controller.getActiveView()
|
||||
if active_view == self._simulation_view:
|
||||
self._simulation_view.currentLayerNumChanged.connect(self._onLayerChanged)
|
||||
self._simulation_view.colorSchemeLimitsChanged.connect(self._onColorSchemeLimitsChanged)
|
||||
self._simulation_view.currentPathNumChanged.connect(self._onPathChanged)
|
||||
self._simulation_view.maxLayersChanged.connect(self._onMaxLayersChanged)
|
||||
self._simulation_view.maxPathsChanged.connect(self._onMaxPathsChanged)
|
||||
|
@ -194,6 +199,7 @@ class SimulationViewProxy(QObject):
|
|||
# Disconnect all of em again.
|
||||
self.is_simulationView_selected = False
|
||||
self._simulation_view.currentLayerNumChanged.disconnect(self._onLayerChanged)
|
||||
self._simulation_view.colorSchemeLimitsChanged.connect(self._onColorSchemeLimitsChanged)
|
||||
self._simulation_view.currentPathNumChanged.disconnect(self._onPathChanged)
|
||||
self._simulation_view.maxLayersChanged.disconnect(self._onMaxLayersChanged)
|
||||
self._simulation_view.maxPathsChanged.disconnect(self._onMaxPathsChanged)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue