From c77ff8ea8ba5b17d955662cf275bb14b286335b2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 29 Jun 2017 16:54:12 +0200 Subject: [PATCH 01/11] Initial set of changed setup for sliceinfo CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 93 ++++++++++++++++------------ 1 file changed, 52 insertions(+), 41 deletions(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 7abb218dab..3acd16c322 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -11,6 +11,8 @@ from UM.Message import Message from UM.i18n import i18nCatalog from UM.Logger import Logger +import time + from UM.Qt.Duration import DurationFormat from .SliceInfoJob import SliceInfoJob @@ -50,52 +52,61 @@ class SliceInfo(Extension): try: if not Preferences.getInstance().getValue("info/send_slice_info"): Logger.log("d", "'info/send_slice_info' is turned off.") - return # Do nothing, user does not want to send data - - # Listing all files placed on the buildplate - modelhashes = [] - for node in DepthFirstIterator(CuraApplication.getInstance().getController().getScene().getRoot()): - if node.callDecoration("isSliceable"): - modelhashes.append(node.getMeshData().getHash()) - - # Creating md5sums and formatting them as discussed on JIRA - modelhash_formatted = ",".join(modelhashes) + return # Do nothing, user does not want to send data global_container_stack = Application.getInstance().getGlobalContainerStack() - # Get total material used (in mm^3) + data = dict() # The data that we're going to submit. + data["time_stamp"] = time.time() + data["schema_version"] = 0 + data["cura_version"] = Application.getInstance().getVersion() + data["active_mode"] = "" # TODO + data["language"] = Preferences.getInstance().getValue("general/language") + data["os"] = {"type": platform.system(), "version": platform.version()} + + data["active_machine_type"] = {"definition_id": global_container_stack.definition.getId()} + + data["extruders"] = [] # TODO + + data["quality_profile"] = global_container_stack.quality.getMetaData().get("quality_type") + + data["models"] = [] + # Listing all files placed on the build plate + for node in DepthFirstIterator(CuraApplication.getInstance().getController().getScene().getRoot()): + if node.callDecoration("isSliceable"): + model = dict() + model["hash"] = node.getMeshData().getHash() + bounding_box = node.getBoundingBox() + model["bounding_box"] = {"minimum": {"x": bounding_box.minimum.x, + "y": bounding_box.minimum.y, + "z": bounding_box.minimum.z}, + "maximum": {"x": bounding_box.maximum.x, + "y": bounding_box.maximum.y, + "z": bounding_box.maximum.z}} + model["transformation"] = {"data": str(node.getWorldTransformation().getData())} + print_information = Application.getInstance().getPrintInformation() - material_radius = 0.5 * global_container_stack.getProperty("material_diameter", "value") + print_times= print_information.printTimesPerFeature + data["print_times"] = {"travel": print_times["travel"].getDisplayString(DurationFormat.Format.Seconds), + "support": print_times["support"].getDisplayString(DurationFormat.Format.Seconds), + "infill": print_times["infill"].getDisplayString(DurationFormat.Format.Seconds), + "total": print_information.currentPrintTime.getDisplayString(DurationFormat.Format.Seconds)} - # Send material per extruder - material_used = [str(math.pi * material_radius * material_radius * material_length) for material_length in print_information.materialLengths] - material_used = ",".join(material_used) + print_settings = dict() + print_settings["layer_height"] = global_container_stack.getProperty("layer_height", "value") + print_settings["support_enabled"] = global_container_stack.getProperty("support_enable", "value") + print_settings["infill_density"] = None # TODO: This can be different per extruder & model + print_settings["infill_type"] = None # TODO: This can be different per extruder & model + print_settings["print_sequence"] = global_container_stack.getProperty("print_sequence", "value") + print_settings["platform_adhesion"] = global_container_stack.getProperty("platform_adhesion", "value") + print_settings["retraction_enable"] = None #TODO; Can be different per extruder. + print_settings["travel_speed"] = None # TODO; Can be different per extruder + print_settings["cool_fan_enabled"] = None # TODO; Can be different per extruder + print_settings["bottom_thickness"] = None # TODO; Can be different per extruder & per mesh + print_settings["bottom_thickness"] = None # TODO; Can be different per extruder & per mesh + data["print_settings"] = print_settings - containers = { "": global_container_stack.serialize() } - for container in global_container_stack.getContainers(): - container_id = container.getId() - try: - container_serialized = container.serialize() - except NotImplementedError: - Logger.log("w", "Container %s could not be serialized!", container_id) - continue - if container_serialized: - containers[container_id] = container_serialized - else: - Logger.log("i", "No data found in %s to be serialized!", container_id) - - # Bundle the collected data - submitted_data = { - "processor": platform.processor(), - "machine": platform.machine(), - "platform": platform.platform(), - "settings": json.dumps(containers), # bundle of containers with their serialized contents - "version": Application.getInstance().getVersion(), - "modelhash": modelhash_formatted, - "printtime": print_information.currentPrintTime.getDisplayString(DurationFormat.Format.ISO8601), - "filament": material_used, - "language": Preferences.getInstance().getValue("general/language"), - } + ''' # Convert data to bytes submitted_data = urllib.parse.urlencode(submitted_data) @@ -103,7 +114,7 @@ class SliceInfo(Extension): # Sending slice info non-blocking reportJob = SliceInfoJob(self.info_url, binary_data) - reportJob.start() + reportJob.start()''' except Exception as e: # We really can't afford to have a mistake here, as this would break the sending of g-code to a device # (Either saving or directly to a printer). The functionality of the slice data is not *that* important. From 5c9e3c1e4da7acd68fb6f2a54613160ae6f59d92 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 30 Jun 2017 10:30:33 +0200 Subject: [PATCH 02/11] Extruders are now correctly filled in slicdeInfo CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 3acd16c322..efcb3f7c8a 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -2,6 +2,7 @@ # Cura is released under the terms of the AGPLv3 or higher. from cura.CuraApplication import CuraApplication +from cura.Settings.ExtruderManager import ExtruderManager from UM.Extension import Extension from UM.Application import Application @@ -55,6 +56,7 @@ class SliceInfo(Extension): return # Do nothing, user does not want to send data global_container_stack = Application.getInstance().getGlobalContainerStack() + print_information = Application.getInstance().getPrintInformation() data = dict() # The data that we're going to submit. data["time_stamp"] = time.time() @@ -66,7 +68,21 @@ class SliceInfo(Extension): data["active_machine_type"] = {"definition_id": global_container_stack.definition.getId()} - data["extruders"] = [] # TODO + data["extruders"] = [] + extruders = list(ExtruderManager.getInstance().getMachineExtruders(global_container_stack.getId())) + extruders = sorted(extruders, key = lambda extruder: extruder.getMetaDataEntry("position")) + + if not extruders: + extruders = [global_container_stack] + + for extruder in extruders: + extruder_dict = dict() + extruder_dict["active"] = ExtruderManager.getInstance().getActiveExtruderStack() == extruder + extruder_dict["material"] = extruder.material.getMetaData().get("GUID", "") + extruder_dict["material_used"] = print_information.materialLengths[int(extruder.getMetaDataEntry("position", "0"))] + extruder_dict["variant"] = extruder.variant.getName() + extruder_dict["nozzle_size"] = extruder.getProperty("machine_nozzle_size", "value") + data["extruders"].append(extruder_dict) data["quality_profile"] = global_container_stack.quality.getMetaData().get("quality_type") @@ -84,8 +100,10 @@ class SliceInfo(Extension): "y": bounding_box.maximum.y, "z": bounding_box.maximum.z}} model["transformation"] = {"data": str(node.getWorldTransformation().getData())} + extruder_position = node.callDecoration("getActiveExtruderPosition") + model["extruder"] = 0 if extruder_position is None else extruder_position + - print_information = Application.getInstance().getPrintInformation() print_times= print_information.printTimesPerFeature data["print_times"] = {"travel": print_times["travel"].getDisplayString(DurationFormat.Format.Seconds), "support": print_times["support"].getDisplayString(DurationFormat.Format.Seconds), @@ -105,7 +123,7 @@ class SliceInfo(Extension): print_settings["bottom_thickness"] = None # TODO; Can be different per extruder & per mesh print_settings["bottom_thickness"] = None # TODO; Can be different per extruder & per mesh data["print_settings"] = print_settings - + #print(data) ''' # Convert data to bytes From d38eb7f4e4881865cf0aafc0393ba6634df3583c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 30 Jun 2017 10:35:16 +0200 Subject: [PATCH 03/11] Model data is now actually appended to data that's being sent CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index efcb3f7c8a..091cdcb5af 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -102,6 +102,7 @@ class SliceInfo(Extension): model["transformation"] = {"data": str(node.getWorldTransformation().getData())} extruder_position = node.callDecoration("getActiveExtruderPosition") model["extruder"] = 0 if extruder_position is None else extruder_position + data["models"].append(model) print_times= print_information.printTimesPerFeature From 9db00fa9c0d05daec6beff9a57629d928bd06031 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 30 Jun 2017 10:39:22 +0200 Subject: [PATCH 04/11] Also send if the user changed the machine definition CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 091cdcb5af..11890650fb 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -63,6 +63,7 @@ class SliceInfo(Extension): data["schema_version"] = 0 data["cura_version"] = Application.getInstance().getVersion() data["active_mode"] = "" # TODO + data["machine_settings_changed_by_user"] = global_container_stack.definitionChanges.getId() != "empty" data["language"] = Preferences.getInstance().getValue("general/language") data["os"] = {"type": platform.system(), "version": platform.version()} From a8492b3a6fede8de8bd8c63970a20c4b075f7511 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 30 Jun 2017 13:33:39 +0200 Subject: [PATCH 05/11] Added few more fields (brand & manufacturer) to brand & machine CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 11890650fb..8c969ffeec 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -67,7 +67,7 @@ class SliceInfo(Extension): data["language"] = Preferences.getInstance().getValue("general/language") data["os"] = {"type": platform.system(), "version": platform.version()} - data["active_machine_type"] = {"definition_id": global_container_stack.definition.getId()} + data["active_machine"] = {"definition_id": global_container_stack.definition.getId(), "manufacturer": global_container_stack.definition.getMetaData().get("manufacturer","")} data["extruders"] = [] extruders = list(ExtruderManager.getInstance().getMachineExtruders(global_container_stack.getId())) @@ -79,7 +79,10 @@ class SliceInfo(Extension): for extruder in extruders: extruder_dict = dict() extruder_dict["active"] = ExtruderManager.getInstance().getActiveExtruderStack() == extruder - extruder_dict["material"] = extruder.material.getMetaData().get("GUID", "") + extruder_dict["material"] = {"GUID": extruder.material.getMetaData().get("GUID", ""), + "type": extruder.material.getMetaData().get("material", ""), + "brand": extruder.material.getMetaData().get("brand", "") + } extruder_dict["material_used"] = print_information.materialLengths[int(extruder.getMetaDataEntry("position", "0"))] extruder_dict["variant"] = extruder.variant.getName() extruder_dict["nozzle_size"] = extruder.getProperty("machine_nozzle_size", "value") From 3abde17466c4997cf44a8f056584ffac3aea6fbe Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 3 Jul 2017 12:57:50 +0200 Subject: [PATCH 06/11] Updated list of settings to be sent. CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 68 +++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 11 deletions(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 8c969ffeec..e00eae7523 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -86,6 +86,16 @@ class SliceInfo(Extension): extruder_dict["material_used"] = print_information.materialLengths[int(extruder.getMetaDataEntry("position", "0"))] extruder_dict["variant"] = extruder.variant.getName() extruder_dict["nozzle_size"] = extruder.getProperty("machine_nozzle_size", "value") + + extruder_settings = dict() + extruder_settings["wall_line_count"] = extruder.getProperty("wall_line_count", "value") + extruder_settings["retraction_enable"] = extruder.getProperty("retraction_enable", "value") + extruder_settings["infill_sparse_density"] = extruder.getProperty("infill_sparse_density", "value") + extruder_settings["infill_pattern"] = extruder.getProperty("infill_pattern", "value") + extruder_settings["gradual_infill_steps"] = extruder.getProperty("gradual_infill_steps", "value") + extruder_settings["default_material_print_temperature"] = extruder.getProperty("default_material_print_temperature", "value") + extruder_settings["material_print_temperature"] = extruder.getProperty("material_print_temperature", "value") + extruder_dict["extruder_settings"] = extruder_settings data["extruders"].append(extruder_dict) data["quality_profile"] = global_container_stack.quality.getMetaData().get("quality_type") @@ -106,10 +116,34 @@ class SliceInfo(Extension): model["transformation"] = {"data": str(node.getWorldTransformation().getData())} extruder_position = node.callDecoration("getActiveExtruderPosition") model["extruder"] = 0 if extruder_position is None else extruder_position + + + model_settings = dict() + model_stack = node.callDecoration("getStack") + if model_stack: + model_settings["support_enabled"] = model_stack.getProperty("support_enable", "value") + model_settings["support_extruder_nr"] = int(model_stack.getProperty("support_extruder_nr", "value")) + + # Mesh modifiers; + model_settings["infill_mesh"] = model_stack.getProperty("infill_mesh", "value") + model_settings["cutting_mesh"] = model_stack.getProperty("cutting_mesh", "value") + model_settings["support_mesh"] = model_stack.getProperty("support_mesh", "value") + model_settings["anti_overhang_mesh"] = model_stack.getProperty("anti_overhang_mesh", "value") + + model_settings["wall_line_count"] = model_stack.getProperty("wall_line_count", "value") + model_settings["retraction_enable"] = model_stack.getProperty("retraction_enable", "value") + + # Infill settings + model_settings["infill_sparse_density"] = model_stack.getProperty("infill_sparse_density", "value") + model_settings["infill_pattern"] = model_stack.getProperty("infill_pattern", "value") + model_settings["gradual_infill_steps"] = model_stack.getProperty("gradual_infill_steps", "value") + + + model["model_settings"] = model_settings + data["models"].append(model) - - print_times= print_information.printTimesPerFeature + print_times = print_information.printTimesPerFeature data["print_times"] = {"travel": print_times["travel"].getDisplayString(DurationFormat.Format.Seconds), "support": print_times["support"].getDisplayString(DurationFormat.Format.Seconds), "infill": print_times["infill"].getDisplayString(DurationFormat.Format.Seconds), @@ -117,18 +151,30 @@ class SliceInfo(Extension): print_settings = dict() print_settings["layer_height"] = global_container_stack.getProperty("layer_height", "value") + + # Support settings print_settings["support_enabled"] = global_container_stack.getProperty("support_enable", "value") - print_settings["infill_density"] = None # TODO: This can be different per extruder & model - print_settings["infill_type"] = None # TODO: This can be different per extruder & model - print_settings["print_sequence"] = global_container_stack.getProperty("print_sequence", "value") + print_settings["support_extruder_nr"] = int(global_container_stack.getProperty("support_extruder_nr", "value")) + + # Platform adhesion settings print_settings["platform_adhesion"] = global_container_stack.getProperty("platform_adhesion", "value") - print_settings["retraction_enable"] = None #TODO; Can be different per extruder. - print_settings["travel_speed"] = None # TODO; Can be different per extruder - print_settings["cool_fan_enabled"] = None # TODO; Can be different per extruder - print_settings["bottom_thickness"] = None # TODO; Can be different per extruder & per mesh - print_settings["bottom_thickness"] = None # TODO; Can be different per extruder & per mesh + + # Shell settings + print_settings["wall_line_count"] = global_container_stack.getProperty("wall_line_count", "value") + print_settings["retraction_enable"] = global_container_stack.getProperty("retraction_enable", "value") + + # Prime tower settings + print_settings["prime_tower_enable"] = global_container_stack.getProperty("prime_tower_enable", "value") + + # Infill settings + print_settings["infill_sparse_density"] = global_container_stack.getProperty("infill_sparse_density", "value") + print_settings["infill_pattern"] = global_container_stack.getProperty("infill_pattern", "value") + print_settings["gradual_infill_steps"] = global_container_stack.getProperty("gradual_infill_steps", "value") + + print_settings["print_sequence"] = global_container_stack.getProperty("print_sequence", "value") + data["print_settings"] = print_settings - #print(data) + #print(json.dumps(data)) ''' # Convert data to bytes From 1682348629d61691d509adc2d1ba7010be2c8f7c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 3 Jul 2017 13:10:17 +0200 Subject: [PATCH 07/11] Send data to new server CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index e00eae7523..66fc507918 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -31,7 +31,7 @@ catalog = i18nCatalog("cura") # The data is only sent when the user in question gave permission to do so. All data is anonymous and # no model files are being sent (Just a SHA256 hash of the model). class SliceInfo(Extension): - info_url = "https://stats.youmagine.com/curastats/slice" + info_url = "http://stats.ultimaker.com/api/cura" def __init__(self): super().__init__() @@ -174,17 +174,14 @@ class SliceInfo(Extension): print_settings["print_sequence"] = global_container_stack.getProperty("print_sequence", "value") data["print_settings"] = print_settings - #print(json.dumps(data)) - ''' # Convert data to bytes - submitted_data = urllib.parse.urlencode(submitted_data) - binary_data = submitted_data.encode("utf-8") + binary_data = json.dumps(data).encode("utf-8") # Sending slice info non-blocking reportJob = SliceInfoJob(self.info_url, binary_data) - reportJob.start()''' - except Exception as e: + reportJob.start() + except Exception: # We really can't afford to have a mistake here, as this would break the sending of g-code to a device # (Either saving or directly to a printer). The functionality of the slice data is not *that* important. - Logger.log("e", "Exception raised while sending slice info: %s" %(repr(e))) # But we should be notified about these problems of course. + Logger.logException("e", "Exception raised while sending slice info.") # But we should be notified about these problems of course. From d69736ac34a3f0d3527bdecf0aa606fe10ed51c4 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 3 Jul 2017 13:13:42 +0200 Subject: [PATCH 08/11] Filter \n from transformation string CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 66fc507918..0c6fa14b3b 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -113,7 +113,7 @@ class SliceInfo(Extension): "maximum": {"x": bounding_box.maximum.x, "y": bounding_box.maximum.y, "z": bounding_box.maximum.z}} - model["transformation"] = {"data": str(node.getWorldTransformation().getData())} + model["transformation"] = {"data": str(node.getWorldTransformation().getData()).replace("\n", "")} extruder_position = node.callDecoration("getActiveExtruderPosition") model["extruder"] = 0 if extruder_position is None else extruder_position From a1413e816238cf226dd0a621ee61306d9f1a6ca8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 3 Jul 2017 13:18:23 +0200 Subject: [PATCH 09/11] Added active mode to sliceinfo CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 0c6fa14b3b..bce98dd681 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -62,7 +62,13 @@ class SliceInfo(Extension): data["time_stamp"] = time.time() data["schema_version"] = 0 data["cura_version"] = Application.getInstance().getVersion() - data["active_mode"] = "" # TODO + + active_mode = Preferences.getInstance().getValue("cura/active_mode") + if active_mode == 0: + data["active_mode"] = "recommended" + else: + data["active_mode"] = "custom" + data["machine_settings_changed_by_user"] = global_container_stack.definitionChanges.getId() != "empty" data["language"] = Preferences.getInstance().getValue("general/language") data["os"] = {"type": platform.system(), "version": platform.version()} @@ -117,7 +123,6 @@ class SliceInfo(Extension): extruder_position = node.callDecoration("getActiveExtruderPosition") model["extruder"] = 0 if extruder_position is None else extruder_position - model_settings = dict() model_stack = node.callDecoration("getStack") if model_stack: @@ -138,7 +143,6 @@ class SliceInfo(Extension): model_settings["infill_pattern"] = model_stack.getProperty("infill_pattern", "value") model_settings["gradual_infill_steps"] = model_stack.getProperty("gradual_infill_steps", "value") - model["model_settings"] = model_settings data["models"].append(model) From 1b6152b79333fe6df702c89e3b67689b294a29e9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 4 Jul 2017 09:43:18 +0200 Subject: [PATCH 10/11] Send print times & extruders as string CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index bce98dd681..cab329b6f6 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -121,7 +121,7 @@ class SliceInfo(Extension): "z": bounding_box.maximum.z}} model["transformation"] = {"data": str(node.getWorldTransformation().getData()).replace("\n", "")} extruder_position = node.callDecoration("getActiveExtruderPosition") - model["extruder"] = 0 if extruder_position is None else extruder_position + model["extruder"] = 0 if extruder_position is None else int(extruder_position) model_settings = dict() model_stack = node.callDecoration("getStack") @@ -148,10 +148,10 @@ class SliceInfo(Extension): data["models"].append(model) print_times = print_information.printTimesPerFeature - data["print_times"] = {"travel": print_times["travel"].getDisplayString(DurationFormat.Format.Seconds), - "support": print_times["support"].getDisplayString(DurationFormat.Format.Seconds), - "infill": print_times["infill"].getDisplayString(DurationFormat.Format.Seconds), - "total": print_information.currentPrintTime.getDisplayString(DurationFormat.Format.Seconds)} + data["print_times"] = {"travel": int(print_times["travel"].getDisplayString(DurationFormat.Format.Seconds)), + "support": int(print_times["support"].getDisplayString(DurationFormat.Format.Seconds)), + "infill": int(print_times["infill"].getDisplayString(DurationFormat.Format.Seconds)), + "total": int(print_information.currentPrintTime.getDisplayString(DurationFormat.Format.Seconds))} print_settings = dict() print_settings["layer_height"] = global_container_stack.getProperty("layer_height", "value") From 3ee72a53933654e33a96455a9d3c43f461539d4c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 4 Jul 2017 10:19:11 +0200 Subject: [PATCH 11/11] Fixed sending wrong setting for bed adhesion CURA-3858 --- plugins/SliceInfoPlugin/SliceInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index cab329b6f6..83f17dcb27 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -161,7 +161,7 @@ class SliceInfo(Extension): print_settings["support_extruder_nr"] = int(global_container_stack.getProperty("support_extruder_nr", "value")) # Platform adhesion settings - print_settings["platform_adhesion"] = global_container_stack.getProperty("platform_adhesion", "value") + print_settings["adhesion_type"] = global_container_stack.getProperty("adhesion_type", "value") # Shell settings print_settings["wall_line_count"] = global_container_stack.getProperty("wall_line_count", "value")