Merge branch 'master' into PP-50_0.3mm_layer_height_print_profiles

This commit is contained in:
p.kuiper 2021-12-09 08:16:55 +01:00
commit 21d914f158
3 changed files with 14 additions and 12 deletions

View File

@ -42,7 +42,7 @@ class PrintJobOutputModel(QObject):
self._preview_image = None # type: Optional[QImage] self._preview_image = None # type: Optional[QImage]
@pyqtProperty("QStringList", notify=compatibleMachineFamiliesChanged) @pyqtProperty("QStringList", notify=compatibleMachineFamiliesChanged)
def compatibleMachineFamilies(self): def compatibleMachineFamilies(self) -> List[str]:
# Hack; Some versions of cluster will return a family more than once... # Hack; Some versions of cluster will return a family more than once...
return list(set(self._compatible_machine_families)) return list(set(self._compatible_machine_families))
@ -78,10 +78,10 @@ class PrintJobOutputModel(QObject):
self.configurationChanged.emit() self.configurationChanged.emit()
@pyqtProperty(str, notify = ownerChanged) @pyqtProperty(str, notify = ownerChanged)
def owner(self): def owner(self) -> str:
return self._owner return self._owner
def updateOwner(self, owner): def updateOwner(self, owner: str) -> None:
if self._owner != owner: if self._owner != owner:
self._owner = owner self._owner = owner
self.ownerChanged.emit() self.ownerChanged.emit()
@ -151,12 +151,12 @@ class PrintJobOutputModel(QObject):
return False return False
return True return True
def updateTimeTotal(self, new_time_total): def updateTimeTotal(self, new_time_total: int) -> None:
if self._time_total != new_time_total: if self._time_total != new_time_total:
self._time_total = new_time_total self._time_total = new_time_total
self.timeTotalChanged.emit() self.timeTotalChanged.emit()
def updateTimeElapsed(self, new_time_elapsed): def updateTimeElapsed(self, new_time_elapsed: int) -> None:
if self._time_elapsed != new_time_elapsed: if self._time_elapsed != new_time_elapsed:
self._time_elapsed = new_time_elapsed self._time_elapsed = new_time_elapsed
self.timeElapsedChanged.emit() self.timeElapsedChanged.emit()

View File

@ -40,7 +40,7 @@ class ClusterPrintJobStatus(BaseModel):
configuration_changes_required: List[ configuration_changes_required: List[
Union[Dict[str, Any], ClusterPrintJobConfigurationChange]] = None, Union[Dict[str, Any], ClusterPrintJobConfigurationChange]] = None,
build_plate: Union[Dict[str, Any], ClusterBuildPlate] = None, build_plate: Union[Dict[str, Any], ClusterBuildPlate] = None,
compatible_machine_families: List[str] = None, compatible_machine_families: Optional[List[str]] = None,
impediments_to_printing: List[Union[Dict[str, Any], ClusterPrintJobImpediment]] = None, impediments_to_printing: List[Union[Dict[str, Any], ClusterPrintJobImpediment]] = None,
preview_url: Optional[str] = None, preview_url: Optional[str] = None,
**kwargs) -> None: **kwargs) -> None:
@ -97,7 +97,7 @@ class ClusterPrintJobStatus(BaseModel):
configuration_changes_required) \ configuration_changes_required) \
if configuration_changes_required else [] if configuration_changes_required else []
self.build_plate = self.parseModel(ClusterBuildPlate, build_plate) if build_plate else None self.build_plate = self.parseModel(ClusterBuildPlate, build_plate) if build_plate else None
self.compatible_machine_families = compatible_machine_families if compatible_machine_families else [] self.compatible_machine_families = compatible_machine_families if compatible_machine_families is not None else []
self.impediments_to_printing = self.parseModels(ClusterPrintJobImpediment, impediments_to_printing) \ self.impediments_to_printing = self.parseModels(ClusterPrintJobImpediment, impediments_to_printing) \
if impediments_to_printing else [] if impediments_to_printing else []
@ -130,7 +130,9 @@ class ClusterPrintJobStatus(BaseModel):
model.updateConfiguration(self._createConfigurationModel()) model.updateConfiguration(self._createConfigurationModel())
model.updateTimeTotal(self.time_total) model.updateTimeTotal(self.time_total)
if self.time_elapsed is not None:
model.updateTimeElapsed(self.time_elapsed) model.updateTimeElapsed(self.time_elapsed)
if self.owner is not None:
model.updateOwner(self.owner) model.updateOwner(self.owner)
model.updateState(self.status) model.updateState(self.status)
model.setCompatibleMachineFamilies(self.compatible_machine_families) model.setCompatibleMachineFamilies(self.compatible_machine_families)

View File

@ -2087,7 +2087,7 @@
"default_value": 0, "default_value": 0,
"type": "int", "type": "int",
"minimum_value": "0", "minimum_value": "0",
"maximum_value_warning": "1 if (infill_pattern == 'cross' or infill_pattern == 'cross_3d' or support_pattern == 'concentric') else 5", "maximum_value_warning": "1 if (infill_pattern == 'cross' or infill_pattern == 'cross_3d' or infill_pattern == 'concentric') else 5",
"maximum_value": "999999 if infill_line_distance == 0 else (20 - math.log(infill_line_distance) / math.log(2))", "maximum_value": "999999 if infill_line_distance == 0 else (20 - math.log(infill_line_distance) / math.log(2))",
"enabled": "infill_sparse_density > 0 and infill_pattern not in ['cubicsubdiv', 'cross', 'cross_3d', 'lightning']", "enabled": "infill_sparse_density > 0 and infill_pattern not in ['cubicsubdiv', 'cross', 'cross_3d', 'lightning']",
"limit_to_extruder": "infill_extruder_nr", "limit_to_extruder": "infill_extruder_nr",