mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-19 20:57:49 -06:00
STAR-322: Extracting models to be able for converting themselves
This commit is contained in:
parent
163226f940
commit
b693b9d98f
20 changed files with 324 additions and 254 deletions
|
@ -0,0 +1,27 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
from cura.PrinterOutput.ExtruderOutputModel import ExtruderOutputModel
|
||||
from .CloudClusterPrinterConfigurationMaterial import CloudClusterPrinterConfigurationMaterial
|
||||
from ...Models import BaseModel
|
||||
|
||||
|
||||
## Class representing a cloud cluster printer configuration
|
||||
class CloudClusterPrinterConfiguration(BaseModel):
|
||||
def __init__(self, **kwargs) -> None:
|
||||
self.extruder_index = None # type: str
|
||||
self.material = None # type: CloudClusterPrinterConfigurationMaterial
|
||||
self.nozzle_diameter = None # type: str
|
||||
self.print_core_id = None # type: str
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if isinstance(self.material, dict):
|
||||
self.material = CloudClusterPrinterConfigurationMaterial(**self.material)
|
||||
|
||||
## Updates the given output model.
|
||||
# \param model - The output model to update.
|
||||
def updateOutputModel(self, model: ExtruderOutputModel) -> None:
|
||||
model.updateHotendID(self.print_core_id)
|
||||
|
||||
if model.activeMaterial is None or model.activeMaterial.guid != self.material.guid:
|
||||
material = self.material.createOutputModel()
|
||||
model.updateActiveMaterial(material)
|
Loading…
Add table
Add a link
Reference in a new issue