From 864cbe9c636c3a88fbdd8516307cd995fb938941 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 19 Mar 2018 16:24:07 +0100 Subject: [PATCH] Add exception for UM3 to add UFP as supported format We can't just add it to the supported file formats in the definition because we don't want the removable drive output to write it. Contributes to issue CURA-5097. --- plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py index eda5841310..c804200701 100644 --- a/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py @@ -11,6 +11,7 @@ from UM.Message import Message from UM.Qt.Duration import Duration, DurationFormat from UM.OutputDevice import OutputDeviceError #To show that something went wrong when writing. from UM.Scene.SceneNode import SceneNode #For typing. +from UM.Version import Version #To check against firmware versions for support. from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice, AuthState from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel @@ -96,6 +97,9 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): #Create a list from the supported file formats string. machine_file_formats = Application.getInstance().getGlobalContainerStack().getMetaDataEntry("file_formats").split(";") machine_file_formats = [file_type.strip() for file_type in machine_file_formats] + #Exception for UM3 firmware version >=4.4: UFP is now supported and should be the preferred file format. + if "application/x-ufp" not in machine_file_formats and self.printerType == "ultimaker3" and Version(self.firmwareVersion) >= Version("4.4"): + machine_file_formats = ["application/x-ufp"] + machine_file_formats # Take the intersection between file_formats and machine_file_formats. format_by_mimetype = {format["mime_type"]: format for format in file_formats}