def updateOutputModel(self, model: PrinterOutputModel) -> None: """Updates the given output model. :param model: - The output model to update. """ model.updateKey(self.uuid) model.updateName(self.friendly_name) model.updateUniqueName(self.unique_name) model.updateType(self.machine_variant) model.updateState(self.status if self.enabled else "disabled") model.updateBuildplate( self.build_plate.type if self.build_plate else "glass") model.setCameraUrl( QUrl("http://{}:8080/?action=stream".format(self.ip_address))) if not model.printerConfiguration: # Prevent accessing printer configuration when not available. # This sometimes happens when a printer was just added to a group and Cura is connected to that group. return # Set the possible configurations based on whether a Material Station is present or not. if self.material_station and self.material_station.material_slots: self._updateAvailableConfigurations(model) if self.configuration: self._updateActiveConfiguration(model)
def _createPrinterModel(self, data: Dict[str, Any]) -> PrinterOutputModel: printer = PrinterOutputModel( output_controller=ClusterUM3PrinterOutputController(self), number_of_extruders=self._number_of_extruders) printer.setCameraUrl( QUrl("http://" + data["ip_address"] + ":8080/?action=stream")) self._printers.append(printer) return printer
def updateOutputModel(self, model: PrinterOutputModel) -> None: model.updateKey(self.uuid) model.updateName(self.friendly_name) model.updateType(self.machine_variant) model.updateState(self.status if self.enabled else "disabled") model.updateBuildplate(self.build_plate.type if self.build_plate else "glass") model.setCameraUrl(QUrl("http://{}:8080/?action=stream".format(self.ip_address))) for configuration, extruder_output, extruder_config in \ zip(self.configuration, model.extruders, model.printerConfiguration.extruderConfigurations): configuration.updateOutputModel(extruder_output) configuration.updateConfigurationModel(extruder_config)
def updateOutputModel(self, model: PrinterOutputModel) -> None: model.updateKey(self.uuid) model.updateName(self.friendly_name) model.updateType(self.machine_variant) model.updateState(self.status if self.enabled else "disabled") model.updateBuildplate( self.build_plate.type if self.build_plate else "glass") model.setCameraUrl( QUrl("http://{}:8080/?action=stream".format(self.ip_address))) # Set the possible configurations based on whether a Material Station is present or not. if self.material_station and self.material_station.material_slots: self._updateAvailableConfigurations(model) if self.configuration: self._updateActiveConfiguration(model)
def _createPrinterModel(self, data: Dict[str, Any]) -> PrinterOutputModel: printer = PrinterOutputModel(output_controller = ClusterUM3PrinterOutputController(self), number_of_extruders = self._number_of_extruders) printer.setCameraUrl(QUrl("http://" + data["ip_address"] + ":8080/?action=stream")) self._printers.append(printer) return printer