mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Fixing the rest of the automatic test failures
This commit is contained in:
parent
131211e604
commit
12a4a5e9f5
3 changed files with 21 additions and 23 deletions
|
@ -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
|
||||
|
|
|
@ -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 = []
|
||||
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
|
||||
|
@ -131,7 +130,7 @@ 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)
|
||||
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])
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue