Example #1
0
    def _createPrintJobModel(self, data: Dict[str,
                                              Any]) -> UM3PrintJobOutputModel:
        print_job = UM3PrintJobOutputModel(
            output_controller=ClusterUM3PrinterOutputController(self),
            key=data["uuid"],
            name=data["name"])

        configuration = PrinterConfigurationModel()
        extruders = [
            ExtruderConfigurationModel(position=idx)
            for idx in range(0, self._number_of_extruders)
        ]
        for index in range(0, self._number_of_extruders):
            try:
                extruder_data = data["configuration"][index]
            except IndexError:
                continue
            extruder = extruders[int(
                data["configuration"][index]["extruder_index"])]
            extruder.setHotendID(extruder_data.get("print_core_id", ""))
            extruder.setMaterial(
                self._createMaterialOutputModel(
                    extruder_data.get("material", {})))

        configuration.setExtruderConfigurations(extruders)
        configuration.setPrinterType(data.get("machine_variant", ""))
        print_job.updateConfiguration(configuration)
        print_job.setCompatibleMachineFamilies(
            data.get("compatible_machine_families", []))
        print_job.stateChanged.connect(self._printJobStateChanged)
        return print_job
Example #2
0
 def _createConfigurationModel(self) -> PrinterConfigurationModel:
     extruders = [
         extruder.createConfigurationModel()
         for extruder in self.configuration or ()
     ]
     configuration = PrinterConfigurationModel()
     configuration.setExtruderConfigurations(extruders)
     configuration.setPrinterType(self.machine_variant)
     return configuration
Example #3
0
def _build_printer_conf_model() -> PrinterConfigurationModel:
    """Returns printer's configuration model."""
    printer_configuration_model = PrinterConfigurationModel()
    extruder_conf_model = ExtruderConfigurationModel()
    extruder_conf_model.setPosition(0)
    printer_configuration_model.setExtruderConfigurations(
        [extruder_conf_model])
    printer_configuration_model.setPrinterType('type')
    return printer_configuration_model
Example #4
0
 def _createAvailableConfigurationFromPrinterConfiguration(
     left_slot: ClusterPrinterMaterialStationSlot,
     right_slot: ClusterPrinterMaterialStationSlot,
     printer_configuration: PrinterConfigurationModel
 ) -> PrinterConfigurationModel:
     available_configuration = PrinterConfigurationModel()
     available_configuration.setExtruderConfigurations([
         left_slot.createConfigurationModel(),
         right_slot.createConfigurationModel()
     ])
     available_configuration.setPrinterType(
         printer_configuration.printerType)
     available_configuration.setBuildplateConfiguration(
         printer_configuration.buildplateConfiguration)
     return available_configuration
Example #5
0
    def _createPrintJobModel(self, data: Dict[str, Any]) -> UM3PrintJobOutputModel:
        print_job = UM3PrintJobOutputModel(output_controller=ClusterUM3PrinterOutputController(self),
                                        key=data["uuid"], name= data["name"])

        configuration = PrinterConfigurationModel()
        extruders = [ExtruderConfigurationModel(position = idx) for idx in range(0, self._number_of_extruders)]
        for index in range(0, self._number_of_extruders):
            try:
                extruder_data = data["configuration"][index]
            except IndexError:
                continue
            extruder = extruders[int(data["configuration"][index]["extruder_index"])]
            extruder.setHotendID(extruder_data.get("print_core_id", ""))
            extruder.setMaterial(self._createMaterialOutputModel(extruder_data.get("material", {})))

        configuration.setExtruderConfigurations(extruders)
        configuration.setPrinterType(data.get("machine_variant", ""))
        print_job.updateConfiguration(configuration)
        print_job.setCompatibleMachineFamilies(data.get("compatible_machine_families", []))
        print_job.stateChanged.connect(self._printJobStateChanged)
        return print_job