mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-04 04:23:58 -06:00
Added few more deprecation warnings for functions that bloat the machine manager
This commit is contained in:
parent
8907a624e1
commit
05a5f66856
3 changed files with 15 additions and 12 deletions
|
@ -202,9 +202,6 @@ class QualityManager(QObject):
|
||||||
def getQualityGroups(self, machine: "GlobalStack") -> Dict[str, QualityGroup]:
|
def getQualityGroups(self, machine: "GlobalStack") -> Dict[str, QualityGroup]:
|
||||||
machine_definition_id = getMachineDefinitionIDForQualitySearch(machine.definition)
|
machine_definition_id = getMachineDefinitionIDForQualitySearch(machine.definition)
|
||||||
|
|
||||||
# This determines if we should only get the global qualities for the global stack and skip the global qualities for the extruder stacks
|
|
||||||
has_machine_specific_qualities = machine.getHasMachineQuality()
|
|
||||||
|
|
||||||
# To find the quality container for the GlobalStack, check in the following fall-back manner:
|
# To find the quality container for the GlobalStack, check in the following fall-back manner:
|
||||||
# (1) the machine-specific node
|
# (1) the machine-specific node
|
||||||
# (2) the generic node
|
# (2) the generic node
|
||||||
|
|
|
@ -264,18 +264,18 @@ class GlobalStack(CuraContainerStack):
|
||||||
def getHeadAndFansCoordinates(self):
|
def getHeadAndFansCoordinates(self):
|
||||||
return self.getProperty("machine_head_with_fans_polygon", "value")
|
return self.getProperty("machine_head_with_fans_polygon", "value")
|
||||||
|
|
||||||
def getHasMaterials(self) -> bool:
|
@pyqtProperty(int, constant=True)
|
||||||
|
def hasMaterials(self):
|
||||||
return parseBool(self.getMetaDataEntry("has_materials", False))
|
return parseBool(self.getMetaDataEntry("has_materials", False))
|
||||||
|
|
||||||
def getHasVariants(self) -> bool:
|
@pyqtProperty(int, constant=True)
|
||||||
|
def hasVariants(self):
|
||||||
return parseBool(self.getMetaDataEntry("has_variants", False))
|
return parseBool(self.getMetaDataEntry("has_variants", False))
|
||||||
|
|
||||||
def getHasVariantsBuildPlates(self) -> bool:
|
@pyqtProperty(int, constant=True)
|
||||||
|
def hasVariantBuildplates(self) -> bool:
|
||||||
return parseBool(self.getMetaDataEntry("has_variant_buildplates", False))
|
return parseBool(self.getMetaDataEntry("has_variant_buildplates", False))
|
||||||
|
|
||||||
def getHasMachineQuality(self) -> bool:
|
|
||||||
return parseBool(self.getMetaDataEntry("has_machine_quality", False))
|
|
||||||
|
|
||||||
## Get default firmware file name if one is specified in the firmware
|
## Get default firmware file name if one is specified in the firmware
|
||||||
@pyqtSlot(result = str)
|
@pyqtSlot(result = str)
|
||||||
def getDefaultFirmwareName(self) -> str:
|
def getDefaultFirmwareName(self) -> str:
|
||||||
|
|
|
@ -538,6 +538,7 @@ class MachineManager(QObject):
|
||||||
return bool(self._printer_output_devices)
|
return bool(self._printer_output_devices)
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
|
||||||
|
@deprecated("use Cura.MachineManager.activeMachine.configuredConnectionTypes instead", "4.2")
|
||||||
def activeMachineHasRemoteConnection(self) -> bool:
|
def activeMachineHasRemoteConnection(self) -> bool:
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
has_remote_connection = False
|
has_remote_connection = False
|
||||||
|
@ -816,21 +817,24 @@ class MachineManager(QObject):
|
||||||
self.removeMachine(hidden_containers[0].getId())
|
self.removeMachine(hidden_containers[0].getId())
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = globalContainerChanged)
|
@pyqtProperty(bool, notify = globalContainerChanged)
|
||||||
|
@deprecated("use Cura.MachineManager.activeMachine.hasMaterials instead", "4.2")
|
||||||
def hasMaterials(self) -> bool:
|
def hasMaterials(self) -> bool:
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
return self._global_container_stack.getHasMaterials()
|
return self._global_container_stack.hasMaterials
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = globalContainerChanged)
|
@pyqtProperty(bool, notify = globalContainerChanged)
|
||||||
|
@deprecated("use Cura.MachineManager.activeMachine.hasVariants instead", "4.2")
|
||||||
def hasVariants(self) -> bool:
|
def hasVariants(self) -> bool:
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
return self._global_container_stack.getHasVariants()
|
return self._global_container_stack.hasVariants
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = globalContainerChanged)
|
@pyqtProperty(bool, notify = globalContainerChanged)
|
||||||
|
@deprecated("use Cura.MachineManager.activeMachine.hasVariantBuildplates instead", "4.2")
|
||||||
def hasVariantBuildplates(self) -> bool:
|
def hasVariantBuildplates(self) -> bool:
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
return self._global_container_stack.getHasVariantsBuildPlates()
|
return self._global_container_stack.hasVariantBuildplates
|
||||||
return False
|
return False
|
||||||
|
|
||||||
## The selected buildplate is compatible if it is compatible with all the materials in all the extruders
|
## The selected buildplate is compatible if it is compatible with all the materials in all the extruders
|
||||||
|
@ -984,6 +988,7 @@ class MachineManager(QObject):
|
||||||
self.forceUpdateAllSettings()
|
self.forceUpdateAllSettings()
|
||||||
|
|
||||||
@pyqtSlot(int, result = QObject)
|
@pyqtSlot(int, result = QObject)
|
||||||
|
@deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2")
|
||||||
def getExtruder(self, position: int) -> Optional[ExtruderStack]:
|
def getExtruder(self, position: int) -> Optional[ExtruderStack]:
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
return self._global_container_stack.extruders.get(str(position))
|
return self._global_container_stack.extruders.get(str(position))
|
||||||
|
@ -1097,6 +1102,7 @@ class MachineManager(QObject):
|
||||||
container.removeInstance(setting_name)
|
container.removeInstance(setting_name)
|
||||||
|
|
||||||
@pyqtProperty("QVariantList", notify = globalContainerChanged)
|
@pyqtProperty("QVariantList", notify = globalContainerChanged)
|
||||||
|
@deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2")
|
||||||
def currentExtruderPositions(self) -> List[str]:
|
def currentExtruderPositions(self) -> List[str]:
|
||||||
if self._global_container_stack is None:
|
if self._global_container_stack is None:
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue