From 403010aa90184a7977648d0d0701791ef5d33a1b Mon Sep 17 00:00:00 2001 From: Marijn Dee Date: Thu, 20 Dec 2018 16:32:00 +0100 Subject: [PATCH 1/4] Mirrored the changes made to the models in Commons --- .../Cloud/Models/CloudClusterBuildPlate.py | 13 +++++ ... => CloudClusterPrintCoreConfiguration.py} | 5 +- ...CloudClusterPrintJobConfigurationChange.py | 28 +++++++++ .../Models/CloudClusterPrintJobImpediment.py | 15 +++++ .../Models/CloudClusterPrintJobStatus.py | 58 ++++++++++++++++--- .../Cloud/Models/CloudClusterPrinterStatus.py | 20 +++++-- 6 files changed, 124 insertions(+), 15 deletions(-) create mode 100644 plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterBuildPlate.py rename plugins/UM3NetworkPrinting/src/Cloud/Models/{CloudClusterPrinterConfiguration.py => CloudClusterPrintCoreConfiguration.py} (92%) create mode 100644 plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobConfigurationChange.py create mode 100644 plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobImpediment.py diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterBuildPlate.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterBuildPlate.py new file mode 100644 index 0000000000..4386bbb435 --- /dev/null +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterBuildPlate.py @@ -0,0 +1,13 @@ +# Copyright (c) 2018 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. +from .BaseCloudModel import BaseCloudModel + + +## Class representing a cluster printer +# Spec: https://api-staging.ultimaker.com/connect/v1/spec +class CloudClusterBuildPlate(BaseCloudModel): + ## Create a new build plate + # \param type: The type of buildplate glass or aluminium + def __init__(self, type: str = "glass", **kwargs) -> None: + self.type = type + super().__init__(**kwargs) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterConfiguration.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintCoreConfiguration.py similarity index 92% rename from plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterConfiguration.py rename to plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintCoreConfiguration.py index 3e06d0e2e7..7454401d09 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterConfiguration.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintCoreConfiguration.py @@ -10,7 +10,7 @@ from .BaseCloudModel import BaseCloudModel ## Class representing a cloud cluster printer configuration # Spec: https://api-staging.ultimaker.com/connect/v1/spec -class CloudClusterPrinterConfiguration(BaseCloudModel): +class CloudClusterPrintCoreConfiguration(BaseCloudModel): ## Creates a new cloud cluster printer configuration object # \param extruder_index: The position of the extruder on the machine as list index. Numbered from left to right. # \param material: The material of a configuration object in a cluster printer. May be in a dict or an object. @@ -18,10 +18,9 @@ class CloudClusterPrinterConfiguration(BaseCloudModel): # \param print_core_id: The type of print core inserted at this position, e.g. 'AA 0.4'. def __init__(self, extruder_index: int, material: Union[None, Dict[str, Any], CloudClusterPrinterConfigurationMaterial], - nozzle_diameter: Optional[str] = None, print_core_id: Optional[str] = None, **kwargs) -> None: + print_core_id: Optional[str] = None, **kwargs) -> None: self.extruder_index = extruder_index self.material = self.parseModel(CloudClusterPrinterConfigurationMaterial, material) if material else None - self.nozzle_diameter = nozzle_diameter self.print_core_id = print_core_id super().__init__(**kwargs) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobConfigurationChange.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobConfigurationChange.py new file mode 100644 index 0000000000..6c02972757 --- /dev/null +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobConfigurationChange.py @@ -0,0 +1,28 @@ +# Copyright (c) 2018 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. +from typing import Optional + +from .BaseCloudModel import BaseCloudModel + + +## Model for the types of changes that are needed before a print job can start +# Spec: https://api-staging.ultimaker.com/connect/v1/spec +class CloudClusterPrintJobConfigurationChange(BaseCloudModel): + ## Creates a new print job constraint. + # \param type_of_change: The type of configuration change, one of: "material", "print_core_change" + # \param index: The hotend slot or extruder index to change + # \param target_id: Target material guid or hotend id + # \param origin_id: Original/current material guid or hotend id + # \param target_name: Target material name or hotend id + # \param origin_name: Original/current material name or hotend id + def __init__(self, type_of_change: Optional[str] = None, index: Optional[int] = None, + target_id: Optional[str] = None,origin_id: Optional[str] = None, + target_name: Optional[str] = None,origin_name: Optional[str] = None, + **kwargs) -> None: + self.type_of_change = type_of_change + self.index = index + self.target_id = target_id + self.origin_id = origin_id + self.target_name = target_name + self.origin_name = origin_name + super().__init__(**kwargs) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobImpediment.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobImpediment.py new file mode 100644 index 0000000000..12b67996c1 --- /dev/null +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobImpediment.py @@ -0,0 +1,15 @@ +# Copyright (c) 2018 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. +from .BaseCloudModel import BaseCloudModel + + +## Class representing the reasons that prevent this job from being printed on the associated printer +# Spec: https://api-staging.ultimaker.com/connect/v1/spec +class CloudClusterPrintJobImpediment(BaseCloudModel): + ## Creates a new print job constraint. + # \param translation_key: A string indicating a reason the print cannot be printed, such as 'does_not_fit_in_build_volume' + # \param severity: A number indicating the severity of the problem, with higher being more severe + def __init__(self, translation_key: str, severity: int, **kwargs) -> None: + self.translation_key = translation_key + self.severity = severity + super().__init__(**kwargs) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py index f451665a4f..4b70d191e4 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py @@ -4,11 +4,14 @@ from typing import List, Optional, Union, Dict, Any from cura.PrinterOutput.ConfigurationModel import ConfigurationModel from plugins.UM3NetworkPrinting.src.Cloud.CloudOutputController import CloudOutputController -from .CloudClusterPrinterConfiguration import CloudClusterPrinterConfiguration +from src.ConfigurationChangeModel import ConfigurationChangeModel +from .CloudClusterBuildPlate import CloudClusterBuildPlate +from .CloudClusterPrintJobConfigurationChange import CloudClusterPrintJobConfigurationChange +from .CloudClusterPrintJobImpediment import CloudClusterPrintJobImpediment +from .CloudClusterPrintCoreConfiguration import CloudClusterPrintCoreConfiguration from .CloudClusterPrintJobConstraint import CloudClusterPrintJobConstraints from .BaseCloudModel import BaseCloudModel - ## Class representing a print job from plugins.UM3NetworkPrinting.src.UM3PrintJobOutputModel import UM3PrintJobOutputModel @@ -34,15 +37,29 @@ class CloudClusterPrintJobStatus(BaseCloudModel): # \param time_elapsed: The remaining printing time in seconds. # \param time_total: The total printing time in seconds. # \param uuid: UUID of this print job. Should be used for identification purposes. + # \param deleted_at: The time when this print job was deleted. + # \param printed_on_uuid: UUID of the printer used to print this job. + # \param configuration_changes_required: List of configuration changes the printer this job is associated with + # needs to make in order to be able to print this job + # \param build_plate: The build plate (type) this job needs to be printed on. + # \param compatible_machine_families: Family names of machines suitable for this print job + # \param impediments_to_printing: A list of reasons that prevent this job from being printed on the associated + # printer def __init__(self, created_at: str, force: bool, machine_variant: str, name: str, started: bool, status: str, time_total: int, uuid: str, - configuration: List[Union[Dict[str, Any], CloudClusterPrinterConfiguration]], + configuration: List[Union[Dict[str, Any], CloudClusterPrintCoreConfiguration]], constraints: List[Union[Dict[str, Any], CloudClusterPrintJobConstraints]], last_seen: Optional[float] = None, network_error_count: Optional[int] = None, owner: Optional[str] = None, printer_uuid: Optional[str] = None, time_elapsed: Optional[int] = None, - assigned_to: Optional[str] = None, **kwargs) -> None: + assigned_to: Optional[str] = None, deleted_at: Optional[str] = None, + printed_on_uuid: Optional[str] = None, + configuration_changes_required: List[ + Union[Dict[str, Any], CloudClusterPrintJobConfigurationChange]] = None, + build_plate: Optional[str] = None, compatible_machine_families: List[str] = None, + impediments_to_printing: List[Union[Dict[str, Any], CloudClusterPrintJobImpediment]] = None, + **kwargs) -> None: self.assigned_to = assigned_to - self.configuration = self.parseModels(CloudClusterPrinterConfiguration, configuration) + self.configuration = self.parseModels(CloudClusterPrintCoreConfiguration, configuration) self.constraints = self.parseModels(CloudClusterPrintJobConstraints, constraints) self.created_at = created_at self.force = force @@ -57,6 +74,14 @@ class CloudClusterPrintJobStatus(BaseCloudModel): self.time_elapsed = time_elapsed self.time_total = time_total self.uuid = uuid + self.deleted_at = deleted_at + self.printed_on_uuid = printed_on_uuid + self.configuration_changes_required = self.parseModels(CloudClusterPrintJobConfigurationChange, + configuration_changes_required) + self.build_plate = self.parseModel(CloudClusterBuildPlate, build_plate) + self.compatible_machine_families = compatible_machine_families + self.impediments_to_printing = self.parseModels(CloudClusterPrintJobImpediment, impediments_to_printing) + super().__init__(**kwargs) ## Creates an UM3 print job output model based on this cloud cluster print job. @@ -77,11 +102,28 @@ class CloudClusterPrintJobStatus(BaseCloudModel): ## Updates an UM3 print job output model based on this cloud cluster print job. # \param model: The model to update. def updateOutputModel(self, model: UM3PrintJobOutputModel) -> None: - # TODO: Add `compatible_machine_families` to the cloud, than add model.setCompatibleMachineFamilies() - # TODO: Add `impediments_to_printing` to the cloud, see ClusterUM3OutputDevice._updatePrintJob - # TODO: Use model.updateConfigurationChanges, see ClusterUM3OutputDevice#_createConfigurationChanges model.updateConfiguration(self._createConfigurationModel()) model.updateTimeTotal(self.time_total) model.updateTimeElapsed(self.time_elapsed) model.updateOwner(self.owner) model.updateState(self.status) + model.setCompatibleMachineFamilies(self.compatible_machine_families) + model.updateTimeTotal(self.time_total) + model.updateTimeElapsed(self.time_elapsed) + model.updateOwner(self.owner) + + status_set_by_impediment = False + for impediment in self.impediments_to_printing: + if impediment.severity == "UNFIXABLE": # TODO: impediment.severity is defined as int, this will not work, is there a translation? + status_set_by_impediment = True + model.updateState("error") + break + + if not status_set_by_impediment: + model.updateState(self.status) + + model.updateConfigurationChanges([ConfigurationChangeModel(type_of_change=change.type_of_change, + index=change.index, + target_name=change.target_name, + origin_name=change.origin_name) + for change in self.configuration_changes_required]) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterStatus.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterStatus.py index cd3b6bbdca..23409a761d 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterStatus.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterStatus.py @@ -4,7 +4,8 @@ from typing import List, Union, Dict, Optional, Any from cura.PrinterOutput.PrinterOutputController import PrinterOutputController from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel -from .CloudClusterPrinterConfiguration import CloudClusterPrinterConfiguration +from .CloudClusterBuildPlate import CloudClusterBuildPlate +from .CloudClusterPrintCoreConfiguration import CloudClusterPrintCoreConfiguration from .BaseCloudModel import BaseCloudModel @@ -22,12 +23,19 @@ class CloudClusterPrinterStatus(BaseCloudModel): # \param uuid: The unique ID of the printer, also known as GUID. # \param configuration: The active print core configurations of this printer. # \param reserved_by: A printer can be claimed by a specific print job. + # \param maintenance_required: Indicates if maintenance is necessary + # \param firmware_update_status: Whether the printer's firmware is up-to-date, value is one of: "up_to_date", + # "pending_update", "update_available", "update_in_progress", "update_failed", "update_impossible" + # \param latest_available_firmware: The version of the latest firmware that is available + # \param build_plate: The build plate that is on the printer def __init__(self, enabled: bool, firmware_version: str, friendly_name: str, ip_address: str, machine_variant: str, status: str, unique_name: str, uuid: str, - configuration: List[Union[Dict[str, Any], CloudClusterPrinterConfiguration]], - reserved_by: Optional[str] = None, **kwargs) -> None: + configuration: List[Union[Dict[str, Any], CloudClusterPrintCoreConfiguration]], + reserved_by: Optional[str] = None, maintenance_required: Optional[bool] = None, + firmware_update_status: Optional[str] = None, latest_available_firmware: Optional[str] = None, + build_plate: Optional[str] = None, **kwargs) -> None: - self.configuration = self.parseModels(CloudClusterPrinterConfiguration, configuration) + self.configuration = self.parseModels(CloudClusterPrintCoreConfiguration, configuration) self.enabled = enabled self.firmware_version = firmware_version self.friendly_name = friendly_name @@ -37,6 +45,10 @@ class CloudClusterPrinterStatus(BaseCloudModel): self.unique_name = unique_name self.uuid = uuid self.reserved_by = reserved_by + self.maintenance_required = maintenance_required + self.firmware_update_status = firmware_update_status + self.latest_available_firmware = latest_available_firmware + self.build_plate = self.parseModel(CloudClusterBuildPlate, build_plate) super().__init__(**kwargs) ## Creates a new output model. From 9d27c29c8ccd5bc09d54dd9f0a90f474cf643c18 Mon Sep 17 00:00:00 2001 From: Marijn Dee Date: Thu, 20 Dec 2018 17:04:17 +0100 Subject: [PATCH 2/4] Fixed indentation and relative import, tests still fail though --- .../src/Cloud/Models/CloudClusterPrintJobStatus.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py index 4b70d191e4..5b7ef7c18a 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py @@ -4,7 +4,7 @@ from typing import List, Optional, Union, Dict, Any from cura.PrinterOutput.ConfigurationModel import ConfigurationModel from plugins.UM3NetworkPrinting.src.Cloud.CloudOutputController import CloudOutputController -from src.ConfigurationChangeModel import ConfigurationChangeModel +from plugins.UM3NetworkPrinting.src.ConfigurationChangeModel import ConfigurationChangeModel from .CloudClusterBuildPlate import CloudClusterBuildPlate from .CloudClusterPrintJobConfigurationChange import CloudClusterPrintJobConfigurationChange from .CloudClusterPrintJobImpediment import CloudClusterPrintJobImpediment @@ -122,8 +122,10 @@ class CloudClusterPrintJobStatus(BaseCloudModel): if not status_set_by_impediment: model.updateState(self.status) - model.updateConfigurationChanges([ConfigurationChangeModel(type_of_change=change.type_of_change, - index=change.index, - target_name=change.target_name, - origin_name=change.origin_name) - for change in self.configuration_changes_required]) + model.updateConfigurationChanges( + [ConfigurationChangeModel( + type_of_change=change.type_of_change, + index=change.index, + target_name=change.target_name, + origin_name=change.origin_name) + for change in self.configuration_changes_required]) From 131211e604bed58b719f6f017d44d0fbb68d15b8 Mon Sep 17 00:00:00 2001 From: Marijn Dee Date: Fri, 21 Dec 2018 09:42:28 +0100 Subject: [PATCH 3/4] Fixed the unit tests --- .../src/Cloud/Models/CloudClusterPrintJobStatus.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py index 5b7ef7c18a..b1672f362e 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py @@ -76,11 +76,17 @@ class CloudClusterPrintJobStatus(BaseCloudModel): self.uuid = uuid self.deleted_at = deleted_at self.printed_on_uuid = printed_on_uuid - self.configuration_changes_required = self.parseModels(CloudClusterPrintJobConfigurationChange, - configuration_changes_required) + if configuration_changes_required: + self.configuration_changes_required = self.parseModels(CloudClusterPrintJobConfigurationChange, + configuration_changes_required) + else: + self.configuration_changes_required = [] self.build_plate = self.parseModel(CloudClusterBuildPlate, build_plate) self.compatible_machine_families = compatible_machine_families - self.impediments_to_printing = self.parseModels(CloudClusterPrintJobImpediment, impediments_to_printing) + if impediments_to_printing: + self.impediments_to_printing = self.parseModels(CloudClusterPrintJobImpediment, impediments_to_printing) + else: + self.impediments_to_printing = [] super().__init__(**kwargs) From 12a4a5e9f54ba62b6c2eb1f6df8e1a28c8441506 Mon Sep 17 00:00:00 2001 From: Marijn Dee Date: Fri, 21 Dec 2018 15:06:02 +0100 Subject: [PATCH 4/4] Fixing the rest of the automatic test failures --- ...CloudClusterPrintJobConfigurationChange.py | 5 ++- .../Models/CloudClusterPrintJobStatus.py | 35 +++++++++---------- .../Cloud/Models/CloudClusterPrinterStatus.py | 4 +-- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobConfigurationChange.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobConfigurationChange.py index 6c02972757..9ff4154666 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobConfigurationChange.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobConfigurationChange.py @@ -15,9 +15,8 @@ class CloudClusterPrintJobConfigurationChange(BaseCloudModel): # \param origin_id: Original/current material guid or hotend id # \param target_name: Target material name or hotend id # \param origin_name: Original/current material name or hotend id - def __init__(self, type_of_change: Optional[str] = None, index: Optional[int] = None, - target_id: Optional[str] = None,origin_id: Optional[str] = None, - target_name: Optional[str] = None,origin_name: Optional[str] = None, + def __init__(self, type_of_change: str, target_id: str, origin_id: str, + index: Optional[int] = None, target_name: Optional[str] = None, origin_name: Optional[str] = None, **kwargs) -> None: self.type_of_change = type_of_change self.index = index diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py index b1672f362e..5d62471710 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrintJobStatus.py @@ -55,7 +55,8 @@ class CloudClusterPrintJobStatus(BaseCloudModel): printed_on_uuid: Optional[str] = None, configuration_changes_required: List[ Union[Dict[str, Any], CloudClusterPrintJobConfigurationChange]] = None, - build_plate: Optional[str] = None, compatible_machine_families: List[str] = None, + build_plate: Union[Dict[str, Any], CloudClusterBuildPlate] = None, + compatible_machine_families: List[str] = None, impediments_to_printing: List[Union[Dict[str, Any], CloudClusterPrintJobImpediment]] = None, **kwargs) -> None: self.assigned_to = assigned_to @@ -76,17 +77,14 @@ class CloudClusterPrintJobStatus(BaseCloudModel): self.uuid = uuid self.deleted_at = deleted_at self.printed_on_uuid = printed_on_uuid - if configuration_changes_required: - self.configuration_changes_required = self.parseModels(CloudClusterPrintJobConfigurationChange, - configuration_changes_required) - else: - self.configuration_changes_required = [] - self.build_plate = self.parseModel(CloudClusterBuildPlate, build_plate) - self.compatible_machine_families = compatible_machine_families - if impediments_to_printing: - self.impediments_to_printing = self.parseModels(CloudClusterPrintJobImpediment, impediments_to_printing) - else: - self.impediments_to_printing = [] + + self.configuration_changes_required = self.parseModels(CloudClusterPrintJobConfigurationChange, + configuration_changes_required) \ + if configuration_changes_required else [] + self.build_plate = self.parseModel(CloudClusterBuildPlate, build_plate) if build_plate else None + self.compatible_machine_families = compatible_machine_families if compatible_machine_families else [] + self.impediments_to_printing = self.parseModels(CloudClusterPrintJobImpediment, impediments_to_printing) \ + if impediments_to_printing else [] super().__init__(**kwargs) @@ -120,7 +118,8 @@ class CloudClusterPrintJobStatus(BaseCloudModel): status_set_by_impediment = False for impediment in self.impediments_to_printing: - if impediment.severity == "UNFIXABLE": # TODO: impediment.severity is defined as int, this will not work, is there a translation? + # TODO: impediment.severity is defined as int, this will not work, is there a translation? + if impediment.severity == "UNFIXABLE": status_set_by_impediment = True model.updateState("error") break @@ -130,8 +129,8 @@ class CloudClusterPrintJobStatus(BaseCloudModel): model.updateConfigurationChanges( [ConfigurationChangeModel( - type_of_change=change.type_of_change, - index=change.index, - target_name=change.target_name, - origin_name=change.origin_name) - for change in self.configuration_changes_required]) + type_of_change = change.type_of_change, + index = change.index if change.index else 0, + target_name = change.target_name if change.target_name else "", + origin_name = change.origin_name if change.origin_name else "") + for change in self.configuration_changes_required]) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterStatus.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterStatus.py index 23409a761d..a8165ff69c 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterStatus.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterStatus.py @@ -33,7 +33,7 @@ class CloudClusterPrinterStatus(BaseCloudModel): configuration: List[Union[Dict[str, Any], CloudClusterPrintCoreConfiguration]], reserved_by: Optional[str] = None, maintenance_required: Optional[bool] = None, firmware_update_status: Optional[str] = None, latest_available_firmware: Optional[str] = None, - build_plate: Optional[str] = None, **kwargs) -> None: + build_plate: Union[Dict[str, Any], CloudClusterBuildPlate] = None, **kwargs) -> None: self.configuration = self.parseModels(CloudClusterPrintCoreConfiguration, configuration) self.enabled = enabled @@ -48,7 +48,7 @@ class CloudClusterPrinterStatus(BaseCloudModel): self.maintenance_required = maintenance_required self.firmware_update_status = firmware_update_status self.latest_available_firmware = latest_available_firmware - self.build_plate = self.parseModel(CloudClusterBuildPlate, build_plate) + self.build_plate = self.parseModel(CloudClusterBuildPlate, build_plate) if build_plate else None super().__init__(**kwargs) ## Creates a new output model.